Skip to content

Latest commit

 

History

History
148 lines (107 loc) · 6.31 KB

Helm.md

File metadata and controls

148 lines (107 loc) · 6.31 KB

Helm

Helm Install

curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
sudo apt-get install apt-transport-https --yes
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
  • Check version (helm version):

image

  • ArtifactHUB: https://artifacthub.io/
  • ArtifactHub is like DockerHub, but it includes Helm Charts. (e.g. search wordpress on artifactHub on browser)

image

  • With Helm Search on Hub:
helm search hub wordpress        # searches package on the Hub
helm search repo wordpress       # searches package on the local machine repository list
helm search repo bitnami         # searches bitnami in the repo list   

image

helm repo add bitnami https://charts.bitnami.com/bitnami            # adds link into my repo list
helm search repo wordpress                                          # searches package on the local machine repository list
helm repo list                                                      # list all repo
helm pull [chart]
helm pull jenkins/jenkins
helm pull bitnami/jenkins                                           # pull and download chart to the current directory
tar zxvf jenkins-3.11.4.tgz                                         # extract downloaded chart

image

image

  • Downloaded chart file structure and files:
  • values.yaml: includes values, variables, configs, replicaCount, imageName, etc. These values are injected into the template yaml files (e.g. replicas: {{ .Values.replicaCount }} in the deployment yaml file)
  • charts.yaml: includes chart information (annotations, maintainers, appVersion, apiVersion, description, sources, etc.)
  • template: directory that includes all K8s yaml template files (deployment,secret,configmap, etc.)
  • values-summary: includes the configurable parameters about application, K8s (parameter, description and value)
tree jenkins

image

  • Install chart on K8s with application/release name
helm install helm-release-wordpress bitnami/wordpress               # install bitnami/wordpress chart with helm-release-wordpress name on default namespace
helm install release bitnami/wordpress --namespace production       # install release on production namespace
helm install my-release \                                           # possible to set username/password while creating pods
  --set wordpressUsername=admin \
  --set wordpressPassword=password \
  --set mariadb.auth.rootPassword=secretpassword \
    bitnami/wordpress
helm install wordpress-release bitnami/wordpress -f ./values.yaml   # values.yaml includes import values (e.g. username,pass,..), if it is updated and using this file, it is possible to install with these values. 
echo '{mariadb.auth.database: user0db, mariadb.auth.username: user0}' > values.yaml
helm install -f values.yaml bitnami/wordpress --generate-name       # with using "-f values.yaml", updated values are used 
helm install j1 jenkins                                             # jenkins is downloaded and extracted directory. After values.yaml updated, also possible to install with this updated app config

image

  • To see the status of the release:
helm status helm-release-wordpress

image

  • We can change/show the values that are the variables (e.g.username,password):
helm show values bitnami/wordpress

image

  • You can see the all K8s objects that are automatically created by Helm
kubectl get pods
kubectl get svc
kubectl get deployment
kubectl get pv
kubectl get pvc
kubectl get configmap
kubectl get secrets
kubectl get pods --all-namespace
helm list

image

  • Get password of wordpress:

image

  • Open tunnel from minikube:
minikube service helm-release-wordpress --url

image

image

image image

  • Uninstall helm release:

image

  • Upgrade, rollback, history:
helm install j1 jenkins                                    # create j1 release with jenkins chart
helm upgrade -f [filename.yaml] [RELEASE] [CHART]
helm upgrade -f values.yaml j1 jenkins/jenkins
helm rollback [RELEASE] [REVISION]
helm rollback j1 1
helm history [RELEASE]
helm rollback j1

image

  • To learn more Helm commands:

Goto: Helm Commands Cheatsheet