### Clone the Turtles Integration Suite Example repository Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/certificationsuite.html Clones the Turtles Integration Suite Example repository to get started with provider testing. Recommended for first-time users to keep configuration simple. ```bash git clone https://github.com/rancher/turtles-integration-suite-example.git ``` -------------------------------- ### Example output of get-all Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Example output from 'kubectl get-all -n capi-clusters' showing all resources in the capi-clusters namespace. ```bash NAME NAMESPACE AGE configmap/kube-root-ca.crt capi-clusters 23h secret/cluster1-shim capi-clusters 32s serviceaccount/default capi-clusters 23h rke2config.bootstrap.cluster.x-k8s.io/cluster1-mp-0-dm59p capi-clusters 32s rke2config.bootstrap.cluster.x-k8s.io/cluster1-mp-1-gv6kh capi-clusters 32s rke2configtemplate.bootstrap.cluster.x-k8s.io/cluster1-pool0 capi-clusters 33s rke2configtemplate.bootstrap.cluster.x-k8s.io/cluster1-pool1 capi-clusters 33s clusterclass.cluster.x-k8s.io/clusterclass1 capi-clusters 33s cluster.cluster.x-k8s.io/cluster1 capi-clusters 32s machinepool.cluster.x-k8s.io/cluster1-mp-0-d4fd0 capi-clusters 32s machinepool.cluster.x-k8s.io/cluster1-mp-1-l86kv capi-clusters 32s clustergroup.fleet.cattle.io/clusterclass1 capi-clusters 33s azureclusteridentity.infrastructure.cluster.x-k8s.io/cluster-identity capi-clusters 33s azuremanagedcluster.infrastructure.cluster.x-k8s.io/cluster1-l2cs6 capi-clusters 32s azuremanagedclustertemplate.infrastructure.cluster.x-k8s.io/cluster capi-clusters 33s azuremanagedcontrolplane.infrastructure.cluster.x-k8s.io/cluster1-rv8v4 capi-clusters 32s azuremanagedcontrolplanetemplate.infrastructure.cluster.x-k8s.io/cluster1-control-plane capi-clusters 33s azuremanagedmachinepool.infrastructure.cluster.x-k8s.io/cluster1-mp-0-78tck capi-clusters 32s azuremanagedmachinepool.infrastructure.cluster.x-k8s.io/cluster1-mp-1-zdscw capi-clusters 32s azuremanagedmachinepooltemplate.infrastructure.cluster.x-k8s.io/cluster1-pool0 capi-clusters 33s azuremanagedmachinepooltemplate.infrastructure.cluster.x-k8s.io/cluster1-pool1 capi-clusters 33s ``` -------------------------------- ### Install and verify crust-gather via script Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Install crust-gather using the standalone install.sh script and verify the installation. ```bash curl -sSfL https://github.com/crust-gather/crust-gather/raw/main/install.sh | sh crust-gather --help ``` -------------------------------- ### Install and verify crust-gather via Krew Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Install the crust-gather plugin using kubectl krew and verify the installation with the help command. ```bash kubectl krew install crust-gather kubectl crust-gather --help ``` -------------------------------- ### Apply vSphere Kubeadm ClusterClass via Examples Tool Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Apply the vSphere Kubeadm ClusterClass and associated applications using the examples tool. ```bash go run github.com/rancher/turtles/examples@v0.27.1 -r vsphere-kubeadm | kubectl apply -f - ``` -------------------------------- ### Apply vSphere RKE2 ClusterClass with examples tool Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Applies a vSphere RKE2 ClusterClass and associated applications using the examples tool. Requires the CAAPF provider to be installed and enabled. The command pipes the generated examples to `kubectl apply`. ```bash go run github.com/rancher/turtles/examples@v0.27.1 -r vsphere-rke2 | kubectl apply -f - ``` -------------------------------- ### Apply Docker RKE2 ClusterClass via Examples Tool Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Uses the Turtles examples tool to apply the Docker RKE2 ClusterClass. ```bash go run github.com/rancher/turtles/examples@v0.27.1 -r docker-rke2 | kubectl apply -f - ``` -------------------------------- ### Apply Docker Kubeadm ClusterClass via Examples Tool Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Uses the Turtles examples tool to apply the Docker Kubeadm ClusterClass and associated applications. ```bash go run github.com/rancher/turtles/examples@v0.27.1 -r docker-kubeadm | kubectl apply -f - ``` -------------------------------- ### Install CAPRKE2 or Kubeadm Bootstrap and Control Plane Providers Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Install the bootstrap and control plane providers for either CAPRKE2 or Kubeadm. The first block creates the rke2-bootstrap and rke2-control-plane CAPIProviders; the second creates the kubeadm-bootstrap and kubeadm-control-plane providers. Both are required before further CAPIProvider setup. ```yaml apiVersion: v1 kind: Namespace metadata: name: rke2-bootstrap-system --- apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: rke2-bootstrap namespace: rke2-bootstrap-system spec: name: rke2 type: bootstrap --- apiVersion: v1 kind: Namespace metadata: name: rke2-control-plane-system --- apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: rke2-control-plane namespace: rke2-control-plane-system spec: name: rke2 type: controlPlane ``` ```yaml apiVersion: v1 kind: Namespace metadata: name: capi-kubeadm-bootstrap-system --- apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: kubeadm-bootstrap namespace: capi-kubeadm-bootstrap-system spec: name: kubeadm type: bootstrap --- apiVersion: v1 kind: Namespace metadata: name: capi-kubeadm-control-plane-system --- apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: kubeadm-control-plane namespace: capi-kubeadm-control-plane-system spec: name: kubeadm type: controlPlane ``` -------------------------------- ### Apply AWS EKS ClusterClass via Examples Tool Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Uses the examples tool to apply the AWS EKS ClusterClass and associated applications. ```bash go run github.com/rancher/turtles/examples@main -r aws-eks | kubectl apply -f - ``` -------------------------------- ### Start ngrok or inlets after tilt has started Source: https://turtles.docs.rancher.com/turtles/v0.27/en/developer/development.html Commands to port-forward the Rancher service and start ngrok to expose it. Use this if you don't have ngrok credentials and haven't provided them in the earlier step. ```bash kubectl port-forward --namespace cattle-system svc/rancher 10000:443 ngrok http https://localhost:10000 ``` -------------------------------- ### Install kubectl plugins lineage and get-all Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Installs the 'lineage' and 'get-all' kubectl plugins using krew. Note: third-party plugins may pose security risks in production; use primarily in development or testing. ```bash kubectl krew install lineage kubectl krew install get-all ``` -------------------------------- ### Install Azure CCM with ClusterResourceSet Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/applications.html This example demonstrates configuring a ConfigMap containing a HelmChart definition and a ClusterResourceSet to apply the Azure CCM to clusters matching the specified label. ```yaml apiVersion: v1 kind: ConfigMap metadata: name: cloud-provider-azure namespace: data: cloud-provider-azure.yaml: |- apiVersion: helm.cattle.io/v1 kind: HelmChart metadata: name: azure-ccm namespace: kube-system spec: repo: https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo chart: cloud-provider-azure bootstrap: true version: "1.36.0" targetNamespace: kube-system valuesContent: |- infra: clusterName: test-cluster cloudControllerManager: clusterCIDR: 192.168.0.0/16 --- apiVersion: addons.cluster.x-k8s.io/v1beta2 kind: ClusterResourceSet metadata: name: cloud-provider-azure namespace: spec: strategy: Reconcile clusterSelector: matchLabels: cloud-provider: azure resources: - name: cloud-provider-azure kind: ConfigMap ``` -------------------------------- ### Apply Azure RKE2 ClusterClass via examples tool Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Use the Rancher Turtles examples tool to apply the Azure RKE2 ClusterClass configuration. ```bash go run github.com/rancher/turtles/examples@v0.27.1 -r azure-rke2 | kubectl apply -f - ``` -------------------------------- ### Install stern plugin via Krew Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Install the stern plugin using the Krew package manager to enable advanced log tailing capabilities. ```bash kubectl krew install stern ``` -------------------------------- ### Apply AWS RKE2 ClusterClass using examples tool Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Applies the AWS RKE2 ClusterClass and associated applications using the examples tool. This is the CLI method for creating the ClusterClass. ```bash go run github.com/rancher/turtles/examples@v0.27.1 -r aws-rke2 | kubectl apply -f - ``` -------------------------------- ### Apply Azure AKS ClusterClass via examples tool Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Use the Rancher Turtles examples tool to apply the Azure AKS ClusterClass configuration. ```bash go run github.com/rancher/turtles/examples@v0.27.1 -r azure-aks | kubectl apply -f - ``` -------------------------------- ### Apply GCP GKE ClusterClass using examples tool Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Applies a GCP GKE ClusterClass and associated applications using the examples tool. The output is piped to kubectl apply. ```bash go run github.com/rancher/turtles/examples@main -r gcp-gke | kubectl apply -f - ``` -------------------------------- ### Install vSphere Cloud Provider and Calico CNI Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Install the vSphere Cloud Provider and Calico CNI using HelmOps for automatic application at cluster creation. ```bash kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/applications/ccm/vsphere/helm-chart.yaml kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/applications/cni/calico/helm-chart.yaml ``` -------------------------------- ### Install Rancher with Helm Source: https://turtles.docs.rancher.com/turtles/v0.27/en/tutorials/rancher.html A minimal Helm command to install Rancher. Replace with your server's hostname and ensure the version is v2.13.0 or later. ```bash helm install rancher rancher-stable/rancher \ --namespace cattle-system \ --create-namespace \ --set hostname= \ --version \ --wait ``` -------------------------------- ### Explain clusterclass resource Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Shows how to get a full explanation of the clusterclass resource, including its configuration options. ```bash kubectl api-resources | grep clusterclass kubectl explain clusterclass.cluster.x-k8s.io ``` -------------------------------- ### Install Cluster API Provider Azure (CAPIProvider) Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Installs the Cluster API Provider Azure by creating the capz-system namespace and a CAPIProvider resource. The provider is pinned to the default version unless spec.version is set; automatic updates can be disabled with spec.enableAutomaticUpdate: false. ```yaml apiVersion: v1 kind: Namespace metadata: name: capz-system --- apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: azure namespace: capz-system spec: type: infrastructure name: azure ``` -------------------------------- ### Install Cluster API Provider AWS (CAPIProvider) Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Installs the Cluster API Provider AWS with empty global credentials because AWSClusterStaticIdentity will be used instead. The provider is pinned to the default version unless spec.version is set; automatic updates can be disabled with spec.enableAutomaticUpdate: false. ```yaml apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: aws namespace: capa-system spec: type: infrastructure variables: AWS_B64ENCODED_CREDENTIALS: "" ``` -------------------------------- ### Example ConfigMap manifest Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/airgapped.html Shows the structure of the ConfigMap created by the previous commands, with labels and data fields for components and metadata. ```yaml apiVersion: v1 kind: ConfigMap metadata: labels: provider-components: vsphere name: v1.12.0 namespace: capv-system data: components: | # Components for v1.12.0 YAML go here metadata: | # Metadata information goes here ``` -------------------------------- ### Run make dev-env for Rancher Turtles Source: https://turtles.docs.rancher.com/turtles/v0.27/en/developer/development.html Command to start the development environment. Optionally, you can set NGROK_API_KEY, NGROK_AUTHTOKEN, and RANCHER_HOSTNAME to use a custom hostname for Rancher. ```bash make dev-env # Or if you want to use a custom hostname for Rancher and your ngrok credentials NGROK_API_KEY=`key` NGROK_AUTHTOKEN=`token` RANCHER_HOSTNAME=my.customhost.dev make dev-env ``` -------------------------------- ### Install Azure Cloud Provider and Calico CNI HelmOps Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Apply the HelmOps configurations for the Azure Cloud Provider and Calico CNI to enable automatic installation on downstream clusters. ```bash kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/applications/ccm/azure/helm-chart.yaml kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/applications/cni/calico/helm-chart.yaml ``` -------------------------------- ### Install Cluster API Provider GCP (CAPIProvider) Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Installs the Cluster API Provider GCP with the base64-encoded Service Account key set in the GCP_B64ENCODED_CREDENTIALS variable. The Service Account requires Editor permissions; the key must be base64-encoded. The provider is pinned to the default version unless spec.version is set; automatic updates can be disabled with spec.enableAutomaticUpdate: false. ```yaml apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: gcp namespace: capg-system spec: type: infrastructure variables: GCP_B64ENCODED_CREDENTIALS: xxx ``` -------------------------------- ### Configure CAPIProvider with CLUSTER_TOPOLOGY Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/clusterclass.html Example of a CAPIProvider resource configuration that enables CLUSTER_TOPOLOGY and other experimental features for the Azure provider. ```yaml apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: azure namespace: capz-system spec: type: infrastructure name: azure configSecret: name: azure-variables variables: CLUSTER_TOPOLOGY: "true" EXP_CLUSTER_RESOURCE_SET: "true" EXP_MACHINE_POOL: "true" EXP_AKS_RESOURCE_HEALTH: "true" ``` -------------------------------- ### Create vSphere Cluster from ClusterClass with Fleet Bundles Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html These YAML manifests configure the vSphere Cloud Provider and CSI driver via Fleet Bundles and create a vSphere Cluster from the example ClusterClass. The Bundles target the downstream Cluster by name `vsphere-kubeadm-quickstart`; change the target labels if you use a different Cluster name. The Cluster uses kube-vip as a Control Plane load balancer; set `KUBE_VIP_INTERFACE` (e.g., `eth0`) according to your network device. ```yaml kind: Bundle apiVersion: fleet.cattle.io/v1alpha1 metadata: name: vsphere-csi-config spec: resources: - content: |- apiVersion: v1 kind: Secret type: Opaque metadata: name: vsphere-config-secret namespace: vmware-system-csi stringData: csi-vsphere.conf: |+ [Global] thumbprint = "" [VirtualCenter ""] user = "" password = "" datacenters = "" [Network] public-network = "" [Labels] zone = "" region = "" targets: - clusterSelector: matchLabels: csi: vsphere cluster.x-k8s.io/cluster-name: 'vsphere-kubeadm-quickstart' --- kind: Bundle apiVersion: fleet.cattle.io/v1alpha1 metadata: name: vsphere-cloud-credentials spec: resources: - content: |- apiVersion: v1 kind: Secret type: Opaque metadata: name: vsphere-cloud-secret namespace: kube-system stringData: .password: "" .username: "" targets: - clusterSelector: matchLabels: cloud-provider: vsphere cluster.x-k8s.io/cluster-name: 'vsphere-kubeadm-quickstart' ``` ```yaml apiVersion: cluster.x-k8s.io/v1beta2 kind: Cluster metadata: labels: cni: calico cloud-provider: vsphere csi: vsphere cluster-api.cattle.io/rancher-auto-import: "true" name: 'vsphere-kubeadm-quickstart' spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 topology: classRef: name: vsphere-kubeadm-example version: v1.36.1 controlPlane: replicas: 3 workers: machineDeployments: - class: vsphere-kubeadm-example-worker name: md-0 replicas: 1 variables: - name: vSphereClusterIdentityName value: cluster-identity - name: vSphereTLSThumbprint value: - name: vSphereDataCenter value: - name: vSphereDataStore value: - name: vSphereFolder value: - name: vSphereNetwork value: - name: vSphereResourcePool value: - name: vSphereServer value: - name: vSphereTemplate value: - name: controlPlaneIpAddr value: - name: controlPlanePort value: 6443 - name: sshKey value: - name: kubeVIPInterface value: ``` -------------------------------- ### CAPIProvider resource for OCI artifact installation Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/airgapped.html YAML configuration for a CAPIProvider named azure in the capz-system namespace, referencing a private registry OCI artifact. Applies to both installation and mirroring workflows. ```yaml apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: azure namespace: capz-system spec: type: infrastructure name: azure version: ${RELEASE_TAG} fetchConfig: oci: ${REGISTRY}:${RELEASE_TAG} ``` -------------------------------- ### CAPIProvider manifest example for AWS infrastructure provider Source: https://turtles.docs.rancher.com/turtles/v0.27/en/reference/capiprovider.html Example manifest for creating an AWS infrastructure provider. It references a Rancher cloud credential secret and a config secret, enables automatic updates, and enables the clusterResourceSet feature. The controller owns generated resources, allowing garbage collection by deleting the CAPIProvider object. ```yaml apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: aws-infra namespace: capi-providers spec: name: aws type: infrastructure enableAutomaticUpdate: true credentials: rancherCloudCredential: aws-creds # Rancher credentials secret for AWS configSecret: name: aws-config features: clusterResourceSet: true ``` -------------------------------- ### Define a CAPIProvider Source: https://turtles.docs.rancher.com/turtles/v0.27/en/tutorials/rancher.html Example YAML configuration for a CAPIProvider custom resource to manage infrastructure providers. ```yaml apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: aws namespace: cattle-turtles-system spec: type: infrastructure name: aws ``` -------------------------------- ### Create Azure Kubeadm Cluster Manifest Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Defines a Cluster manifest using the azure-kubeadm-example ClusterClass with labels for automatic add-on installation. ```yaml apiVersion: cluster.x-k8s.io/v1beta2 kind: Cluster metadata: labels: cluster-api.cattle.io/rancher-auto-import: "true" cloud-provider: azure cni: calico name: azure-kubeadm-quickstart spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 topology: classRef: name: azure-kubeadm-example controlPlane: replicas: 1 variables: - name: subscriptionID value: - name: location value: - name: resourceGroup value: - name: azureClusterIdentityName value: cluster-identity version: v1.36.1 workers: machineDeployments: - class: kubeadm-default-worker name: md-0 replicas: 1 ``` -------------------------------- ### Child cluster filter configuration Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Example YAML filter configuration for the child-crust-gather.yaml file. ```yaml filters: - include_kind: - Node - Namespace - CustomResourceDefinition - include_group: - management.cattle.io/.* - provisioning.cattle.io/.* - include_namespace: - cattle.* - fleet.* - kube-system settings: insecure_skip_tls_verify: true secrets_file: secrets.txt ``` -------------------------------- ### Install vSphere Cluster API Provider Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Deploys the vSphere infrastructure provider into the capv-system namespace with blank global credentials. ```yaml apiVersion: v1 kind: Namespace metadata: name: capv-system --- apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: vsphere namespace: capv-system spec: type: infrastructure variables: VSPHERE_USERNAME: "" VSPHERE_PASSWORD: "" ``` -------------------------------- ### Install vSphere CSI Driver via Fleet Bundle Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Apply the vSphere CSI driver manifest using a Fleet Bundle for the downstream cluster. ```bash kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/applications/csi/vsphere/bundle.yaml ``` -------------------------------- ### Override a CAPIProvider version and image registry Source: https://turtles.docs.rancher.com/turtles/v0.27/en/reference/clusterctlconfig.html Example of a ClusterctlConfig resource defining provider URLs and image repository overrides for RKE2 components. ```yaml apiVersion: turtles-capi.cattle.io/v1alpha1 kind: ClusterctlConfig metadata: name: clusterctl-config namespace: cattle-turtles-system spec: providers: - name: rke2 url: "https://github.com/rancher/cluster-api-provider-rke2/releases/v0.20.1/control-plane-components.yaml" type: ControlPlaneProvider - name: rke2 url: "https://github.com/rancher/cluster-api-provider-rke2/releases/v0.20.1/bootstrap-components.yaml" type: BootstrapProvider images: - name: control-plane-rke2 repository: "ghcr.io/rancher" - name: bootstrap-rke2 repository: "ghcr.io/rancher" ``` -------------------------------- ### Rancher cluster filter configuration Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Example YAML filter configuration for the rancher-crust-gather.yaml file. ```yaml filters: - include_group: - .*cluster.x-k8s.io/.* - turtles-capi.cattle.io/.* - include_kind: - CustomResourceDefinition - Node - Namespace - include_group: - management.cattle.io/.* - provisioning.cattle.io/.* - include_namespace: - cattle-turtles-system - capi-.* - cattle.* - fleet.* - c-.* - rke2.* - cert-manager - kube-system settings: insecure_skip_tls_verify: true secrets_file: secrets.txt ``` -------------------------------- ### Run the simplest E2E test with make test-e2e Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/certificationsuite.html Runs the simplest test execution, creating a local environment without an internet-facing endpoint. This limits checks to local downstream clusters provisioned via CAPD, but is enough to run the example integration. ```bash make test-e2e ``` -------------------------------- ### Install Docker Cluster API Provider Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Deploys the Docker infrastructure provider into the capd-system namespace using a CAPIProvider resource. ```yaml apiVersion: v1 kind: Namespace metadata: name: capd-system --- apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: docker namespace: capd-system spec: type: infrastructure ``` -------------------------------- ### Define Docker Kubeadm Cluster Resource Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Example Cluster manifest for a Docker Kubeadm deployment. ```yaml apiVersion: cluster.x-k8s.io/v1beta2 kind: Cluster metadata: name: docker-kubeadm-quickstart labels: cni: calico spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 serviceDomain: cluster.local services: cidrBlocks: - 10.96.0.0/24 topology: classRef: name: docker-kubeadm-example controlPlane: replicas: 1 version: v1.36.1 workers: machineDeployments: - class: default-worker name: md-0 replicas: 1 ``` -------------------------------- ### Define Docker RKE2 Cluster Resource Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Create the Docker RKE2 Cluster using the example ClusterClass definition. ```yaml apiVersion: cluster.x-k8s.io/v1beta2 kind: Cluster metadata: name: docker-rke2-example labels: cni: calico annotations: cluster-api.cattle.io/upstream-system-agent: "true" spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 services: cidrBlocks: - 10.96.0.0/24 serviceDomain: cluster.local topology: classRef: name: docker-rke2-example controlPlane: replicas: 1 variables: - name: rke2CNI value: none - name: dockerImage value: kindest/node:v1.35.0 version: v1.36.0+rke2r1 workers: machineDeployments: - class: default-worker name: md-0 replicas: 1 ``` -------------------------------- ### Example ClusterctlConfig manifest Source: https://turtles.docs.rancher.com/turtles/v0.27/en/reference/clusterctlconfig.html This manifest defines a ClusterctlConfig resource to override the metal3 provider URL and image repository settings. ```yaml apiVersion: turtles-capi.cattle.io/v1alpha1 kind: ClusterctlConfig metadata: name: clusterctl-config namespace: cattle-turtles-system spec: providers: - name: metal3 url: https://github.com/metal3-io/cluster-api-provider-metal3/releases/v1.10.1/infrastructure-components.yaml type: InfrastructureProvider images: - name: metal3 repository: "my.registry.mirror" tag: customTag ``` -------------------------------- ### Apply AWS RKE2 ClusterClass directly with kubectl Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Applies the AWS RKE2 ClusterClass directly using kubectl. This is an alternative to the examples tool method. ```bash kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/clusterclasses/aws/rke2/clusterclass-ec2-rke2-example.yaml ``` -------------------------------- ### Create GCP Cluster from ClusterClass Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Creates a GCP GKE cluster from the example ClusterClass. Some variables are left for the user to substitute, such as project, region, and network name. ```yaml apiVersion: cluster.x-k8s.io/v1beta2 kind: Cluster metadata: labels: cluster-api.cattle.io/rancher-auto-import: "true" name: gcp-quickstart spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 topology: classRef: name: gcp-gke-example variables: - name: project value: - name: region value: - name: networkName value: version: v1.35.3 workers: machinePools: - class: default-system name: system-pool replicas: 1 - class: default-worker name: worker-pool replicas: 1 ``` -------------------------------- ### Define GCP Cluster Resource Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Example Cluster manifest for GCP. Users must substitute variables like and before applying. ```yaml apiVersion: cluster.x-k8s.io/v1beta2 kind: Cluster metadata: labels: cluster-api.cattle.io/rancher-auto-import: "true" cni: calico cloud-provider: gcp name: gcp-quickstart spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 topology: classRef: name: gcp-kubeadm-example controlPlane: replicas: 1 workers: machineDeployments: - class: "default-worker" name: "md-0" replicas: 1 variables: - name: gcpProject value: - name: region value: - name: gcpNetworkName value: - name: clusterFailureDomains value: - "-a" - name: imageId value: - name: machineType value: version: v1.36.1 ``` -------------------------------- ### Apply vSphere RKE2 ClusterClass directly with kubectl Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Applies the vSphere RKE2 ClusterClass directly from the Turtles repository using kubectl. This is an alternative to using the examples tool. ```bash kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/clusterclasses/vsphere/rke2/clusterclass-rke2-example.yaml ``` -------------------------------- ### Create AWS EKS Cluster from ClusterClass Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Creates an AWS EKS Cluster from the aws-eks-example ClusterClass. Some variables, such as instanceType, are left for the user to substitute. The ClusterClass relies on the CAAPF provider being installed and enabled. ```yaml apiVersion: cluster.x-k8s.io/v1beta2 kind: Cluster metadata: labels: cluster-api.cattle.io/rancher-auto-import: "true" name: aws-quickstart spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 topology: classRef: name: aws-eks-example variables: - name: region value: eu-west-2 - name: instanceType value: - name: awsClusterIdentityName value: cluster-identity version: v1.35.0 workers: machineDeployments: - class: default-worker name: md-0 replicas: 1 ``` -------------------------------- ### Create namespace and apply CAPIProvider configuration Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/airgapped.html Creates the capnz-system namespace and applies the CAPIProvider YAML file to deploy the provider from the private registry. ```bash kubectl create namespace capz-system kubectl apply -f capz-provider-oci.yaml ``` -------------------------------- ### Fetch provider manifests and create ConfigMap Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/airgapped.html Commands to download the vSphere provider components and metadata from GitHub releases and create a ConfigMap in the capv-system namespace. Adapt the URLs and version for your provider. ```bash # Get the file contents from the GitHub release curl -L https://github.com/rancher-sandbox/cluster-api-provider-vsphere/releases/download/v1.12.0/infrastructure-components.yaml -o components.yaml curl -L https://github.com/rancher-sandbox/cluster-api-provider-vsphere/releases/download/v1.12.0/metadata.yaml -o metadata.yaml # Create the configmap from the files kubectl create configmap v1.12.0 --namespace=capv-system --from-file=components=components.yaml --from-file=metadata=metadata.yaml --dry-run=client -o yaml > configmap.yaml ``` -------------------------------- ### Collect data using a configuration file Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Run the collection process using a specified YAML configuration file. ```bash kubectl crust-gather collect-from-config -c config.yaml ``` -------------------------------- ### Collect data using command-line flags Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Run the collection process by specifying namespaces and kubeconfig via flags. ```bash kubectl crust-gather collect --include-namespace cattle-turtles-system --include-namespace capi-* --include-namespace cattle* --include-namespace c-* --include-namespace= --kubeconfig= ``` -------------------------------- ### Switch kubectl namespace Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Shows how to view the current KUBECONFIG and switch the default namespace for kubectl commands. ```bash kubectl config view kubectl config set-context --current --namespace ``` -------------------------------- ### Recommended repository folder structure Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/gitops.html Shows the recommended folder layout for a Fleet-based GitOps repository, separating providers, clusters, addons, templates, and overlays by environment. ```plaintext repo-root/ │── fleet/ │ ├── providers/ # CAPIProvider files to use with templates │ │ ├── core/ # Core provider configuration │ │ ├── infra-docker/ # Docker provider configuration │ │ ├── infra-aws/ # AWS provider configuration │ ├── clusters/ # Cluster-specific configurations │ │ ├── prod/ # Production clusters │ │ ├── staging/ # Staging clusters │ │ ├── dev/ # Development clusters │ ├── addons/ # Application-specific manifests focused on cluster bootstrapping, like CNI, CCM, CPI configurations. │ │ ├── cni/ # Group applications based on purpose. Provide fleet.yaml per each sub-directory to maintain bundle separation. │ │ ├── ccm/ │ ├── templates/ # CAPI ClusterClass templates for cluster provisioning │ ├── fleet.yaml # Fleet bundle configuration │── overlays/ # Kustomize overlays for different environments │ ├── prod/. # Kustomize overlays for production environments │ ├── staging/. # Kustomize overlays for staging environments │ ├── dev/. # Kustomize overlays for development environments ``` -------------------------------- ### Watch cluster resources become ready Source: https://turtles.docs.rancher.com/turtles/v0.27/en/tutorials/first-cluster.html Watch the cluster resources until they become ready using kubectl. This is the fourth step in the manual provisioning method. ```bash kubectl get clusters -w ``` -------------------------------- ### Explain clusterclass fields Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Provides descriptions of each field and configuration section of the clusterclass resource. ```bash kubectl explain clusterclass.spec kubectl explain clusterclass.spec.controlPlane kubectl explain clusterclasses.spec.controlPlane.machineInfrastructure ``` -------------------------------- ### After: Workers section with direct `bootstrap` and `infrastructure` Source: https://turtles.docs.rancher.com/turtles/v0.27/en/tutorials/capi-v1beta2.html Shows the v1beta2 structure where the `template` root key is removed and `bootstrap` and `infrastructure` are direct children of the machine deployment entry, using `templateRef`. ```yaml workers: machineDeployments: - class: default-worker bootstrap: templateRef: apiVersion: bootstrap.cluster.x-k8s.io/v1beta2 kind: KubeadmConfigTemplate name: my-bootstrap-template infrastructure: templateRef: apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: DockerMachineTemplate name: my-worker-template ``` -------------------------------- ### Create ConfigMap from compressed data Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/airgapped.html Creates a ConfigMap manifest using the compressed components file and the metadata file. ```sh kubectl create configmap v1.12.0 --namespace=capv-system --from-file=components=components.gz --from-file=metadata=metadata.yaml --dry-run=client -o yaml > configmap.yaml ``` -------------------------------- ### List all resources in capi-clusters namespace Source: https://turtles.docs.rancher.com/turtles/v0.27/en/troubleshooting/troubleshooting.html Lists all existing resources in the 'capi-clusters' namespace where downstream cluster configuration is deployed. ```bash kubectl get-all -n capi-clusters ``` -------------------------------- ### Before: ClusterClass template reference using `ref` Source: https://turtles.docs.rancher.com/turtles/v0.27/en/tutorials/capi-v1beta2.html Shows the v1beta1 syntax for referencing a ClusterClass template via the `ref` field. This applies to `spec.infrastructure`, `spec.controlPlane`, and `spec.controlPlane.machineInfrastructure`. ```yaml spec: infrastructure: ref: apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerClusterTemplate name: my-cluster-template ``` -------------------------------- ### Apply Docker RKE2 LoadBalancer ConfigMap Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Create the LoadBalancer ConfigMap required for the Docker RKEv2 Cluster. ```bash kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/applications/lb/docker/configmap.yaml ``` -------------------------------- ### Create the cluster Source: https://turtles.docs.rancher.com/turtles/v0.27/en/tutorials/first-cluster.html Create the Docker RKE2 cluster by applying the cluster manifest using kubectl. This is the third step in the manual provisioning method. ```bash kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/heads/main/examples/clusters/docker/rke2/cluster.yaml ``` -------------------------------- ### Create and apply Azure CAPIProvider resource for OCI fetch Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/airgapped.html Create and apply the Azure CAPIProvider resource that instructs Rancher Turtles to fetch the Azure provider from your private OCI registry. The YAML file is named capz-provider-oci.yaml and is applied with kubectl. ```yaml apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: name: azure namespace: capz-system spec: type: infrastructure name: azure version: ${RELEASE_TAG} fetchConfig: oci: ${PROD_REGISTRY}:${RELEASE_TAG} ``` ```bash kubectl apply -f capz-provider-oci.yaml ``` -------------------------------- ### Define Azure Cluster resource Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Example Cluster resource definition using the Azure RKE2 ClusterClass. Users must substitute placeholders like with their specific environment details. ```yaml apiVersion: cluster.x-k8s.io/v1beta2 kind: Cluster metadata: labels: cluster-api.cattle.io/rancher-auto-import: "true" cloud-provider: azure cni: calico name: azure-quickstart spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 topology: classRef: name: azure-rke2-example controlPlane: replicas: 1 variables: - name: subscriptionID value: - name: location value: - name: resourceGroup value: - name: azureClusterIdentityName value: cluster-identity version: v1.36.0+rke2r1 workers: machineDeployments: - class: rke2-default-worker name: md-0 replicas: 1 ``` -------------------------------- ### Configure vSphere CSI and Cloud Credentials Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Create Fleet Bundles to apply vSphere CSI and cloud provider configurations to the downstream cluster. Ensure the cluster name matches the target specified in the bundle labels. ```yaml kind: Bundle apiVersion: fleet.cattle.io/v1alpha1 metadata: name: vsphere-csi-config spec: resources: - content: |- apiVersion: v1 kind: Secret type: Opaque metadata: name: vsphere-config-secret namespace: vmware-system-csi stringData: csi-vsphere.conf: |+ [Global] thumbprint = "" [VirtualCenter ""] user = "" password = "" datacenters = "" [Network] public-network = "" [Labels] zone = "" region = "" targets: - clusterSelector: matchLabels: csi: vsphere cluster.x-k8s.io/cluster-name: 'vsphere-rke2-quickstart' --- kind: Bundle apiVersion: fleet.cattle.io/v1alpha1 metadata: name: vsphere-cloud-credentials spec: resources: - content: |- apiVersion: v1 kind: Secret type: Opaque metadata: name: vsphere-cloud-secret namespace: kube-system stringData: .password: "" .username: "" targets: - clusterSelector: matchLabels: cloud-provider: vsphere cluster.x-k8s.io/cluster-name: 'vsphere-rke2-quickstart' ``` -------------------------------- ### Create AWS Cluster from ClusterClass Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Creates an AWS RKE2 cluster from the example ClusterClass. Some variables are left for the user to substitute, such as region, SSH key, machine types, AMI ID, and cluster identity name. ```yaml apiVersion: cluster.x-k8s.io/v1beta2 kind: Cluster metadata: labels: cloud-provider: aws cni: calico csi: aws-ebs-csi-driver cluster-api.cattle.io/rancher-auto-import: "true" name: aws-quickstart spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 topology: classRef: name: aws-rke2-example controlPlane: replicas: 3 variables: - name: cni value: none - name: region value: - name: sshKeyName value: - name: controlPlaneMachineType value: - name: workerMachineType value: - name: amiID value: - name: awsClusterIdentityName value: cluster-identity version: v1.36.0+rke2r1 workers: machineDeployments: - class: default-worker name: md-0 replicas: 1 ``` -------------------------------- ### Create AWSClusterStaticIdentity and Secret for AWS Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Creates a Secret with AWS credentials and an AWSClusterStaticIdentity that references it. The identity is allowed across all namespaces for easy reuse; some variables are left for the user to substitute. Refer to the clusterawsadm documentation for credential setup. ```yaml apiVersion: v1 kind: Secret metadata: name: namespace: capa-system type: Opaque stringData: AccessKeyID: SecretAccessKey: --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: AWSClusterStaticIdentity metadata: name: cluster-identity spec: secretRef: allowedNamespaces: {} ``` -------------------------------- ### Apply AWS RKE2 HelmOps for Calico, CSI, and CCM Source: https://turtles.docs.rancher.com/turtles/v0.27/en/user/clusterclass.html Applies the HelmOps for Calico CNI, AWS EBS CSI Driver, and AWS Cloud Controller Manager. These are required for the AWS RKE2 ClusterClass to install applications on downstream clusters. ```bash kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/applications/csi/aws/helm-chart.yaml kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/applications/cni/aws/calico/helm-chart.yaml kubectl apply -f https://raw.githubusercontent.com/rancher/turtles/refs/tags/v0.27.1/examples/applications/ccm/aws/helm-chart.yaml ``` -------------------------------- ### Compress components.yaml with gzip Source: https://turtles.docs.rancher.com/turtles/v0.27/en/operator/airgapped.html Archives the components file using gzip to reduce size and fit within the 1MiB ConfigMap limit. ```sh gzip -c components.yaml > components.gz ```