rancher
Install Rancher Server to manage Kubernetes clusters across providers.
About this chart
By installing this application, you accept the End User License Agreement & Terms & Conditions.
Rancher
Rancher is open source software that combines everything an organization needs to adopt and run containers in production. Built on Kubernetes, Rancher makes it easy for DevOps teams to test, deploy and manage their applications.
Introduction
This chart bootstraps a Rancher Server on a Kubernetes cluster using the Helm package manager. For a Rancher Supported Deployment please follow our HA install instructions.
Prerequisites Details
For installations covered under Rancher Support SLA the target cluster must be RKE1, RKE2, K3s, AKS, EKS, or GKE.
Make sure the node(s) for the Rancher server fulfill the following requirements:
Operating Systems and Container Runtime Requirements Hardware Requirements
Install the Required CLI Tools
- kubectl - Kubernetes command-line tool.
- helm - Package management for Kubernetes. Refer to the Helm version requirements to choose a version of Helm to install Rancher.
For a list of best practices that we recommend for running the Rancher server in production, refer to the best practices section.
Installing Rancher
For production environments, we recommend installing Rancher in a high-availability Kubernetes installation so that your user base can always access Rancher Server. When installed in a Kubernetes cluster, Rancher will integrate with the cluster’s etcd database and take advantage of Kubernetes scheduling for high-availability.
Optional: Installing Rancher on a Single-node Kubernetes Cluster
Add the Helm Chart Repository
Use helm repo add command to add the Helm chart repository that contains charts to install Rancher. For more information about the repository choices and which is best for your use case, see Choosing a Version of Rancher.
helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
Create a Namespace for Rancher
We’ll need to define a Kubernetes namespace where the resources created by the Chart should be installed. This should always be cattle-system:
kubectl create namespace cattle-system
Choose your SSL Configuration
The Rancher management server is designed to be secure by default and requires SSL/TLS configuration.
There are three recommended options for the source of the certificate used for TLS termination at the Rancher server:
Install cert-manager
This step is only required to use certificates issued by Rancher’s generated CA (ingress.tls.source=rancher) or to request Let’s Encrypt issued certificates (ingress.tls.source=letsEncrypt).
These instructions are adapted from the official cert-manager documentation.
Install Rancher with Helm and Your Chosen Certificate Option
helm install rancher rancher-latest/rancher \
--namespace cattle-system \
--set hostname=rancher.my.org
helm install rancher rancher-latest/rancher \
--namespace cattle-system \
--set hostname=rancher.my.org \
--set ingress.tls.source=letsEncrypt \
--set [email protected]
helm install rancher rancher-latest/rancher \
--namespace cattle-system \
--set hostname=rancher.my.org \
--set ingress.tls.source=secret
If you are using a Private CA signed certificate , add --set privateCA=true to the command:`
helm install rancher rancher-latest/rancher \
--namespace cattle-system \
--set hostname=rancher.my.org \
--set ingress.tls.source=secret \
--set privateCA=true
Verify that the Rancher Server is Successfully Deployed
After adding the secrets, check if Rancher was rolled out successfully:
kubectl -n cattle-system rollout status deploy/rancher
Waiting for deployment "rancher" rollout to finish: 0 of 3 updated replicas are available...
deployment "rancher" successfully rolled out
If you see the following error: error: deployment "rancher" exceeded its progress deadline, you can check the status of the deployment by running the following command:
kubectl -n cattle-system get deploy rancher
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
rancher 3 3 3 3 3m
It should show the same count for DESIRED and AVAILABLE.
Save Your Options
Make sure you save the --set options you used. You will need to use the same options when you upgrade Rancher to new versions with Helm.
Finishing Up
That’s it. You should have a functional Rancher server.
In a web browser, go to the DNS name that forwards traffic to your load balancer. Then you should be greeted by the colorful login page.
Doesn’t work? Take a look at the Troubleshooting Page
All of these instructions are defined in detailed in the Rancher Documentation.
Helm Chart Options for Kubernetes Installations
The full Helm Chart Options can be found here.
Specify each parameter using the --set key=value[,key=value] argument to helm install.
Common Options
| Parameter | Default Value | Description |
|---|---|---|
hostname | " " | string - the Fully Qualified Domain Name for your Rancher Server |
ingress.tls.source | "rancher" | string - Where to get the cert for the ingress. - "rancher, letsEncrypt, secret" |
letsEncrypt.email | " " | string - Your email address |
letsEncrypt.environment | "production" | string - Valid options: "staging, production" |
privateCA | false | bool - Set to true if your cert is signed by a private CA |
Advanced Options
| Parameter | Default Value | Description |
|---|---|---|
additionalTrustedCAs | false | bool - See Additional Trusted CAs Server |
addLocal | "true" | string - As of Rancher v2.5.0 this flag is deprecated and must be set to "true" |
antiAffinity | "preferred" | string - AntiAffinity rule for Rancher pods - "preferred, required" |
replicas | 3 | int - Number of replicas of Rancher pods |
auditLog.destination | "sidecar" | string - Stream to sidecar container console or hostPath volume - "sidecar, hostPath" |
auditLog.hostPath | "/var/log/rancher/audit" | string - log file destination on host (only applies when auditLog.destination is set to hostPath) |
auditLog.level | 0 | int - set the API Audit Log level |
auditLog.enabled | false |
Deploy rancher with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has rancher on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartrancher is pinned at v2.15.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply