generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 108
📖 Add CAPI operator quickstart docs #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:main
from
alexander-demicev:quickstart
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Quickstart | ||
|
||
This is a quickstart guide for getting Cluster API Operator up and running on your Kubernetes cluster. | ||
|
||
For more detailed information, please refer to the full documentation. | ||
|
||
## Prerequisites | ||
|
||
- [Running Kubernetes cluster](https://cluster-api.sigs.k8s.io/user/quick-start#install-andor-configure-a-kubernetes-cluster). | ||
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) for interacting with the management cluster. | ||
- [Helm](https://helm.sh/docs/intro/install/) for installing operator on the cluster (optional). | ||
|
||
## Install and configure Cluster API Operator | ||
|
||
### Configuring credential for cloud providers | ||
|
||
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. | ||
|
||
This example uses AWS provider, but the same approach can be used for other providers. | ||
|
||
```bash | ||
export CREDENTIALS_SECRET_NAME="credentials-secret" | ||
export CREDENTIALS_SECRET_NAMESPACE="default" | ||
|
||
kubectl create secret generic "${CREDENTIALS_SECRET_NAME}" --from-literal=AWS_B64ENCODED_CREDENTIALS="${AWS_B64ENCODED_CREDENTIALS}" --namespace "${CREDENTIALS_SECRET_NAMESPACE}" | ||
``` | ||
|
||
### Installing Cluster API Operator | ||
|
||
Add helm repository: | ||
|
||
```bash | ||
helm repo add capi-operator https://kubernetes-sigs.github.io/cluster-api-operator | ||
helm repo update | ||
``` | ||
|
||
Deploy Cluster API components with docker provider using a single command during operator installation | ||
|
||
```bash | ||
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 | ||
``` | ||
|
||
Docker provider can be replaced by any provider supported by [clusterctl](https://cluster-api.sigs.k8s.io/reference/providers.html?highlight=hetz#infrastructure). | ||
|
||
Other options for installing Cluster API Operator are described in [full documentation](README.md#installation). | ||
|
||
# Example API Usage | ||
alexander-demicev marked this conversation as resolved.
Show resolved
Hide resolved
alexander-demicev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Deploy latest version of core Cluster API components: | ||
|
||
```yaml | ||
apiVersion: operator.cluster.x-k8s.io/v1alpha2 | ||
kind: CoreProvider | ||
metadata: | ||
name: cluster-api | ||
namespace: capi-system | ||
|
||
``` | ||
|
||
Deploy Cluster API AWS provider with specific version, custom manager options and flags: | ||
|
||
```yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This example contains a lot of unnecessary parameters. I suggest to keep it simple as apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: InfrastructureProvider
metadata:
name: aws
namespace: capa-system
spec:
version: v2.1.4
configSecret:
name: aws-variables Users can check what they can configure in the README later. |
||
--- | ||
apiVersion: operator.cluster.x-k8s.io/v1alpha2 | ||
kind: InfrastructureProvider | ||
metadata: | ||
name: aws | ||
namespace: capa-system | ||
spec: | ||
version: v2.1.4 | ||
configSecret: | ||
name: aws-variables | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.