Install Cluster API Operator
This section describes how to install Cluster API Operator
in the Kubernetes cluster.
Installing Cluster API (CAPI) and providers​
CAPI
and desired CAPI
providers could be installed using the helm-based installation for Cluster API Operator
or as a helm dependency for the Rancher Turtles
.
Install as a Rancher Turtles
dependency (recommended)​
See the Rancher Turtles
section for installing the operator as a Helm dependency
Install manually with Helm (alternative)​
To install Cluster API Operator
with version 1.4.6
of the CAPI
+ Docker
provider using helm, follow these steps:
- Add the Helm repository for the
Cluster API Operator
:
helm repo add capi-operator https://kubernetes-sigs.github.io/cluster-api-operator
- Update the Helm repository:
helm repo update
- Install the
Cluster API Operator
, which will also installcert-manager
:
helm install capi-operator capi-operator/cluster-api-operator
--create-namespace -n capi-operator-system
--set infrastructure=docker:v1.4.6
--set core=cluster-api:v1.4.6
--set cert-manager.enabled=true
--timeout 90s --wait # Core Cluster API with kubeadm bootstrap and control plane providers will also be installed
cert-manager
is a hard requirement for CAPI
and Cluster API Operator
*
To provide additional environment variables, enable feature gates, or supply cloud credentials, similar to clusterctl
common provider, variables secret with name
and a namespace
of the secret could be specified for the Cluster API Operator
as shown below.
helm install capi-operator capi-operator/cluster-api-operator
--create-namespace -n capi-operator-system
--set infrastructure=docker:v1.4.6
--set core=cluster-api:v1.4.6
--set cert-manager.enabled=true
--timeout 90s
--secret-name <secret_name>
--secret-namespace <secret_namespace>
--wait
Example secret data:
apiVersion: v1
kind: Secret
metadata:
name: variables
namespace: default
type: Opaque
stringData:
CLUSTER_TOPOLOGY: "true"
EXP_CLUSTER_RESOURCE_SET: "true"
To select more than one desired provider to be installed together with the Cluster API Operator
, the --infrastructure
flag can be specified with multiple provider names separated by a comma. For example:
helm install ... --set infrastructure="docker:v1.4.6;azure:v1.4.6"
The infrastructure
flag is set to docker:v1.4.6;azure:v1.4.6
, representing the desired provider names. This means that the Cluster API Operator
will install and manage multiple providers, Docker
and Azure
respectively, with versions v1.4.6
specified in this example.
For more fine-grained control of the providers and other components installed with CAPI, see the Add the infrastructure provider section.