【发布时间】:2019-11-18 11:23:57
【问题描述】:
在kubectl apply -f . 之后收到此错误消息
error: error converting YAML to JSON: yaml: invalid map key: map[interface {}]interface {}{"include (print $.Template.BasePath \"/configmap.yaml\") . | sha256sum":interface {}(nil)}
我尝试将checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} 放在不同的地方,但我不太了解 YAML 或 JSON 来解决问题。
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: demo
spec:
replicas: 1
selector:
matchLabels:
app: demo
template:
metadata:
labels:
app: demo
spec:
containers:
- name: demo
image: cloudnatived/demo:hello-config-env
ports:
- containerPort: 8888
env:
- name: GREETING
valueFrom:
configMapKeyRef:
name: demo-config
key: greeting
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
我只是希望能够在配置更改时更新我的 pod。我应该在这里某个地方helm upgrade,但我不确定要给出什么论据。
【问题讨论】:
标签: json kubernetes yaml kubernetes-helm go-templates