Kubectl create deployment query

Is there a way to set an env variable in deployment using kubectl create deployment command ?

controlplane k8s/overlays/staging ➜ kubectl create deployment mysql-deployment --replicas=1 --image=mysql --dry-run=client -o yaml > mysql-depl.yaml

Thanks
Sakshi

Not as part of the k create deploy command, no. This is different rom k run. In your case here, you’d need to edit the mysql-depl.yaml file to add an env block to the container in the template block.