Kubernetes manifests · Workloads

Deployment

Run three replicas of a container and roll out updates gradually.

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

Official Kubernetes manifests documentation

More workloads commands

All workloads commands · Kubernetes manifests cheatsheet

Was this page helpful?