How harisekhon/kubernetes-configs works
Project Type and Purpose
• This is not an application codebase but a Kubernetes configuration repository (“Kubernetes-configs”).
• It provides:
• Top-level YAML templates for Deployments, StatefulSets, Services, Ingress, HPA, PVC/PV, RBAC, etc.
• “Real-world” app directories following a Kustomize base/overlay pattern for ArgoCD, Jenkins, TeamCity, Selenium Grid, Traefik, Kong, cert-manager, monitoring (Prometheus), security scanners (Clair, Trivy), external-DNS, MetalLB, etc.
• CI/CD workflows (GitHub Actions, Travis, GitLab CI, Azure DevOps, Buildkite) for linting, validation, security scanning and GitOps deployment.
High-Level Architecture Components
a. Git Repository (GitHub/GitLab/Azure DevOps/Bitbucket)
• Contains all YAMLs, kustomization.yaml, overlays, Helm repo lists and helper scripts (install_repos.sh).
• Triggers CI/CD workflows on push/PR.
b. CI/CD Pipelines
• GitHub Actions / Travis / Buildkite etc.
• Steps: YAML/JSON/Markdown validation → Static analysis (Semgrep, Checkov, Kics, Polaris) → Container scan (Trivy, Grype) → Kustomize build dry-run.
c. Kustomize + Helm Integration
• “base/” directories hold core manifests.
• “overlay/” directories hold environment-specific patches (ingress hostnames, resource limits, secrets references).
• kustomization.yaml at root orchestrates templating of base and overlay, with optional HelmChart loader.
d. GitOps Controller (ArgoCD, optionally FluxCD)
• Watches Git repo, compares desired state (manifests) to cluster state.
• Automatically applies changes to cluster.
e. Kubernetes Cluster
• Control plane (API Server, etcd, Scheduler, Controllers).
• Multiple Namespaces, one per app (argocd, jenkins, teamcity, selenium-grid, traefik, kong, cert-manager, external-dns, monitoring, security-tools).
• Core add-ons: CoreDNS, Ingress Controller (NGINX/Traefik/Kong), RBAC, Network Policies, StorageClasses, MetalLB (on-prem), External-DNS.
f. External Services and Integrations
• Container Image Registries (DockerHub, GCR, ECR, private Harbor).
• Secret backends (External-Secrets: AWS Secrets Manager, GCP Secret Manager, Azure Key Vault).
• Helm Repositories (stable, bitnami, fairwinds-stable).
• Cloud load balancers, DNS providers, Object Storage for persistent volume provisioning.
• Monitoring & Alerting (Prometheus-stack, Grafana).
• CI servers & artifact stores (Jenkins, TeamCity, SonarQube).
Relationships and Data-Flow
• Developer pushes YAML to Git ⇒ CI/CD pipeline runs linters and security scans ⇒ on success, commit merged to main.
• GitOps controller (ArgoCD) detects new commit ⇒ Builds manifests via Kustomize/Helm ⇒ Applies them to Kubernetes API.
• Kubernetes Scheduler launches Pods in appropriate namespaces.
• Ingress/Service exposes applications externally via LB or MetalLB.
• External-DNS updates DNS records automatically.
• Cert-manager provisions TLS certificates from Let’s Encrypt or other issuers.
• Monitoring & Logging collect metrics/events for all namespaces.
Architectural Patterns and Principles
• GitOps: declarative cluster management with ArgoCD/FluxCD.
• Modular Kustomize layering: “base” (common) + “overlay” (env-specific).
• Infrastructure as Code: all resources versioned.
• Continuous Security: pipeline includes static analysis and container scanning.
• Multi-tenancy via Namespaces and RBAC.
• Extensibility: each app directory is a self-contained Kustomize package.
Key Technologies & Frameworks
• Kubernetes (YAML manifests)
• Kustomize (overlayed configuration)
• Helm (optional templating)
• ArgoCD / FluxCD (GitOps)
• GitHub Actions / Travis / Buildkite (CI/CD)
• Semgrep, Checkov, KICS, Polaris (policy as code)
• Trivy, Grype, Clair (container scanning)
• cert-manager (TLS certificates)
• External-DNS, MetalLB (DNS & Load Balancing in Kubernetes)
• Prometheus-stack, Grafana (monitoring)
• Secret Store Integrations (AWS, Azure, GCP)