Configuring additionalMounts parameter
- Used to mount a list of additional resources like configMaps, secrets, and PVCs with volume mount configuration, to be mounted into each pods.
- Used to pass customer overrides through a
configMap
to the pods as an alternate way. For more information, see Passing customer overrides through configMaps by using additionalMounts.
The following .yaml file is a sample schema of
additionalMounts
:
additionalMounts:
configMaps:
- name: ""
mountPath: ""
# subPath: ""
# subPathExpr: ""
# readOnly: false
# mountPropagation: ""
# matchLabels: {}
secrets:
- name: ""
mountPath: ""
# subPath: ""
# subPathExpr: ""
# readOnly: false
# mountPropagation: ""
# matchLabels: {}
storages:
- name: ""
mountPath: ""
# storageClassName: ""
# accessMode: ""
# capacity:
# matchLabels: {}
The following table explains the attributes applicable for both configMaps and secrets properties
of
additionalMounts
parameter.
Property | Default value | Value type | Required | Description |
---|---|---|---|---|
name |
string | Yes | Specify the name and make sure it matches the name of a configMap or a secret. | |
mountPath |
string | Yes | Specify the path within the container where the volume should be mounted. Note: The path must
not contain ':'.
|
|
mountPropagation |
string | No | This determines how mounts are propagated from the host to container and the other way
around. When not set, MountPropagationNone is used. |
|
readOnly |
false |
boolean | No | Mounted read-only if true, read-write otherwise (false or unspecified). |
subPath |
"" (volumes's root) |
string | No | Path within the configMap or secret from which the container's volume should be mounted. |
subPathExpr |
"" (volumes's root) |
string | No | Expanded path within the configMap or secret from which the container's volume should be
mounted. Behaves similarly to SubPath but environment variable references
$(VAR_NAME) are expanded using the container's environment.
SubPathExpr and SubPath are mutually exclusive. |
matchLabels |
object | No | Specify matchLabels as key-value pair. If matchLabels are
empty, then the volume is mounted to every pod. Otherwise, the additional volume is mounted to only
those pods where key-value pair of matchLabels matches with key-value pair of
podLabels . |
The following table explains the attributes applicable for
storage
property of
additionalMounts
spec.
Property | Default value | Value type | Required | Description |
---|---|---|---|---|
mountPath |
|
string | Yes | Specify the path to mount a PV onto the pod. Note: Do not set the path to
/shared . |
name |
shared-volume |
string | Yes | Specify the name of the Persistent Volume claim. |
accessMode |
ReadWriteMany |
string | No | Specify the access mode for the Persistent Volume. |
capacity |
10Gi |
string or integer | No | Specify the capacity for the Persistent Volume. |
storageClassName |
default |
string | No | Specify the storage class for the Persistent Volume claim. |
matchLabels |
object | No | Specify matchLabels as key-value pair. If matchLabels are
empty, then the volume is mounted to every pod. Otherwise, the additional volume is mounted to only
those pods where key-value pair of matchLabels matches with key-value pair of
podLabels . |