-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add provider section with examples
- Loading branch information
1 parent
cf926ca
commit 14df9fd
Showing
4 changed files
with
126 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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,57 @@ | ||
--- | ||
sidebar_position: 0 | ||
--- | ||
|
||
# Create & import a cluster using CAPI provider for AWS | ||
|
||
Remember that most Cluster API Providers are upstream projects maintained by the Kubernetes open-source community. | ||
|
||
## Prerequisites | ||
|
||
- Rancher Manager cluster with Rancher Turtles installed | ||
- Cluster API providers installed for your scenario - we'll be using the AWS infrastructure in these instructions - you can find a guide on how to install a provider using the `CAPIProvider` resource [here](../../tasks/capi-operator/basic_cluster_api_provider_installation.md) | ||
- **clusterctl** CLI - see the [releases](https://github.com/kubernetes-sigs/cluster-api/releases) | ||
|
||
## Create Your Cluster Definition | ||
|
||
To generate the YAML for the cluster, do the following (assuming the Docker infrastructure provider is being used): | ||
|
||
1. Open a terminal and run the following: | ||
|
||
```bash | ||
export KUBERNETES_VERSION=v1.28 | ||
export AWS_REGION=eu-west-2 | ||
export AWS_INSTANCE_TYPE=t3.medium | ||
|
||
clusterctl generate cluster cluster1 \ | ||
--from https://raw.githubusercontent.com/rancher-sandbox/rancher-turtles-fleet-example/templates/capa.yaml \ | ||
> cluster1.yaml | ||
``` | ||
2. View **cluster1.yaml** to ensure there are no tokens. You can make any changes you want as well. | ||
|
||
> The Cluster API quickstart guide contains more detail. Read the steps related to this section [here](https://cluster-api.sigs.k8s.io/user/quick-start.html#required-configuration-for-common-providers). | ||
3. Create the cluster using kubectl | ||
|
||
```bash | ||
kubectl create -f cluster1.yaml | ||
``` | ||
|
||
## Mark Namespace or Cluster for Auto-Import | ||
|
||
To automatically import a CAPI cluster into Rancher Manager, there are 2 options: | ||
|
||
1. Label a namespace so all clusters contained in it are imported. | ||
2. Label an individual cluster definition so that it's imported. | ||
|
||
Labeling a namespace: | ||
|
||
```bash | ||
kubectl label namespace default cluster-api.cattle.io/rancher-auto-import=true | ||
``` | ||
|
||
Labeling an individual cluster definition: | ||
|
||
```bash | ||
kubectl label cluster.cluster.x-k8s.io cluster1 cluster-api.cattle.io/rancher-auto-import=true | ||
``` |
This file contains 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,58 @@ | ||
--- | ||
sidebar_position: 0 | ||
--- | ||
|
||
# Create & import a cluster using CAPI provider for Docker | ||
|
||
This section will guide you through creating a cluster and importing it into Rancher Manager using kubectl. | ||
|
||
## Prerequisites | ||
|
||
- Rancher Manager cluster with Rancher Turtles installed | ||
- Cluster API providers installed for your scenario - we'll be using the Docker infrastructure and Kubeadm bootstrap/control plane providers in these instructions - you can find a guide on how to install a provider using the `CAPIProvider` resource [here](../../tasks/capi-operator/basic_cluster_api_provider_installation.md) | ||
- **clusterctl** CLI - see the [releases](https://github.com/kubernetes-sigs/cluster-api/releases) | ||
|
||
## Create Your Cluster Definition | ||
|
||
To generate the YAML for the cluster, do the following (assuming the Docker infrastructure provider is being used): | ||
|
||
1. Open a terminal and run the following: | ||
|
||
```bash | ||
export CONTROL_PLANE_MACHINE_COUNT=1 | ||
export WORKER_MACHINE_COUNT=1 | ||
export KUBERNETES_VERSION=v1.26.4 | ||
|
||
clusterctl generate cluster cluster1 \ | ||
--from https://raw.githubusercontent.com/rancher-sandbox/rancher-turtles-fleet-example/templates/docker-kubeadm.yaml \ | ||
> cluster1.yaml | ||
``` | ||
|
||
2. View **cluster1.yaml** to ensure there are no tokens. You can make any changes you want as well. | ||
|
||
> The Cluster API quickstart guide contains more detail. Read the steps related to this section [here](https://cluster-api.sigs.k8s.io/user/quick-start.html#required-configuration-for-common-providers). | ||
3. Create the cluster using kubectl | ||
|
||
```bash | ||
kubectl create -f cluster1.yaml | ||
``` | ||
|
||
## Mark Namespace or Cluster for Auto-Import | ||
|
||
To automatically import a CAPI cluster into Rancher Manager, there are 2 options: | ||
|
||
1. Label a namespace so all clusters contained in it are imported. | ||
2. Label an individual cluster definition so that it's imported. | ||
|
||
Labeling a namespace: | ||
|
||
```bash | ||
kubectl label namespace default cluster-api.cattle.io/rancher-auto-import=true | ||
``` | ||
|
||
Labeling an individual cluster definition: | ||
|
||
```bash | ||
kubectl label cluster.cluster.x-k8s.io cluster1 cluster-api.cattle.io/rancher-auto-import=true | ||
``` |
This file contains 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
This file contains 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