kubectl

helm tricks

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

Sam
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.

k8s tips and tricks

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

Sam
Introduction In this article, we will explore various tips and tricks for managing Kubernetes (k8s) clusters using kubectl. These commands will help you efficiently handle namespaces, pods, deployments, and custom resource definitions (CRDs). Change the kubectl namespace while keeping the current context intact # change namespace of kubectl while keeping current context kubectl config set-context --current --namespace=default List pods from default namespace kubectl get pods List pods from all namespaces kubectl get pods -A # list pods from all namespaces List pods from a particular namespace kubectl get pods -n mynamespace How to check logs of a pod kubectl logs nginx-pod -n nginix-ns How to check logs of a pod as it gets generated or watch k8s pod logs ## use -f to follow the log as it generated kubectl logs <pod_name> -n <namespace> -f Deleting a Kubernetes deployment using kubectl If you don’t have proper permissions on the cluster, you will encounter an error like this.