Skip to content

Latest commit

 

History

History
57 lines (44 loc) · 1.01 KB

deployment.md

File metadata and controls

57 lines (44 loc) · 1.01 KB

Deployment

A Deployment provides declarative updates for Pods and ReplicaSets.

You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.

Creating a Deployment

{% code title="app.yaml" %}

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

{% endcode %}

kubectl create -f app.yaml

Get the deployments

kubectl get deployment

Scale the Deployment

kubectl scale deployment nginx --replicas=4

Delete the deployments

kubectl delete deployment nginx