Cka mock Exam 2 question 5

not able to create deployment with record flag
please help


is also not working

Hello, @paidibhanu209
First of all, cluster is v1.19 and you are using deprecated flags (–generator=run-deployments/v1).

  1. You cannot create deployment from the kubectl run command, it creates a Pod not Deployment. (v1.18+)
  2. --record flag will not work with kubectl create <resource-name> and kubectl run.
  3. You can create deployment with
    kubectl create deployment deploy1 --image=nginx -replicas=2
  4. To record, you can do
kubectl create deploy nginx --image=nginx --replicas=2 --dry-run=client -oyaml > f1.yaml
kubectl create -f f1.yaml --record 
1 Like