Kubernetes Deployment

A Kubernetes Deployment manifest creating replicas of a pod.

Open in YAML Formatter

About this format

Kubernetes uses YAML to declaratively manage cluster resources like Deployments, Services, and ConfigMaps.

Example Data

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

When to use Kubernetes Deployment

  • Deploying applications to a cluster
  • Scaling pod replicas
  • Defining container specifications