KUBERNETES DEPLOYMENT

Deployments

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: webserver
spec:
replicas: 3
selector:
matchLabels:
app: web1
template:
metadata:
labels:
app: web1
spec:
containers:
- name: nginx-container
image: nginx:1.21.6
$ kubectl describe deployment nginx-deployment
$ kubectl get rs
$ kubectl scale --replicas=2 deploy nginx-deployment
$ kubectl log -f <podName>
# To check out rollout status
$kubectl rollout status deployment nginx-deployment
# Check all revision history
$kubectl rollout history deployment nginx-deployment
# To Rollback to previous version
$kubectl rollout undo deploy/nginx-deployment
# To Rollback to specific version
$kubectl rollout undo deploy/nginx-deployment --to-revision=<<version>>

--

--

--

Stay hungry; Stay Foolish!!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to use Immersive reader in Google Chrome

[pfSense] Security zones interface design concept

10 Tips for Working Remote

Win your colleagues over with Applications in Dataiku 8.0

Introduction to iOS Development Series 1.5 — Linking Visual Object to Code

ClickFYI: How I Faced Challenges

Make a Standalone App in Python — Part 1: Only GUI

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
Khemnath chauhan

Khemnath chauhan

Stay hungry; Stay Foolish!!

More from Medium

Kubernetes Service Discovery with Serf

Kubernetes

Kubernetes Service & Endpoints