I have certain requirements where volumeMounts: should be an optional field.
spec:
volumes:
-
name: aaa
secret:
secretName: aaa-certs
containers:
-
name: my-celery
volumeMounts:
-
name: aaa
mountPath: /tmp/aaa_certs
readOnly: true
If secret is present then it will mount, else create an empty folder. Is this possible
Secret volumes can be marked as optional using tag "optional: true", and result in empty directories if the associated secret doesn't exist, rather than blocking pod startup.
Example:
spec:
volumes:
-
name: aaa
secret:
secretName: aaa-certs
optional: true
containers:
-
name: my-celery
volumeMounts:
-
name: aaa
mountPath: /tmp/aaa_certs
readOnly: true
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加