我为复制品添加了
capabilities
,如下所示 values.yml
deployment:
replicas: 1
capabilities:
- NET_ADMIN
- SYS_TIME
- NET_RAW
helm 部署后显示错误,
kubectl describe pod <pod_name>
Warning Failed 7s (x4 over 21s) kubelet Error: Error response from daemon: invalid CapAdd: unknown capability: "CAP_NET_ADMIN SYS_TIME NET_RAW"
我可以通过编辑部署来修复它,
kubectl edit deploy <deployment>
capabilities:
add: ["NET_ADMIN", "SYS_TIME", "NET_RAW"]
我尝试在
values.yml
中应用相同的内容,但出现另一个错误
invalid type for io.k8s.api.core.v1.Capabilities.add: got "string", expected "array"
无论如何,我可以更新我的values.yml,这样部署后就不会出现错误了?
请尝试这样:
deployment:
replicas: 1
capabilities:
add:
- NET_ADMIN
- SYS_TIME
- NET_RAW
如果您的模板类似于:
{{- with .Values.capabilities }}
capabilities:
{{- toYaml . | nindent 8 }}
{{- end }}