Interview Prep/Python for DevOps/Testing, CI/CD, packaging & services

A tool must read secrets at runtime in both GitHub Actions and EKS. How do you design secret loading?

IntermediateScenarioTesting, CI/CD, packaging & services
Answer

Situation read → Same code, different environments.

What I'd do →

  1. The code reads configuration from environment variables only (pydantic-settings model).
  2. In GitHub Actions, secrets come from OIDC + Secrets Manager (aws secretsmanager get-secret-value or the official action) into env vars, masked.
  3. In EKS, External Secrets Operator syncs Secrets Manager into a Kubernetes Secret mounted as env.
  4. The tool never knows where the secret came from.

Why → Environment-agnostic code with platform-specific injection keeps the tool simple and testable.

Interview tip → "Twelve-factor config" is the reference to make.

All Python for DevOps questions Roadmap: Python for automation

More on Testing, CI/CD, packaging & services