π¦ Step 1: Deployment
A Deployment manages your application's replicas and ensures the desired state is maintained.
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
spec:
replicas: 3
selector:
matchLabels:
app: hello-world
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: nginx
image: harbor.bssconnects.io/rnd/hello-world:latest
ports:
- containerPort: 80
π‘ Tip: Deployments handle rolling updates and rollbacks automatically!
π Step 2: Service
A Service provides a stable network endpoint to access your Pods.
apiVersion: v1
kind: Service
metadata:
name: hello-world
spec:
type: ClusterIP
selector:
app: hello-world
ports:
- port: 80
targetPort: 80
π‘ ClusterIP: Internal-only access (default type)
πͺ Step 3: Ingress
An Ingress routes HTTP(S) traffic from the internet to your Service.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello-world
annotations:
cert-manager.io/cluster-issuer: letsencrypt-staging
spec:
ingressClassName: nginx
tls:
- hosts:
- hello-world.bssconnects.io
secretName: hello-world-tls
rules:
- host: hello-world.bssconnects.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hello-world
port:
number: 80
π‘ cert-manager automatically provisions TLS certificates from Let's Encrypt!
π§ Additional Tools Used
- NGINX Ingress Controller: Implements Ingress rules and handles traffic routing
- cert-manager: Automates TLS certificate provisioning and renewal
- external-dns: Automatically creates DNS records for your Ingress hosts
- Harbor: Private container registry at harbor.bssconnects.io
β Deployment Commands
# Build and push the Docker image
docker build -t harbor.bssconnects.io/rnd/hello-world:latest .
docker push harbor.bssconnects.io/rnd/hello-world:latest
# Apply Kubernetes manifests
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
kubectl apply -f ingress.yaml
# Check the deployment status
kubectl get pods
kubectl get svc
kubectl get ingress
π Live Status
Pod Count:
Loading...
Service Type:
ClusterIP
Ingress Host:
hello-world.bssconnects.io
TLS:
β Enabled