This Helm chart gives the possibility to create and manage a Kubernetes cluster from Rancher thanks to Rancher Cluster Templates.
# makes sure adds devpro Helm repository has been added
helm repo add devpro https://devpro.github.io/helm-charts
helm repo update
# double checks you are connected to the Kubernetes cluster hosting Rancher
kubectl get nodes
# installs the chart with default parameters
helm upgrade --install my-cluster rancher-cluster-templates -f values.yaml --namespace fleet-default
# removes the installation
helm uninstall my-cluster -n fleet-default
💡 Node driver must be enabled in Rancher prior to Helm chart installation
Provider | Example | Template | Node Driver |
---|---|---|---|
Amazon Web Services (AWS) | values_aws | amazonec2config | Amazon EC2 |
Azure | values_azure | azureconfig | Azure |
CloudScale | values_cloudscale | cloudscaleconfig | Cloudscale |
Digitial Ocean | values_digitalocean | digitaloceanconfig | DigitalOcean |
Exoscale | values_digitalocean | digitaloceanconfig | Exoscale |
Equinix Metal (prev. Packet) | values_equinix | packetconfig | Equinix Metal |
Harvester | values_harvester | harvesterconfig | Harvester |
Linode | values_linode | linodeconfig | Linode |
Nutanix | values_nutanix | nutanixconfig | Nutanix |
OpenStack | values_openstack | openstackconfig | OpenStack |
Outscale | values_aws | outscaleconfig | Outscale |
VMware vSphere | values_vsphere | vmwarevsphereconfig.yaml | vSphere |
This chart can be installed and managed by GitOps tools like ArgoCD and Fleet. It can also be installed in Rancher Apps.
- Git repository >
fleet.yaml
helm:
repo: https://devpro.github.io/helm-charts
chart: rancher-cluster-templates
version: 0.1.1
releaseName: rke2-azure-demo
values:
cluster:
name: "azurevm-rke2-01"
cloudprovider: azure
cloudCredentialSecretName: cattle-global-data:cc-xxxx
kubernetesVersion: "v1.24.14+rke2r1"
nodepools:
- etcd: true
controlplane: true
worker: true
quantity: 1
name: nodepool-1
region: westeurope
machineImage: "Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:20.04.202307240"
instanceType: Standard_DS2_v2
storageType: Standard_LRS
sshUser: azureuser
availabilitySet: "avs-someprefix-rke2-01"
azureEnvironment: AzurePublicCloud
managedDisks: true
networkSecurityGroup: "nsg-someprefix-rke2-01"
resourceGroup: "rg-someprefix-rke2-01"
subnet: rke2
subnetPrefix: "192.168.0.0/16"
virtualNetwork: "vnet-someprefix-rke2-01"
- Rancher > Continuous Delivery > Git Repo
apiVersion: fleet.cattle.io/v1alpha1
kind: GitRepo
metadata:
name: cluster-templates
namespace: fleet-local
spec:
branch: release/demo
clientSecretName: auth-xxxx
insecureSkipTLSVerify: false
paths:
- fleet/rke2-azure-demo
repo: https://github.com/my-account/my-kubernetes-definitions.git
targets:
- clusterSelector:
matchExpressions:
- key: provider.cattle.io
operator: NotIn
values:
- harvester
If you feel like it, have a look at the contribution guide.
This chart has been inspired by two examples: bloriot/rancher-cluster-templates and rancher/cluster-template-examples.