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:
# Airflow scheduler settings
scheduler:
initContainerResources:
resources:
limits:
cpu: 200m
memory: 255Mi
requests:
cpu: 100m
memory: 128Mi
...
- 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
My goal was to define the init containers resources together but independent from the scheduler container. What´s wrong with my setup?
Instead of:
resources:
{{ toYaml .Values.scheduler.initContainerResources.resources | indent 12 }}
Try to put:
resources: {{ $.Values.scheduler.initContainerResources.resources }}
Turned out I had the schema validation process blocking me from adding additional parameters. Just added the desired key to the schema and it worked:
values.schema.json
"initContainerResources": {
"description": "Add default ressources to all init containers of scheduler.",
"type": "object",
"default": "See values.yaml"
},