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 a CAPI provider
kubectl apply -f providers/aws/CAPIProvider.yaml
-
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
prep_env [your-aws-ssh-key-name]
-
Create a cluster yaml configuration
create_cluster [cluster-name] > [cluster-name].yaml
-
Apply the cluster config
kubectl apply -f [cluster-name].yaml
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.