MaxC MaxC - 3 months ago 42
YAML Question

Approach of deploying pods/services on Kubernetes

I know the concepts of Kubernetes. I'm able to do some basic stuff als create a pod and create a service above it. I do this by using

commands. When I'm searching for examples I see a log of .yaml and .json files.

Is it the global approach to create a .json or .yaml file which describes the setup of your pods/services (a bit like a docker-compose file)?

Maybe a strange question but for me it seems a bit weird that everyone who's using kubernetes is able to write his own .yaml-templates for their applications.


Creating pods and services, scaling pods etc can all be done from the kubectl using the appropriate commands. It will internally create the necessary config and create the resources.

This is great for trying out things, but not ideal for anything more serious. You want to version control, inspect and evolve your config. So it is better to start with a yaml or json config for what you want to create, and use that with kubectl.