A kubectl command can be used to create, delete or updated resources on a Kubernetes cluster. With the –dry-run=(client|server) flag, the kubectl command can be used to only preview an object, without really submitting it to the Kubernetes cluster. The dry-run mode is useful to see what will the kubectl command do without actually changing […]
kubernetes
Kustomize: Change Image, Tag or Registry
Kustomize is a tool for customizing Kubernetes configurations. Like for secrets, in Kustomize, there is a custom directive that allows to easily override names, tags and change registries (repositories) of container images (e.g. Docker images). This short note shows how to change the image name, tag or registry using Kustomize.
Kubectl: Get Pod Containers
According to best practices you should always try to have one container per Pod, and this is the most common Kubernetes use case. However, a Pod can contain multiple containers and the primary reason for this is to support helper applications that assist a primary application. Typical examples of helper applications are data pullers, data […]
Kubectl: Get Events & Sort By Time
Kubernetes events are automatically created when resources have state changes, errors or other messages that should be broadcasted to the system. These events (logs) are very helpful for debugging issues in a Kubernetes cluster. Unfortunately, a kubectl get events command, by default, returns an unsorted list of the events that is not easy to search […]
Helm: Dry Run & Template Debug
Helm uses a packaging format called charts (a collection of Kubernetes resource files). This note shows how to –dry-run and –debug Helm chart templates with examples. It also shows how to lint and render Helm chart YAMLs locally (without sending them to a Kubernetes API server).
Helm Upgrade: Update Chart Values – Example
When you upgrade a Helm chart in a Kubernetes cluster you can also customize parameters of the chart to configure a release. The Helm chart parameters customization is carried out by updating сhart values. This note shows how to update a Helm chart with new values using a helm upgrade command.
Kubectl: Run Pod With Command & Exec Into
Unless for very specific reasons, you should never run a Pod with a long-running application on its own, but use a Deployment for this. Nevertheless, if you want to quickly run some container image on Kubernetes resources, you can use a kubectl run command. For example, i often need to run the Pod on a […]
Kubectl: Force Delete Namespace Stuck In Terminating
Sometimes a deletion of a Namespace in Kubernetes gets hung up and the kubectl delete namespace command never completes. Such Namespaces get stuck in a Terminating state but can be manually deleted using a Kubernetes API. This note shows how to force delete the Terminating Namespaces in Kubernetes.
Helm: Get Values
When you install a Helm chart into a Kubernetes cluster you can pass custom values to configure the release. Comparing versions of Helm values and reviewing old releases is a good practice for keeping track of changes. Below you will find how to get values of a Helm chart release using a helm get values […]
Helm: List Installed Charts
Helm uses a packaging format called charts (a collection of Kubernetes resource files). Helm charts installed on a Kubernetes cluster can be listed by using a helm command. This short note shows how to list all the Helm charts installed by the helm command.