- One running Kubernetes cluster
- Install
kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
kubectl version --clientsudo apt-get install curl gpg apt-transport-https --yes
curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
helm versionhelm install <RELEASE_NAME> <CHART_NAME>
helm delete <RELEASE_NAME>
helm list -a
helm create helloworldtree helloworldhelloworld
├── charts
├── Chart.yaml
├── templates
│ ├── deployment.yaml
│ ├── _helpers.tpl
│ ├── hpa.yaml
│ ├── ingress.yaml
│ ├── NOTES.txt
│ ├── serviceaccount.yaml
│ ├── service.yaml
│ └── tests
│ └── test-connection.yaml
└── values.yaml
# helloworld/values.yaml
service:
type: NodePort
port: 80helm install myhelloworld helloworld
helm list -a
kubectl get serviceNow browse ip:<port_no> in your browser to see the default nginx page.
helm repo add bitnami https://charts.bitnami.com/bitnami
helm search repo bitnami
helm repo listhelm repo updateThe index command generates the index file for a directory containing packaged charts.
helm repo index helloworld
cat helloworld/index.yamlhelm repo remove bitnamiUpgrade a Helm chart after making changes. This will change the revision number.
helm upgrade myhelloworld helloworldRollback the Helm chart to a previous revision.
helm rollback myhelloworld 1- Bundle several Helm Charts into a single Helmfile to manage your Kubernetes ecosystem.
- Maintain isolation between different environments (development, staging, production).
- Identify differences between new changes and existing deployments in your Kubernetes cluster.
- Use Go Templates in Helmfile, with Sprig library functions like
requiredEnv,exec,readFile,toYaml,fromYaml,setValueAtPath,get,tpl,required,fetchSecretValue,expandSecretRefs. - Deploy multi-tier applications inside your Kubernetes cluster with Helmfile.
wget https://github.com/roboll/helmfile/releases/download/v0.144.0/helmfile_linux_amd64
mv helmfile_linux_amd64 helmfile
chmod 777 helmfile
sudo mv helmfile /usr/local/bin
helmfile -version-
Create a Helm chart:
helm create helloworld
-
Create a
helmfile.yaml:releases: - name: helloworldrelease # release name chart: ./helloworld # directory/chart name installed: true
-
Sync with Helmfile:
helmfile sync helm list -a
-
Edit
helmfile.yamlto setinstalled: false:releases: - name: helloworldrelease chart: ./helloworld installed: false
-
Sync again:
helmfile sync helm list -a
-
Edit
helmfile.yaml:repositories: - name: helloworld url: git+https://github.com/rahulwagh/helmchart@helloworld?ref=master&sparse=0 releases: - name: helloworldrelease chart: helloworld/helloworld installed: true
-
Sync:
helmfile sync helm list -a
-
Create charts:
helm create helloworld1 helm create helloworld2
-
Create a
helmfile.yaml:releases: - name: helloworld1 chart: ./helloworld1 installed: true - name: helloworld2 chart: ./helloworld2 installed: true
-
Sync with Helmfile:
helmfile sync helm list -a
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo list