收到此错误消息后 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)}
Run Code Online (Sandbox Code Playgroud)
我试过放在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: …
Run Code Online (Sandbox Code Playgroud)