我正在做一些练习,试图把我的头缠在如何编写yaml build上。
spec:
containers:
- image: nginx
imagePullPolicy: IfNotPresent
name: nginx
resources: {}
envFrom:
- configMapRef:
name: anotherone # the name of the config map
dnsPolicy: ClusterFirst
restartPolicy: Never
status: {}
VS
containers:
- image: nginx
imagePullPolicy: IfNotPresent
name: nginx
resources: {}
env:
- name: option # name of the env variable
valueFrom:
configMapKeyRef:
name: options # name of config map
key: var5 # name of the entity in config map
所以我的问题是:在kubernetes中进行构建时,何时使用'-'符号? 我确实知道,如果我在字符串之前加上“-”,它将使它成为列表内的对象,但是我不明白何时需要在kubernetes的内部版本中使用列表。