From Kubernetes Fundamentals to Helm, Ingress, TLS & Autoscaling: My Capstone Journey
DEV Community

From Kubernetes Fundamentals to Helm, Ingress, TLS & Autoscaling: My Capstone Journey

Over the past few months, I have been building a Kubernetes learning project around a Flask application backed by PostgreSQL.

The goal was not simply to deploy an application and stop when the Pods became Running. I wanted to understand what happens when configuration is wrong, when a dependency becomes unavailable, when a deployment upgrade fails, when traffic routing breaks, and when Kubernetes has to reconcile a workload back to a healthy state.

This post documents the project, the October engineering work, what I verified, what I deliberately did not claim, and what remains outside the scope of this local learning environment.

Project status: This is a local Kubernetes learning/demo project built and tested using kind. It is not production-deployed.

Project repository GitHub: k8s-flask-devops-capstone

The repository contains the application deployment configuration, Helm chart, documentation, architecture diagram, troubleshooting records, rendered manifests, and reproduction notes.

What I Was Building

The application consists of:

  • A Flask application
  • PostgreSQL
  • Kubernetes Deployments and Services
  • ConfigMaps and Secrets for configuration
  • Startup, readiness, and liveness probes
  • PersistentVolumeClaims for PostgreSQL storage
  • Helm for deployment and lifecycle management
  • Separate Dev and Prod namespaces
  • Traefik Ingress for HTTP/HTTPS routing
  • TLS configuration
  • Metrics Server and a Dev HorizontalPodAutoscaler
  • Controlled failure experiments and troubleshooting

The focus was on understanding the system as a collection of interacting components - not treating Kubernetes as a collection of commands to memorize.

Architecture

The application runs in a local kind cluster with two namespaces: dev and prod.

Test Client
  |
  v
Traefik Ingress HTTP / HTTPS
  |
  +--------------+--------------+
  |                             |
  v                             v
DEV NAMESPACE               PROD NAMESPACE
  |                             |
Ingress                     Ingress
  |                             |
  v                             v
flask-app-svc               flask-app-svc
(ClusterIP)                 (ClusterIP)
  |                             |
  v                             v
Flask Deployment            Flask Deployment
HPA-managed: 1-3            Fixed: 3 replicas
  |                             |
  v                             v
postgres-svc                postgres-svc
  |                             |
  v                             v
PostgreSQL                  PostgreSQL
1 replica                   1 replica
  |                             |
  v                             v
postgres-pvc                postgres-pvc

The Flask application connects to PostgreSQL through Kubernetes Service DNS. The database is not exposed through the application Ingress.

The namespaces have their own application and database resources, configuration, Services, Ingresses, and PVCs. This provides environment separation for the learning exercise, but namespace separation alone is not a complete production security boundary.

Why I Spent Time on Troubleshooting

A successful deployment is only one state of a Kubernetes system. During the project, I intentionally introduced controlled faults and then investigated the actual state before making corrections.

The exercises included configuration errors, Service and routing problems, dependency failures, health-check issues, Helm lifecycle failures, Ingress/TLS problems, and autoscaler configuration errors.

The approach I tried to follow was:

  1. Observe the symptoms.
  2. Check the relevant Kubernetes resources, events, logs, endpoints, or configuration.
  3. Identify the likely failure boundary.
  4. Change only the component responsible for the failure.
  5. Verify recovery.
  6. Record the evidence and limitation.

This was more useful to me than simply deleting resources and recreating everything whenever something went wrong.

Examples documented in the project include:

  • Incorrect Helm template values
  • Service selector and backend-routing issues
  • PostgreSQL dependency and application configuration failures
  • Readiness/liveness endpoint and probe behavior
  • Ingress host, path, and backend-port failures
  • Traefik controller availability
  • TLS Secret-reference failures
  • Helm upgrade, adoption, and rollback scenarios

The chronological debugging records are available in the repository.

Moving Deployment Management to Helm

One of the main October goals was to move from managing resources individually to managing the application through a Helm chart. The chart uses shared templates and environment-specific values. The Dev and Prod releases have separate configuration, while the templates remain reusable.

The work included:

  • Chart structure and metadata
  • Values and environment-specific overrides
  • Template helpers
  • Rendering and linting
  • Helm-managed deployment resources
  • Adoption of existing resources into Helm management
  • Upgrade and rollback exercises
  • Checking the rendered manifests against the intended configuration
  • Verifying storage-preservation boundaries during lifecycle operations

The documented release state is:

Environment Namespace Release Chart version Application configuration
Dev dev flask-dev 0.4.0 HPA-managed Flask workload, 1-3 replicas
Prod prod flask-prod 0.3.0 Fixed Flask replica count of 3; no HPA

These versions represent the repository's recorded release state. They should not be interpreted as a claim that both environments were running the same chart version.

What Helm Helped Me Understand

Helm is more than a way to shorten YAML. I had to understand how chart values influence rendered manifests, how a release tracks resources, what happens when existing resources are adopted, and how an upgrade or rollback affects the state of the application.

I also learned to distinguish between:

  • A valid chart
  • A successfully rendered manifest
  • A successful Helm operation
  • A healthy workload after the operation

Those are related, but they are not interchangeable checks.

Keeping Dev and Prod Intentionally Different

I did not configure both environments identically.

Dev:

  • Flask Deployment controlled by HPA
  • Minimum replicas: 1
  • Maximum replicas: 3
  • CPU utilization target: 70%
  • Flask CPU request: 25m
  • Flask CPU limit: 75m
  • Flask memory request: 32Mi
  • Flask memory limit: 64Mi

Prod (project demonstration environment):

  • Flask Deployment fixed at 3 replicas
  • No HPA configured
  • Flask CPU request: 50m
  • Flask CPU limit: 150m
  • Flask memory request: 64Mi
  • Flask memory limit: 128Mi

Both environments have a single PostgreSQL replica with a PVC-backed data directory.

These resource values are configuration baselines for this learning environment. They are not production tuning results or capacity recommendations.

Ingress and TLS With Traefik

I added Traefik Ingress routing to access the application through configured hostnames. The documented hosts are:

  • Dev: dev.flask.k8s-capstone.local
  • Prod: flask.k8s-capstone.local

The project exercised host-based routing, path-based routing, backend Service routing, and TLS configuration using Kubernetes TLS Secrets.

I also performed controlled failure exercises involving:

  • An incorrect host
  • An incorrect path
  • An incorrect backend port
  • The Ingress controller being unavailable
  • An invalid TLS Secret reference

Each failure was restored and the recovery behavior was checked.

These tests demonstrate routing and TLS behavior in the local environment. They do not establish public Internet exposure, production edge security, automated certificate renewal, or production certificate lifecycle management.

Health Checks and Application Dependencies

The project uses startup, readiness, and liveness probes.

  • Startup probe: protects the application during initialization.
  • Readiness probe: determines whether the application should receive normal Service traffic. The configured /health check includes the documented dependency-aware health behavior.
  • Liveness probe: uses / to check the application's process-health endpoint.

I explored how probe configuration affects the workload and how endpoint failures appear in Kubernetes.

An important operational distinction is that readiness and liveness solve different problems. A dependency-related readiness failure should not automatically be treated as a reason to restart the application process.

The probe configuration is available in the repository's manifests and Helm templates.

Storage and Preservation Checks

PostgreSQL uses a PersistentVolumeClaim named postgres-pvc in each namespace. The local cluster uses its configured local storage provisioning.

During Helm lifecycle and controlled operations, I checked that the PVCs remained bound and that the recorded volume identities were preserved.

This was an important verification point: a successful Helm operation is not enough if it unexpectedly affects persistent data.

However, PVC-backed storage is not a backup strategy. This project does not demonstrate production-durable storage, a tested disaster-recovery plan, or a verified backup-and-restore workflow.

Horizontal Pod Autoscaling (HPA)

The Dev environment uses a Helm-managed autoscaling/v2 HorizontalPodAutoscaler targeting the Flask Deployment.

Setting Value
Minimum replicas 1
Maximum replicas 3
CPU target 70%
Flask CPU request 25m

Metrics Server was a prerequisite for CPU-based autoscaling. The project checked the metrics API and resource metrics before configuring the HPA.

The chart was updated so that:

  • HPA is disabled by default.
  • Dev values enable HPA.
  • Prod values disable HPA.
  • When HPA is enabled, the Deployment template does not set a competing fixed replica count.
  • The HPA targets the Flask Deployment.

Important Timeline Clarification

The HPA configuration was integrated into the Helm chart during October. The controlled load validation described below was executed on 28 November 2026. It is not being presented as an October 15 test.

Controlled HPA Validation - 28 November 2026

The recorded test observed:

  • Dev began at one Flask replica with CPU below the configured target.
  • Bounded load was applied to the application's /health endpoint.
  • CPU utilization increased above the target.
  • HPA initiated scale-up.
  • Three Flask replicas became Ready.
  • The load generator was removed.
  • CPU utilization reduced.
  • The workload eventually returned to one replica.
  • A temporary incorrect HPA target reference was introduced and then restored.
  • Helm release alignment and the final state were verified.

What the evidence supports: scale-up from 1 to 3 Ready replicas and the eventual return to 1 after load removal.

What I am not claiming: the exact natural intermediate 3 → 2 → 1 transition was not established by the supplied evidence.

The test was controlled and bounded. Production remained unchanged, the load generator was removed, and the final state was checked.

Security Decisions and Limitations

I audited the application ServiceAccount and its API-access requirements. The Flask application uses a dedicated ServiceAccount, flask-app-sa, and the documented configuration disables automatic ServiceAccount token mounting:

automountServiceAccountToken: false

No application-specific Roles or RoleBindings were required for the application's core functionality during the audit. The conclusion was to avoid granting unnecessary Kubernetes API permissions.

NetworkPolicy work was deferred because enforcement by the active kindnet CNI was not verified. I do not describe NetworkPolicy as effective isolation in this project.

Other security-related limitations include:

  • Kubernetes Secrets are used, but an external secrets-management system is not implemented.
  • Base64 is not encryption.
  • Image signing and provenance are not established.
  • NetworkPolicy enforcement remains unverified.
  • Local namespace separation is not a full production security architecture.

What I Verified - and What I Did Not

I tried to keep the project documentation evidence-based rather than treating configuration as proof of behavior.

Verified within the recorded local environment:

  • Flask and PostgreSQL workload deployment
  • Internal Service discovery and application/database connectivity
  • Probe behavior and controlled failure exercises
  • Helm chart linting and rendering
  • Dev and Prod Helm release configuration
  • Helm upgrade/adoption/rollback exercises
  • PVC preservation checks
  • Traefik host/path/backend routing and TLS exercises
  • Metrics Server prerequisite checks
  • Dev HPA configuration
  • Controlled HPA scale-up to three Ready replicas and eventual return to one
  • HPA target-reference failure and recovery
  • Final cleanup and post-test state checks

Not established:

  • Production deployment or production readiness
  • Database high availability
  • Tested backup and restore
  • Disaster recovery
  • Production-durable storage
  • External secrets management
  • Verified NetworkPolicy enforcement
  • Production capacity or performance
  • Image signing or supply-chain provenance
  • Public Internet ingress and production TLS lifecycle
  • The exact natural HPA intermediate 3 → 2 → 1 sequence

Being clear about these boundaries is part of documenting infrastructure responsibly.

Reproducibility and Repository Documentation

The GitHub repository contains the project documentation and recorded evidence, including:

  • Main README and architecture diagram
  • October debugging log
  • Helm chart documentation
  • Kubernetes troubleshooting guide
  • Reproduction instructions
  • Rendered Dev and Prod manifests
  • Production-readiness review
  • October evidence records

Repository: View the complete project on GitHub

The reproduction instructions should be followed for prerequisites, local Secret creation, setup, verification, and cleanup. Existing cluster state should not be assumed to be a fresh-install procedure.

Lessons I Am Taking Forward

A few things stood out during this project:

  1. Running is not the same as healthy. A Pod's phase alone does not tell the whole story. Readiness, events, logs, endpoints, and application behavior matter.
  2. Configuration is not evidence of behavior. A manifest can describe the intended state. Testing is needed to understand what the system actually does.
  3. Troubleshooting should be deliberate. I found it more useful to identify the failure boundary and make a targeted change than to repeatedly delete and recreate resources.
  4. Lifecycle operations deserve data checks. Upgrades and rollbacks should be evaluated alongside persistent-resource state, not only command success.
  5. Dev and Prod should have explicit differences. The two environments were intentionally configured differently, and those differences were documented.
  6. Limitations belong in the documentatio
Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.