This repository provides a comprehensive Kubernetes environment template designed for production deployments. It incorporates best practices for security, scalability, observability, and reliability, aligned with industry standards and DevOps principles.
Following the guidelines from the DevOps Signal Projects, this template includes:
- Namespace & Resource Quotas
- Network Policies
- Pod Security Standards
- TLS Ingress with Cert-Manager
- Autoscaling (HPA, VPA)
- Self-Healing Probes
- Observability integrations (Prometheus, Grafana, Loki, Tempo)
- Disaster Recovery configurations
- Isolated namespaces with resource limits
- Secure network segmentation
- Enforced security policies
- Automated TLS certificate provisioning
- Dynamic autoscaling
- Health checks and auto-healing
- Monitoring & alerting integrations
kubernetes-template/
├── apps/
│ └── sample-app/
│ ├── deployment.yaml
│ ├── service.yaml
│ ├── ingress.yaml
│ ├── hpa.yaml
│ └── kustomization.yaml
│
├── environments/
│ ├── dev/
│ │ └── kustomization.yaml
│ └── prod/
│ └── kustomization.yaml
│
├── security/
│ ├── rbac.yaml
│ └── network-policy.yaml
│
├── ci-cd/
│ └── github-actions.yaml
│
└── README.md
- Kubernetes 1.20+
- Helm 3
- Cert-Manager installed (Instructions)
- Prometheus & Grafana (Helm charts)
- Access to a cloud provider or local cluster
- Clone this repository:
git clone https://github.com/yourusername/prod-k8s-template.git
cd prod-k8s-template- Apply Namespace and Resource Quotas:
kubectl apply -f k8s/namespaces/production-namespace.yaml
kubectl apply -f k8s/namespaces/resource-quotas.yaml- Set up Pod Security Policies:
kubectl apply -f k8s/security/pod-security-policy.yaml- Configure Network Policies:
kubectl apply -f k8s/network/network-policy.yaml- Install Cert-Manager and apply ingress with TLS:
kubectl apply -f k8s/ingress/cert-manager-issuer.yaml
kubectl apply -f k8s/ingress/ingress.yaml- Deploy autoscaling:
kubectl apply -f k8s/autoscaling/hpa.yaml- Set up observability tools:
# Using Helm
helm install prometheus prometheus-community/kube-prometheus-stack -f k8s/observability/prometheus-values.yamlunzip kubernetes-template.zip
cd kubernetes-template
#🧪 Deploy Commands
Deploy DEV
kubectl apply -k environments/dev
Deploy PROD
kubectl apply -k environments/prod
✨ I’m Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin
🚀 Explore courses and resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated tutorials, real-world projects, and hands-on experience. Level up your tech game today! 💻✨
Zeba Academy is a learning platform dedicated to coding, technology, and development.
➡ Visit our main site: zeba.academy
➡ Explore hands-on courses and resources at: code.zeba.academy
➡ Check out our YouTube for more tutorials: zeba.academy
➡ Follow us on Instagram: zeba.academy
Thank you for visiting!