Kubernetes Objects: Deployment
Provides declarative updates for Pods (an abstraction of Pods).
You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state.
Example:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80