K8s deployment
Zhengliang Wang edited at Mon Jul 01 2024
Cloud
k8s

Document

example:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80

Rolling update

In Kubernetes, a rollout is the process of deploying a new version of an application or service. There are two common rollout strategies: rolling update and recreate. A rolling update gradually replaces pods running the old version with new ones, while a recreate strategy deletes all the old pods and creates new ones.

Rollback update

Rollback is the process of undoing a rollout and reverting to a previous version of the application. These features help to minimize downtime and ensure a smooth deployment process.