0

I have following yaml file:

---
apiVersion: v1
kind: pod
metadata:
    name: Tesing_for_Image_pull.pod 
    spec:
        containers:
        - name: mysql 
          image: mysql 
          imagePullPolicy: Always 
          command: ["echo", "SUCCESS"]  

When I use kubectl create -f Tesing_for_Image_pull.yaml , I get the following error:

error: error validating "Tesing_for_Image_pull.yaml": error validating data: couldn't find type: v1.pod; if you choose to ignore these errors, turn validation off with --validate=false

How can I solve my problem?

1

kubernetes is picky and case-sensitive:

kind: Pod

should do it.

Also, spec should not be in metadata:

apiVersion: v1
kind: Pod
metadata:
  name: Testing
spec:
  containers:
  - name: mysql
    image: mysql
    imagePullPolicy: Always
    command: ["echo", "SUCCESS"]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.