Kubernetes: Can someone help me check this file and tell me what is wrong with it

Can someone help me check this file and tell me what is wrong with it.
apiVersion: v1
kind: Deployment
metadata:
name: my-nginx
labels:
app: my-v1
spec:
replicas: 5
selector:
matchLabels:
app: my-v1
template:
metadata:
labels:
app: my-v1
annotations:
buildversion: nginx:1.25.4
spec:
nodeName: node2
containers:
- name: my-nginx
image: nginx:1.25.4-alpine-slim
metadata:
name: my-qouta
labels:
app: my-v1
Namespace: ese
spec:
hard:
pods: “2”
request.cpu: “1”
request.memory: 1Gi
limits.cpu: “2”
limits.memory: 2Gi
metadata:
name: my-service
spec:
selector:
app: my-v1
ports:
- port: 8080
targetPort: 8080
nodeport: 3007

Here is the error i keep getting.

Error from server (BadRequest): error when creating “deploy-definition-file.yaml”: Pod in version “v1” cannot be handled as a Pod: strict decoding error: unknown field “spec.replicas”, unknown field “spec.selector”, unknown field “spec.template”

Please paste the Yaml inside a Code Block (the </> from the menu bar) so spacing is preserved.

for deployment apiversion should be apps/v1

1 Like