I have to create deployment spec file that will:
- Launch 3 replicas of the nginx image with label all_label
- Deployment name star_deploy
Save a copy of this spec file to deployment_spec.yaml or json. After I am done, I need to clean up(delete) any new Kubernetes object which I produced during this task. Based on this task, I do not know how to solve this task. Should I create the deployment and after that, use command
kubectl get deployment star_deploy -o yaml > deployment_spec.yaml
or during creation, use command
kubectl create deployment star_deploy --image=nginx --dry-run -o yaml > deployment_spec.yaml
What do you think is best way to do it?