How do you convert a Kubernetes pod to a deployment?
Experience Level: Senior
Tags: Kubernetes
Answer
Export the pod to a yaml definition using the following command:
Create a new deployment definition using the following command:
Display the pod yaml:
Copy the spec part
Edit the deployment file:
Paste the pod .spec block to deployment template .spec, correct indentation, save the file.
Create the deployment using the file:
Related Kubernetes job interview questions
How do you change a number of replicas of a Kubernetes deployment dep1 to 3?
Kubernetes SeniorOn which level can you configure securityContext field in Kubernetes?
Kubernetes SeniorHow do you rollback deployment d12 to a specific revision?
Kubernetes SeniorHow do you display a history of Kubernetes deployment d12 in namespace ns2?
Kubernetes SeniorHow do you move a pod between namespaces in Kubernetes?
Kubernetes Senior