How cloudtechner/ct-k8s-canary-deployment works
Project type and purpose
• This is a minimal Python web application packaged in a Docker container and used as a sample for demonstrating canary deployment on Kubernetes.
• The README describes building and pushing the image, then running it on a Kubernetes cluster to test traffic splitting between stable and canary versions.
File structure
• Top-level:
• Dockerfile – builds the Python app image
• requirements.txt – Python dependencies
• README.md – project description and setup
• src/app.py – the application entry point (likely a small HTTP server)
• No frontend or database directories—this is purely a backend microservice for deployment testing.
Extract additional insights from the README
• The focus is on canary deployment, so we must show both “stable” and “canary” workloads running in parallel.
• The image is pushed to a private registry, so include the registry interaction.
a. Main components to include
• Developer / CI system
• Container Registry (private image repository)
• Kubernetes cluster
• Ingress or LoadBalancer
• Service for the app
• Two Deployments (stable and canary)
• Pods for each Deployment
• End users or test clients generating traffic
b. Relationships and interactions
• Developer/CI builds Docker image → pushes to Container Registry
• Kubernetes Deployment controller pulls images from the registry
• Ingress or LoadBalancer routes HTTP traffic to the Service
• The Service load-balances requests across pods in both the stable and canary Deployments according to configured weights
• Monitoring/alerting subsystem (optional) observes canary metrics and can trigger promotion or rollback
c. Architectural patterns and design principles
• Microservice containerization
• Canary release pattern (traffic splitting)
• Declarative infrastructure as code (Kubernetes manifests)
• Immutable deployments (new pods for each version)
d. Key technologies/frameworks
• Python (Flask, FastAPI, or built-in HTTP server)
• Docker
• Kubernetes (Deployments, Services, Ingress)
• Private container registry (e.g., ECR, GCR, Artifactory)
• CI/CD tool (e.g., Jenkins, GitLab CI, GitHub Actions)