从文档中:
Secrets must be created before they are consumed in pods as environment variables unless they are marked as optional. References to Secrets that do not exist will prevent the pod from starting.
如何将 secret 标记为可选?
最佳答案
您正在寻找的是
- name: ENV_NAME
valueFrom:
secretKeyRef:
name: <secrets name>
key: <secrets key>
optional: true
您可以找到类型定义here编辑:类似
envFrom
envFrom:
- secretRef:
name: secname
optional: true
关于kubernetes - 如何在kubernetes中将secret标记为可选?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48208705/