Impossible to run Pod

I am trying to run Lab on CKA certification in KodeKloud Lab and I face issue, while I attempt to create pod from definition file in YAML: no matter how I define image setting - it always failes with the message: error: required image is not set.

The full overview about my commands and YAML config is below:

controlplane ~ ➜ kubectl run redis --image=redis123
pod/redis created

controlplane ~ ➜ kubectl run -f redis.yaml
error: required flag(s) “image” not set

controlplane ~ :heavy_multiplication_x: cat redis.yaml
apiVersion: v1
kind: Pod
metadata:
name: redis123

spec:
containers:

  • name: redis
    image: redis

IT IS STRANGE that Lab can spin up the pod from imperative command, but fails with definition file. It used to work some time ago, but not anymore.

I am using Chrome browser for accessing Lab if it matters at all.

Hi @aleksei.antonovits ,
If you are deploying from the manifest file then please make use of the kubectl create -f command.

kubectl create -f redis.yaml

Regards,

You can make use of kubectl run --help command. It will give you more info about the command.