|
| 1 | +# Quickstart |
| 2 | + |
| 3 | +This is a quickstart guide for getting Cluster API Operator up and running on your Kubernetes cluster. |
| 4 | + |
| 5 | +For more detailed information, please refer to the full documentation. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- [Running Kubernetes cluster](https://cluster-api.sigs.k8s.io/user/quick-start#install-andor-configure-a-kubernetes-cluster). |
| 10 | +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) for interacting with the management cluster. |
| 11 | +- [Helm](https://helm.sh/docs/intro/install/) for installing operator on the cluster (optional). |
| 12 | + |
| 13 | +## Install and configure Cluster API Operator |
| 14 | + |
| 15 | +### Configuring credential for cloud providers |
| 16 | + |
| 17 | +Instead of using environment variables as clusterctl does, Cluster API Operator uses Kubernetes secrets to store credentials for cloud providers. Refer to [provider documentation](https://cluster-api.sigs.k8s.io/user/quick-start#initialization-for-common-providers) on which credentials are required. |
| 18 | + |
| 19 | +This example uses AWS provider, but the same approach can be used for other providers. |
| 20 | + |
| 21 | +```bash |
| 22 | +export CREDENTIALS_SECRET_NAME="credentials-secret" |
| 23 | +export CREDENTIALS_SECRET_NAMESPACE="default" |
| 24 | + |
| 25 | +kubectl create secret generic "${CREDENTIALS_SECRET_NAME}" --from-literal=AWS_B64ENCODED_CREDENTIALS="${AWS_B64ENCODED_CREDENTIALS}" --namespace "${CREDENTIALS_SECRET_NAMESPACE}" |
| 26 | +``` |
| 27 | + |
| 28 | +### Installing Cluster API Operator |
| 29 | + |
| 30 | +Add helm repository: |
| 31 | + |
| 32 | +```bash |
| 33 | +helm repo add capi-operator https://kubernetes-sigs.github.io/cluster-api-operator |
| 34 | +helm repo update |
| 35 | +``` |
| 36 | + |
| 37 | +Deploy Cluster API components with docker provider using a single command during operator installation |
| 38 | + |
| 39 | +```bash |
| 40 | +helm install capi-operator capi-operator/cluster-api-operator --create-namespace -n capi-operator-system --set infrastructure=docker --set cert-manager.enabled=true --set configSecret.name=${CREDENTIALS_SECRET_NAME} --set configSecret.namespace=${CREDENTIALS_SECRET_NAMESPACE} --wait --timeout 90s |
| 41 | +``` |
| 42 | + |
| 43 | +Docker provider can be replaced by any provider supported by [clusterctl](https://cluster-api.sigs.k8s.io/reference/providers.html?highlight=hetz#infrastructure). |
| 44 | + |
| 45 | +Other options for installing Cluster API Operator are described in [full documentation](README.md#installation). |
| 46 | + |
| 47 | +# Example API Usage |
| 48 | + |
| 49 | +Deploy latest version of core Cluster API components: |
| 50 | + |
| 51 | +```yaml |
| 52 | +apiVersion: operator.cluster.x-k8s.io/v1alpha2 |
| 53 | +kind: CoreProvider |
| 54 | +metadata: |
| 55 | + name: cluster-api |
| 56 | + namespace: capi-system |
| 57 | + |
| 58 | +``` |
| 59 | + |
| 60 | +Deploy Cluster API AWS provider with specific version, custom manager options and flags: |
| 61 | + |
| 62 | +```yaml |
| 63 | +--- |
| 64 | +apiVersion: operator.cluster.x-k8s.io/v1alpha2 |
| 65 | +kind: InfrastructureProvider |
| 66 | +metadata: |
| 67 | + name: aws |
| 68 | + namespace: capa-system |
| 69 | +spec: |
| 70 | + version: v2.1.4 |
| 71 | + configSecret: |
| 72 | + name: aws-variables |
| 73 | + manager: |
| 74 | + # These top level controller manager flags, supported by all the providers. |
| 75 | + # These flags come with sensible defaults, thus requiring no or minimal |
| 76 | + # changes for the most common scenarios. |
| 77 | + metrics: |
| 78 | + bindAddress: ":8181" |
| 79 | + syncPeriod: "500s" |
| 80 | + fetchConfig: |
| 81 | + url: https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases |
| 82 | + deployment: |
| 83 | + containers: |
| 84 | + - name: manager |
| 85 | + args: |
| 86 | + # These are controller flags that are specific to a provider; usage |
| 87 | + # is reserved for advanced scenarios only. |
| 88 | + "--awscluster-concurrency": "12" |
| 89 | + "--awsmachine-concurrency": "11" |
| 90 | +``` |
0 commit comments