Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save saiyam1814/a46f389c9b82851bb0b954651fa862ae to your computer and use it in GitHub Desktop.
Save saiyam1814/a46f389c9b82851bb0b954651fa862ae to your computer and use it in GitHub Desktop.
Helm3 - live session
#Helm is package manager: same kind of apps getting deployed to varous platforms by. various teams with similar configs.
#Helm is templating engine: when most of the app values are same except for image name port helm can prove to be useful.
#Helm hub: https://hub.helm.sh/
#Helm charts GitHub Project: https://github.com/helm/charts
#Helm v3: https://helm.sh/blog/helm-3-released/
curl -sfL https://get.k3s.io | sh -
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm search repo stable
helm repo update
helm install stable/grafana --generate-name
kubectl get secret --namespace default grafana-1588446269 -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
helm plugin install https://github.com/instrumenta/helm-kubeval
helm kubeval stable/grafana
helm completion bash
helm --help
helm search repo stable
helm ls
helm repo list
kubectl create ns traefik
helm install stable/traefik -n traefik --generate-name
helm ls -n traefik
helm create test
helm hub
helm uninstall --keep-history
Upgrades
In Helm 2, it would generate a patch, comparing the old manifest against the new manifest. Because this is a rollback, it's the same manifest. Helm would determine that there is nothing to change because there is no difference between the old manifest and the new manifest. The replica count continues to stay at zero. Panic ensues.
In Helm 3, the patch is generated using the old manifest, the live state, and the new manifest. Helm recognizes that the old state was at three, the live state is at zero and the new manifest wishes to change it back to three, so it generates a patch to change the state back to three.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment