Kubernetes deployment YAML Walkthrough

This definition file always contains four top-level fields, the API version, kind, metadata, and spec.


$ kubectl api-versions


$ kubectl api-resources | awk '{print $5}'



In the spec section,

ReplicaSet Vs Deployment YAML file

Deployment Strategy YAML

Recreate will delete all the existing pods before creating the new pods.

RollingUpdate will recreate the pods in a rolling update fashion. Moreover, it will delete and recreate pods gradually without interrupting the application availability.

This strategy utilizes the maxUnavailable and maxSurge values to control the rolling update process.

maxSurge: The number of pods that can be created above the desired amount of pods during an update. This can be an absolute number or percentage of the replicas count. The default is 25%.

maxUnavailable: The number of pods that can be unavailable during the update process. This can be an absolute number or a percentage of the replicas count; the default is 25%.

To understand the maxSurge and maxUnavailable, let’s go through the above configuration.

let’s assume that we already have four instances of pods running with Nginx.

In the end, you will have four pods instances running with nginx1.9

Also, check

Kubernetes Tutorials



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store