Home > Software engineering >  Additional property is not allowed in Helm chart
Additional property is not allowed in Helm chart

Time:11-12

Since I added some additonal initContainers to my Airflow helm chart (link), I was trying to set a default initContainerResources to my helm values and deployment yaml:

  • values.yaml
# Airflow scheduler settings
scheduler:
  
  initContainerResources:
    resources: 
     limits:
      cpu: 200m
      memory: 255Mi
     requests:
      cpu: 100m
      memory: 128Mi

  • .. and deployment.yaml
...
        - name: scheduler-add-init1
          securityContext:
            allowPrivilegeEscalation: False
          resources:
{{ toYaml .Values.scheduler.initContainerResources.resources | indent 12 }}
...

However, when I try to render the files with helm template, I get:

Error: values don't meet the specifications of the schema(s) in the following chart(s): airflow:

  • scheduler: Additional property initContainerResources is not allowed

What´s wrong with my setup?

CodePudding user response:

Instead of:

resources: {{ toYaml .Values.scheduler.initContainerResources.resources | indent 12 }}

Try to put:

resources: {{ $.Values.scheduler.initContainerResources.resources }}

CodePudding user response:

You need to follow the spec:

scheduler:
  resources: 
    limits:
      cpu: 200m
      memory: 255Mi
    requests:
      cpu: 100m
      memory: 128Mi

And use it like {{ $.Values.scheduler.resources }}. Indent it as you need, of course.

  • Related