• Helm: Include definitions on templates

    2 min read

    helm template include define

    Sometimes we might need to add the same content twice on the same Helm chart. A tipical example would be the labels on the Pods that need to match the selectos on the Service. For this when you create a helm chart there are already some default definitions, for example:

    {{/* Common labels */}} {{- define "pet2cattle.labels" -}} helm.sh/chart: {{ include "pet2cattle.chart" . }} {{ include "pet2cattle.selectorLabels" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* Selector labels */}} {{- define "pet2cattle.selectorLabels" -}} app.kubernetes.io/name: {{ include "pet2cattle.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} 

    16/11/2021

    Read more...
  • Helm template: Array to a comma separated string

    2 min read

    helm template array comma separated

    While writing Helm charts we might need to transform some values that are going to be defined as an array as a value into a comma separated string

    12/11/2021

    Read more...
  • Kubernetes / AWS node termination handler: Drain spot instances that are about to be terminated

    3 min read

    If you are using a mixed policy on your EKS workers ASG you will want to install the AWS node termination handler to drain a node once AWS notifies that a particular spot instance is going to be reclaimed

    29/09/2021

    Read more...
  • Using helm hooks to when certain objects are created

    3 min read

    helm hook

    Sometimes when we are writing a helm chart we realize that we have some parts of the task that need to be performed before of after deploying certain objects. We can also need to execute some Jobs in order to, for example, update the database, but not continuously, just when we update the application.

    To handle this kind of situations we can use helm hooks

    19/08/2021

    Read more...
  • Conditional expressions in helm

    2 min read

    helm expressions if else

    Maybe one of the main challenges about helm is the complexity of it's template rendering engine: It's not very intuitive

    14/07/2021

    Read more...

More recent...