What are Deployments in Kubernetes?

  • What Deployments are in Kubernetes
  • How we can create Deployment Objects in Kubernetes
  • How can we use kubectl to manage our Deployments?
  • Deployment Strategies

What Deployments are in Kubernetes

How we can create Deployment Objects in Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-deployment
labels:
tier: frontend
app: nginx
spec:
selector:
matchLabels:
app: myapp
replicas: 3
template:
metadata:
name: nginx
labels:
app: myapp
spec:
containers:
- name: nginx
image: nginx

How can we use kubectl to manage our Deployments?

kubectl apply -f ourdeployment.yaml
kubectl create -f ourdeployment.yaml
kubectl get deployments
NAME              READY     UP-TO-DATE   AVAILABLE   AGE
myapp-deployment 0/3 0 0 1s
kubectl rollout status <name-of-deployment>
kubectl rollout history <name-of-deployment>
kubectl rollout undo <name-of-deployment>
kubectl scale deployment <name-of-deployment> --replicas=10
kubectl autoscale deployment --min=3 --max=10 --cpu-percent=70

Deployment Strategies

Conclusion

--

--

--

Customer Engineer at Microsoft working in the Fast Track for Azure team. GitHub: https://github.com/willvelida

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

Recommended from Medium

READ/DOWNLOAD!% 80X86 IBM PC and Compatible Comput

Enumeration via LDAP — Part 1

DEPLOYING HYPERLEDGER FABRIC ON KUBERNETES

JDeveloper: Windows-10 4K Display Resolution Problem and Solution

Part1: Installing Terraform & Service Automation Module on IBM Cloud Pak for MultiCloud Management

Cisco VPN Client Fix for Windows 10 Machines Released

Fitting Your Architecture to Your Team Structure

Nginx basics

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
Will Velida

Will Velida

Customer Engineer at Microsoft working in the Fast Track for Azure team. GitHub: https://github.com/willvelida

More from Medium

Using SSL/TLS certificates from Azure Key Vault in Kubernetes pods

Padlocks, padlocks everywhere

Structural container patterns in Kubernetes

Deploy Microservices With Helm Operators

Enhancing reliability by distributing your APP into multiple OpenShift clusters — Part II