Reputation: 1
getting error as mapping values are notallowed in this context
I have written a deployment manifest file and getting an error message.as mappling values are not allowed. apiVersion: apps/v1 kind: Deployment metadata: name: my-deployment spec: replicas: 3 selector: matchlabels: app: my-app template: metadata: labels:my-appp spec: containers: - image: nginx name: my-ngnix ports: - containerPort: 8080
Upvotes: 0
Views: 233
Reputation: 3781
The YAML syntax in your deployment manifest is incorrect. YAML is very sensitive to indentation and requires specific formatting to correctly express the nested structure of the configuration.
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-nginx
image: nginx
ports:
- containerPort: 8080
Apply the same using kubectl apply -f <filename.yaml>
Upvotes: 0