Kubernetes Deployment
A deployment is a configuration file in Yaml format that describes what the content of a Pod should be.
Pods are always (sidenote: Spawn in this context means: deploying.) via a deployment.
Example deployment file
yaml code snippet start
apiVersion: apps/v1
kind: Deployment
metadata:
name: <name> # Name of the deployment
spec:
replicas: 3 # Amount of pods to spawn/deploy
selector:
matchLabels:
app: example # Labels tell Kubernetes what resources belong together
template:
metadata:
labels:
app: example
spec:
containers: # Here we define the containers
- name: example-container
image: example-image
ports:
- containerPort: 8080
yaml code snippet end