Skip to content

How to automatically generate a Manifests file in Kubernetes

If you want to automatically generate a manifest file in Kubernetes, you can do so by using the kubectl run command coupled with a --dry-run to output directly to yaml.

kubectl run nginx --image=nginx --port=80 --replicas=2 --expose --dry-run -o yaml
Code language: Bash (bash)

You can also output this directly to a file on disk as follows:

kubectl run nginx --image=nginx --port=80 --replicas=2 --expose --dry-run -o yaml > your-deployment-manifest.yaml
Code language: Bash (bash)

See also  Academic integrity in a cultural context
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x