Deployment Details

In the previous page, we created a new deployment running a particular version of the nginx web server.

To generate the YAML file of the newly created objects, do:

$ kubectl get deployments,rs,pods -o yaml

Sometimes, a JSON output can make it more clear:

$ kubectl get deployments,rs,pods -o json

Now we will look at the YAML output, which also shows default values not passed to the object when created:

apiVersion: v1
items:
- apiVersion: apps/v1
  kind: Deployment

Learn more details about each object.

Explanation of Objects

apiVersion

A value of v1 indicates this object is considered to be a stable resource. In this case, it is not the deployment. It is a reference to the List type.

items

As the previous line is a List, this declares the list of items the command is showing.

- apiVersion

The dash is a YAML indication of the first item of the list, which declares the apiVersion of the object as apps/v1. This indicates the object is considered stable. Deployments are an operator used in many cases.

kind

This is where the type of object to create is declared, in this case, a deployment.

Last updated