Kubernetes has become the de facto standard for container orchestration. In this post, I’ll walk through the basics of getting your first application deployed.
Prerequisites
Before we begin, make sure you have:
kubectlinstalled- Access to a Kubernetes cluster (minikube, kind, or a cloud provider)
- A container image to deploy
Creating a Deployment
The simplest way to deploy an application is using a Deployment resource:
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: nginx:latest
ports:
- containerPort: 80
Exposing the Service
Once your deployment is running, you’ll want to expose it:
kubectl expose deployment my-app --type=LoadBalancer --port=80
Next Steps
- Learn about ConfigMaps and Secrets
- Set up horizontal pod autoscaling
- Implement health checks with liveness and readiness probes
That’s the basics! In future posts, I’ll dive deeper into advanced Kubernetes patterns.