Skip to content

ashawka/capi-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

capi-demo

CAPI Demo on Rancher Manager using Turtles

Requirements

  • Rancher >=v2.9.x or Rancher Prime >= v3.0 installed
  • Turtles operator installed in Rancher Local Cluster
  • clusterctl is installed
  • clusterawsadm is installed

AWS infra with RKE2 k8s - Steps

Build an AMI

Original docs here: https://github.com/rancher/cluster-api-provider-rke2/blob/main/image-builder/README.md

Prerequisites

  • Hashicorp packer

  • AWS packer plugin

    packer plugins install github.com/hashicorp/amazon

Build AMI

  1. Checkout the https://github.com/rancher/cluster-api-provider-rke2/tree/main project locally
  2. cd into the image-builder directory
  3. edit aws/opensuse-leap-156.json with valid existing AMI
  4. build command uses 156 not 155 (which is in the docs)

Initial setup

  1. Install Rancher Turtles

  2. Source some bash functions for the next steps

    source providers/aws/ready-aws.sh

  3. Prep env variables

    prep_env [your-aws-ssh-key-name]

  4. Setup IAM profile

    clusterawsadm bootstrap iam create-cloudformation-stack

  5. Install the capa-system namespace

    kubectl apply -f providers/aws/ns.yaml

  6. Generate the secret

    generate_secret

  7. Install a CAPI provider

    kubectl apply -f providers/aws/CAPIProvider.yaml

  8. Install the Infrastucture provider

    kubectl apply -f providers/aws/InfrastructureProviderAWS.yaml


Create a cluster (requires completion of Initial Setup)

  1. Source some bash functions for the next steps

    source providers/aws/ready-aws.sh

  2. Prep env variables

    prep_env [your-aws-ssh-key-name]

  3. Create a cluster yaml configuration

    create_cluster [cluster-name] > [cluster-name].yaml

  4. Apply the cluster config

    kubectl apply -f [cluster-name].yaml

Debugging

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.

About

CAPI Demo on Rancher Manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%