I am trying create deployment using yaml file in kubernetes but facing this specific error:
Error from server (BadRequest): error when creating ".\deployment_test.yaml": Deployment in version "v1" cannot be handled as a Deployment: 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|...
My yaml file is as follows:
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
What is wrong with this syntax? I am having a really hard time making a deployment