Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active August 18, 2022 07:55
Show Gist options
  • Save vfarcic/4e2fd2696ef7d5ce6a915a2eb2408e17 to your computer and use it in GitHub Desktop.
Save vfarcic/4e2fd2696ef7d5ce6a915a2eb2408e17 to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/4e2fd2696ef7d5ce6a915a2eb2408e17
###################################################################
# How To Manage Production-Grade Kubernetes Clusters With Rancher #
# https://youtu.be/JFALdhtBxR8 #
###################################################################
# Additional Info:
# - Rancher: https://rancher.com/products/rancher
# - Rancher Fleet: GitOps Across A Large Number Of Kubernetes Clusters: https://youtu.be/rIH_2CUXmwM
# - How To Create, Provision, And Operate Kubernetes With Cluster API (CAPI): https://youtu.be/8yUDUhZ6ako
# - Rancher (the old version): https://youtu.be/LK6KbAlQRIg
#########
# Setup #
#########
# Create a Kubernetes cluster with Ingress
# Make sure that the cluster has at least 2 CPUs and 8 GB of RAM unallocated (available)
# Replace `[...]` with the external IP of the Ingress service
export INGRESS_HOST=[...]
# Replace `me@acme.com` with your email
export LE_EMAIL=me@acme.com
kubectl apply \
--filename https://github.com/jetstack/cert-manager/releases/download/v1.5.1/cert-manager.crds.yaml
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm upgrade --install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.5.1
helm repo add rancher \
https://releases.rancher.com/server-charts/stable
helm repo update
#############################
# Install And Setup Rancher #
#############################
helm upgrade --install \
rancher rancher/rancher \
--namespace cattle-system \
--create-namespace \
--set hostname=rancher.$INGRESS_HOST.nip.io \
--set bootstrapPassword=admin \
--set ingress.tls.source=letsEncrypt \
--set letsEncrypt.email=$LE_EMAIL \
--wait
echo "http://rancher.$INGRESS_HOST.nip.io"
# Open the output in a browser
# Finish the setup
# Use `admin` as the bootstrap password for the Rancher server
####################################################
# GitOps And Continuous Delivery (CD) With Rancher #
####################################################
kubectl --namespace production get all,ingresses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment