• Template complexity: can't evaluate field Values in type interface {}

    2 min read

    helm template error context range

    Working with templates can be challenging since, at the end of the day, we are mixing two languages: The template language and the language on which the template itself is written. Doing so we are getting the complexity of one language in addition of the complexity of the other language. That's maybe the main reason why, sometimes, it can be challenging to spot a issues when templates are involved. For example, helm uses templates for generating the appropriate Kubernetes objects, this is one of the errors you might encounter:

    $ helm template  . --debug 
    install.go:172: [debug] Original chart version: ""
    install.go:189: [debug] CHART PATH: /home/pet2cattle/git/spinnaker/helm-spinnaker
    
    
    Error: template: spinnaker/templates/hooks/install-using-hal.yaml:15:28: executing "spinnaker/templates/hooks/install-using-hal.yaml" at <include (print $.Template.BasePath "/configmap/halyard-config.yaml") .>: error calling include: template: spinnaker/templates/configmap/halyard-config.yaml:120:54: executing "spinnaker/templates/configmap/halyard-config.yaml" at <.Values.serviceAccount.spinnaker.enable>: can't evaluate field Values in type interface {}
    helm.go:81: [debug] template: spinnaker/templates/hooks/install-using-hal.yaml:15:28: executing "spinnaker/templates/hooks/install-using-hal.yaml" at <include (print $.Template.BasePath "/configmap/halyard-config.yaml") .>: error calling include: template: spinnaker/templates/configmap/halyard-config.yaml:120:54: executing "spinnaker/templates/configmap/halyard-config.yaml" at <.Values.serviceAccount.spinnaker.enable>: can't evaluate field Values in type interface {}
    

    The error itself looks challenging at first glance, the lines that causes this message are the following:

    {{- range $index, $context := .Values.kubeConfig.contexts }}
    (...)
        $HAL_COMMAND config provider kubernetes account $PROVIDER_COMMAND {{ $context }} --docker-registries dockerhub \
                    --context {{ $context }} {{ if .Values.serviceAccount.spinnaker.enable }}--service-account true{{ end }} \
    (...)
    {{- end }}
    

    Can you spot the mistake?

    02/04/2021

    Read more...
  • Testing assume-role using AWS CLI

    2 min read

    Once you have configured that one role can assume another role from another account you might want to actually test that you are able to do it. With aws sts you will be able to assume a role

    01/04/2021

    Read more...
  • Declaratively create a kubernetes pod using kubectl (for docker administrators)

    2 min read

    kubernetes create pod

    The first thing one want to try once we have access to a Kubernetes cluster is to run a pod in it. Let's try to create our first pod on kubernetes, declaratively: meaning that we will be writing a manifest to do it.

    31/03/2021

    Read more...
  • tcpdump: filter DNS queries

    2 min read

    When a DNS change is involved in an ongoing issue, we need to be sure when we use, for example curl, whether we are hitting the new or the old resource. Is that DNS record still cached locally? One of the best ways of checking this is by sniffing the DNS traffic using tcpdump

    30/03/2021

    Read more...
  • Imperatively create a kubernetes pod using kubectl

    1 min read

    kubernetes create pod

    Just as an hello-world equivalent, first thing one want to try to start learning how to use a Kubernetes cluster is to run a pod in it. Let's try to create our first pod on kubernetes just as we would do with docker for running a container

    29/03/2021

    Read more...

More recent...

Older content...