insertIfNotExists
This operation adds the specified elements (like environment variables or volume mounts) only if they do not already exist in the target container. If the container already defines an element with the same name, kTailor will leave the original value intact.
Reminder: Define the
envandvolumeMountsexactly as you would in a standard Kubernetes manifest.
Example
modifyContainers:
insertIfNotExists:
env:
- name: LOG_LEVEL
value: "INFO"
volumeMounts:
- name: config-volume
mountPath: /etc/config