helm tricks

Kubernetes tips & tricks, how to change namespace for a cluster

helm tricks

Helm tips & tricks

# look at the helm environment
helm env

# output 
HELM_BIN="helm"
HELM_BURST_LIMIT="100"
HELM_CACHE_HOME="$HOME/Library/Caches/helm"
HELM_CONFIG_HOME="$HOME/Library/Preferences/helm"
HELM_DATA_HOME="$HOME/Library/helm"
HELM_DEBUG="false"
HELM_KUBEAPISERVER=""
HELM_KUBEASGROUPS=""
HELM_KUBEASUSER=""
HELM_KUBECAFILE=""
HELM_KUBECONTEXT=""
HELM_KUBEINSECURE_SKIP_TLS_VERIFY="false"
HELM_KUBETLS_SERVER_NAME=""
HELM_KUBETOKEN=""
HELM_MAX_HISTORY="10"
HELM_NAMESPACE="default"
HELM_PLUGINS="$HOME/Library/helm/plugins"
HELM_QPS="0.00"
HELM_REGISTRY_CONFIG="$HOME/Library/Preferences/helm/registry/config.json"
HELM_REPOSITORY_CACHE="$HOME/Library/Caches/helm/repository"
HELM_REPOSITORY_CONFIG="$HOME/Library/Preferences/helm/repositories.yaml"

# verify if a chart is ok
helm lint

# output
==> Linting .
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, 0 chart(s) failed

# download dependencies
helm dependency build
# output
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ingress-nginx" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading owner-info from repo oci://<docker-repo>/<repo-owner-or-org>
Pulled: <docker-repo>/<repo-owner-org>/owner-info:0.2.0
Digest: sha256:debffd24f1a8305f76cc76e85a169a8c9830c10247abd7bfae9ee52514225efe
Deleting outdated charts

# do a dry run first
helm install poller-postfix-test . --values ./values_real.yaml --dry-run --debug

# output show all configs will be applied

# install a chart
helm install poller-postfix-test . --values ./values_real.yaml --create-namespace

# output 
NAME: poller-postfix-test
LAST DEPLOYED: Fri Jun  7 20:47:12 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None

# check if it deployed it 
kubectl get pods
NAMESPACE       NAME                                   READY   STATUS    RESTARTS      AGE
default         poller-postfix-test-69464c9487-7zv4c   1/1     Running   0             2m2s

# check logs 
kubectl logs poller-postfix-test-69464c9487-7zv4c -f

# list charts 
helm list

# output 
NAME               	NAMESPACE	REVISION	UPDATED                              	STATUS  	CHART       	APP VERSION
poller-postfix-test	default  	1       	2024-06-07 20:47:12.102146 +0200 CEST	deployed	poller-0.1.0	1.16.0

# view the status
helm status poller-postfix-test

# output 
NAME: poller-postfix-test
LAST DEPLOYED: Fri Jun  7 20:47:12 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None

# uninstall a chart
helm uninstall poller-postfix-test

# output 
release "poller-postfix-test" uninstalled

# add a repo
helm repo add rgnu https://gitlab.com/mulesoft-int/helm-repository/-/raw/master/

# install a chart
helm install my-httpbin rgnu/httpbin --version 1.0.0

# show default values of a particular chart
helm show values rgnu/httpbin