• Autoscaling using datadog as a external metrics provider

    3 min read

    kubernetes hpa datadog external metrics

    Since Kubernetes v1.2 we can autoscale an application based on metrics like CPU provided by the metrics-server. As of Kubernetes v1.6, it is possible to autoscale off of custom metrics and later on, starting Kubernetes v1.10, we can autoscale using any metric from outside the cluster, like the ones collected by datadog

    10/01/2022

    Read more...
  • Expose Pod information using an volume

    2 min read

    kubernetes pod data volume fieldPath

    We can choose to expose some of the Pod's information as volumes or environment variables using DownwardAPIVolumeFile. It can expose both Pod fields and Container fields

    05/01/2022

    Read more...
  • Expose Pod information using an environment variable

    2 min read

    kubernetes pod data environment variable fieldPath

    Some applications might need to retrieve (or at least know) some of the Pod's metadata, for example, it's namespace. We can push this information using fieldPath without having to grant access to the Kubernetes API or using any template engine (such as Helm) to set it's value (at the end of the day it would be hardcoding the value on the Pod's definition)

    04/01/2022

    Read more...
  • How to set a variable on terraform using environment variables

    2 min read

    terraform variables environment variables

    To set a value for a variable on terraform we have several ways of doing it:

    • Using the -var command line option.
    • In variable definitions (.tfvars) files. The files named terraform.tfvars, terraform.tfvars.json or any files with names ending in .auto.tfvars or .auto.tfvars.json will be loaded automatically, but they can also be loaded using the -var-file option.
    • As environment variables.

    03/01/2022

    Read more...
  • Helm templates: Using fullname inside a range block

    2 min read

    helm template fullname range

    If we try to use the template fullname function inside a range block as follows:

    {{ range .Values.secrets }}
    ---
    apiVersion: 'kubernetes-client.io/v1'
    kind: ExternalSecret
    metadata:
      name: "{{ template "pet2cattle.fullname" . }}-{{ . | replace "_" "-" }}"
    (...)
    {{ end }}
    

    We will get a can't evaluate field Values in type string like follows:

    Error: template: pet2cattle/templates/_helpers.tpl:14:14: executing "pet2cattle.fullname" at <.Values.fullnameOverride>: can't evaluate field Values in type string
    

    29/12/2021

    Read more...

More recent...

Older content...