Welcome to the Platform App Deployment project! This repository serves as a learning journey into modern DevOps practices, focusing on containerization, security hardening, and Kubernetes orchestration.
This pipeline demonstrates a complete flow from development to deployment, emphasizing Security-First and Infrastructure-as-Code principles.
| Category | Technology |
|---|---|
| Containerization | Docker |
| Registry | GitHub Container Registry (GHCR) |
| Orchestration | Kubernetes |
| Security | Trivy, K8s SecurityContext |
| CI/CD | GitHub Actions |
The application is containerized and hosted on GitHub Container Registry (GHCR).
- Image:
ghcr.io/himanshu2561/platform-app - Best Practices: Using specific tags (SHA-based) for immutability and reproducibility.
A robust deployment configuration featuring:
- Scalability: Configured with
2 replicasfor high availability. - Health Checks:
readinessProbe: Ensures traffic only hits healthy pods.livenessProbe: Automatically restarts failing pods.
- Resource Management: Defined CPU/Memory requests and limits to ensure cluster stability.
- Security:
runAsNonRoot: trueallowPrivilegeEscalation: false
- Type: ClusterIP (internal exposure).
- Port Mapping: Forwards traffic from port
80to container port8000.
This project specifically focuses on "Security by Design":
- ✅ Non-root Execution: The container runs with a non-privileged user (UID 1000).
- ✅ Vulnerability Scanning: Pipeline integration with Trivy to catch OS and library vulnerabilities early.
- ✅ Minimal Privileges: Explicitly disabling privilege escalation in the pod spec.
- A Kubernetes cluster (Minikube, Kind, or managed K8s).
kubectlconfigured to point to your cluster.
-
Create the Namespace:
kubectl create namespace platform-app
-
Apply the Manifests:
kubectl apply -f deployment.yaml kubectl apply -f service.yaml
-
Verify the Deployment:
kubectl get pods -n platform-app kubectl get svc -n platform-app
- Setting up a GitHub Actions workflow for Docker builds.
- Fixing Docker tag casing issues for GHCR compatibility.
- Hardening Docker images based on security scan results.
- Writing production-ready Kubernetes manifests.
Useful commands for monitoring the application:
- Check Logs:
kubectl logs -l app=platform-app -n platform-app - Check Events:
kubectl get events -n platform-app --sort-by='.lastTimestamp' - Check Health:
kubectl describe deployment platform-app -n platform-app
- Implement Helm charts for templated deployments.
- Add Prometheus/Grafana for monitoring.
- Integrate an Ingress Controller (Nginx/Traefik).
- Set up automated Canary deployments.
This project is for educational purposes.
Built with ❤️ for the DevOps learning journey.