package manager for Kubernetes
( similar to pip for python, similar to apt to debian )
sudo snap install helm --classic
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm reset
helm init
# add new repo
helm repo add my_local_repo https://charts.bitnami.com/bitnami
# helm install --set replica.replicaCount=1 my_local_repo/redis
# sync latest available packages
helm repo update
# the location of Helm's configuration
echo $HELM_HOME
# the host and port that Tiller is listening on
echo $TILLER_HOST
# the path to the helm command on your system
echo $HELM_BIN
# the full path to this plugin (not shown above, but we'll see it in a moment).
echo $HELM_PLUGIN_DIR
helm inspect { folder }
helm lint { folder }
helm search
helm describe {full name of the package}
helm info {name of resource}
helm status {name of resource}
helm create
ls -la ~/.helm/starters/
helm install { full name of the package }
helm install --name {my name for new package} { full name of the package }
helm install --name {my name for new package} --namespace {namespace} -f values.yml --debug --dry-run { full name of the package }
# some examples
helm install bitname/postgresql
helm install oci://registry-1.docker.io/bitnamicharts/postgresql
helm install my_own_postgresql bitname/postgresql
helm plugin install https://github.com/hypnoglow/helm-s3.git
helm list
helm list --all
helm ls
local package
helm upgrade {deployment/svc/rs/rc name} . --set replicas=2,maria.db.password="new password"
package by name
helm upgrade {name of package} {folder with helm scripts} --set replicas=2
check upgrade
helm history
helm rollback {name of package} {revision of history}
helm delete --purge {name of package}
E1209 22:25:57.285192 5149 portforward.go:331] an error occurred forwarding 40679 -> 44134: error forwarding port 44134 to pod de4963c7380948763c96bdda35e44ad8299477b41b5c4958f0902eb821565b19, uid : unable to do port forwarding: socat not found.
Error: transport is closing
solution
sudo apt install socat
Error: incompatible versions client[v2.12.3] server[v2.11.0]
solution
helm init --upgrade
kubectl get pods --namespace kube-system # waiting for start Tiller
helm version
"message": "running PreBind plugin \"VolumeBinding\": binding volumes: timed out waiting for the condition",
create local storage class instead of mapping to external ( EBS )
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: Immediate
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-storage
spec:
capacity:
storage: 8Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /tmp
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- <NODE_INSTANCE_IP>
helm repo add $HELM_BITNAMI_REPO https://charts.bitnami.com/bitnami
helm install $K8S_SERVICE_POSTGRESQL $HELM_BITNAMI_REPO/postgresql --set global.storageClass=local-storage