【发布时间】:2022-01-12 10:28:49
【问题描述】:
我正在尝试使用 kubernetes 中的 yaml 文件创建部署,但遇到此特定错误:
服务器出错(BadRequest):创建“.\deployment_test.yaml”时出错:版本“v1”中的部署无法作为部署处理:v1.Deployment.Spec:v1.DeploymentSpec.Template:v1 .PodTemplateSpec.ObjectMeta: v1.ObjectMeta.Labels: ReadMapCB: expect { or n, but found ", error found in #10 byte of ...|"labels":"test"},"sp|...强>
我的yaml文件如下:
kind: Deployment
metadata:
labels:
environment: test
name: agentstubpod-deployment
spec:
replicas: 3
selector:
matchLabels:
enviroment: test
minReadySeconds: 10
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels: test
spec:
containers:
- name: agentstub
image: some-repo:latest
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
environment: test
name: proxystubpod-deployment
spec:
replicas: 3
selector:
matchLabels:
enviroment: test
minReadySeconds: 10
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels: test
spec:
containers:
- name: procyservice
image: some-repo:latest
这个语法有什么问题?我很难进行部署
【问题讨论】:
标签: kubernetes yaml