Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the full Kubernetes YAML spec?

There must be "full-configuration" and example templates of Kubernetes YAML configs somewhere with comments itemizing what parameters do what with runnable examples somewhere.

Does anyone know where something like this might be? Or where the "full API" of the most commonly used Kubernetes components are?

like image 345
Rant Overflow Avatar asked Feb 28 '19 20:02

Rant Overflow


Video Answer


1 Answers

There is documentation for every k8s api version available, for example check this link.

The way I found what every key in yaml file represent and what does it mean is via kubectl explain command.

For example:

$kubectl explain deploy.spec

Trick I use while doing CKAD to see full list could be:

$kubectl explain deploy --recursive > deployment_spec.txt

This will list all available options for kubernetes deployment that could you use in yaml file.

To generate some template there is option to use --dry-run and -o yaml in kubectl command, for example to create template for CronJob:

$kubectl run cron_job_name --image=busybox --restart=OnFailure --schedule="*/1 * * * * " --dry-run -o yaml > cron_job_name.yaml
like image 133
Gile Champion Avatar answered Oct 11 '22 17:10

Gile Champion