The simple pod example YAML for Kubernetes shows that the 'metadata' and 'spec' elements required are at the top level of the definition. The kubectl command is most likely failing because it cannot find the 'spec' element, which defines the specification of the pod.
You seem to be testing the image pull configuration, and you have specified that you simply want to run echo SUCCESS inside the container. Considering both these conditions, it would be preferable to pull down bash image instead of the mysql image.
The following alternate YAML should work correctlyfor your needs:
---
apiVersion: v1
kind: Pod
metadata:
name: Tesing_for_Image_pulltesting-for-image-pull
spec:
containers:
- name: mysqlbash
image: mysqlbash
imagePullPolicy: Always
command: ["echo",["echo"]
"SUCCESS"] args: ["SUCCESS"]
Do noteThe following changes have been made from the original YAML file: 1) The kind element has been corrected to the value Pod. 2) The name of the pod has been changed to fit Kubernetes requirements (lowercase DNS-like name). 3) The image and name elements have been modified to use the bash image. 4) The command definition has been changed to use the command and args keys instead.
Note that YAML uses spaces instead of tabs for indentation. Also, and the suggested syntax for YAML is to use two spaces per level of indentation, instead of the traditional four spaces.
For more example YAML files, refer to the Kubernetes website repository on GitHub.