Launching your Kubernetes Cluster with Deployment
What is Deployment in k8s?
A Kubernetes Deployment is an API resource that provides a declarative way to define the desired state of an application. It allows you to describe the application's components, the number of instances (replicas) to run, and how updates or rollbacks should be handled.
Deployment in Kubernetes (k8s) is a higher-level concept that helps manage pods and replicas. It ensures that a specified number of pod "replicas" are running at any given time.
A Deployment in Kubernetes:
Features of a Kubernetes Deployment
Self-healing: If a pod (an instance of a running container) within a deployment fails, Kubernetes automatically replaces it to maintain the desired number of replicas.
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-deployment
spec:
replicas: 3
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
containers:
- name: example-container
image: example-image:tag