CAPI Demo on Rancher Manager using Turtles
- Rancher >=v2.9.x or Rancher Prime >= v3.0 installed
- Turtles operator installed in Rancher Local Cluster
clusterctl
is installedclusterawsadm
is installed
Original docs here: https://github.com/rancher/cluster-api-provider-rke2/blob/main/image-builder/README.md
-
Hashicorp packer
-
AWS packer plugin
packer plugins install github.com/hashicorp/amazon
- Checkout the https://github.com/rancher/cluster-api-provider-rke2/tree/main project locally
- cd into the image-builder directory
- edit aws/opensuse-leap-156.json with valid existing AMI
- build command uses 156 not 155 (which is in the docs)
-
Install Rancher Turtles
-
Source some bash functions for the next steps
source providers/aws/ready-aws.sh
-
Prep env variables
prep_env [your-aws-ssh-key-name]
-
Setup IAM profile
clusterawsadm bootstrap iam create-cloudformation-stack
-
Install the capa-system namespace
kubectl apply -f providers/aws/ns.yaml
-
Generate the secret
generate_secret
-
Install the Infrastucture provider
kubectl apply -f providers/aws/InfrastructureProviderAWS.yaml
-
Source some bash functions for the next steps
source providers/aws/ready-aws.sh
-
Prep env variables
- NOTE: Do not include
.pem
extension of the key name
prep_env [your-aws-ssh-key-name]
- NOTE: Do not include
-
Create a cluster yaml configuration
- NOTE: These methods create the cluster configuration and apply it with the active kubeconfig.
create_cluster [cluster-name]
- OR Create a cluster with a namespace
create_cluster_in_namespace [cluster-name] [namespace]
-
Import the cluster(s) into rancher
import_clusters_in_namespace [namespace]
- Add a repository in Rancher
- Select radio button:
Target: https URL generated by helm
- Index URL:
https://rancher.github.io/capi-ui-extension/
Save
If things don't go as expected, look at the capa-controller-manager pod logs. From there, hopefully you can work your way through other resources to figure out what is missing/misconfigured/etc.
- Alternate CAPI infrastructure provider. e.g. Azure, VMWare, etc.
- value of instances is that the infra provider is agnostic to capi
- using managed k8s means greater variation in configuration because it involves infra, bootstrap and control plane provider variations.
- Rancher projects vs Tanzu workspaces (in Rancher Manger or Downstream clusters?)
- Auto deployment of SUSE Security, RBAC configurations and SUSE Observability
- Modify downstream cluster volume sizes as part of the initial creation step
- Use ClusterClass for improved templating demo
- for each cluster created
kubectl delete -f <cluster_name>.yaml
- Remove
<cluster>.yaml
files from the project. - Remove namespaces created with clusters
- Delete the aws secret
kubectl delete secret aws-variables -n capa-system