Devops
Day 19 of DevOps learning 🚀 :
👉 As I continue my DevOps journey, today I dived into Kubernetes manifest files! These configuration files are essential for defining and maintaining the desired state of objects in a Kubernetes cluster. Here's a quick breakdown of what I've learned:
- Kubernetes manifest files are typically written in YAML and describe how to configure resources like Pods, Deployments, Services, and more. These files make it easy to manage your infrastructure in a declarative way, meaning you define the "what" and Kubernetes takes care of the "how."
👉 Sample Manifest for a Pod:
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
name: nginx-container
image: nginx:latest
ports:
- containerPort: 80
👉 This simple manifest file defines a Pod running an NGINX container, exposing port 80
👉 Key Components:
- ApiVersion: Specifies the version of the Kubernetes API to use.
- Kind: Defines the type of object (Pod, Deployment, etc.).
- Metadata: Includes important info like the name and labels of the object.
- Spec: Describes the desired state (containers, ports, images, etc.).
You can create resources using kubectl apply:
- kubectl apply -f nginx-pod.yaml
- With this, Kubernetes will spin up your Pod as defined!
#devops #sre