最佳答案
例如,部署 yaml 文件:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: guestbook
spec:
replicas: 2
template:
metadata:
labels:
app: guestbook
spec:
container:
- name: guestbook
image: {{Here want to read value from config file outside}}
Kubernetes 有一个 ConfigMap
特性,但它也是将键/值写入 yaml 文件。有没有一种方法来设置关键的环境变量?