【发布时间】:2020-11-22 03:22:04
【问题描述】:
我在 Kuberentes 中有以下 deployment.yaml 文件:
apiVersion: apps/v1
kind: Deployment
metadata:
name: basic-deployment
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: basic
spec:
containers:
- name: basic
image: nginx
volumeMounts:
- name: config-volume
mountPath: /etc/nginx/conf.d
volumes:
- name: config-volume
configMap:
name: basic-config
我不确定在运行kubectl create -f basic-deployment.yaml 时如何解决以下错误:
部署“basic-deployment”无效:spec.template.metadata.labels:无效值:map[string]string{"app":"basic"}:selector 不匹配模板@ 987654324@
【问题讨论】:
标签: kubernetes kubectl kubernetes-deployment