The 12-Factor App methodology is still relevant. Published in 2012 for Heroku-style PaaS platforms, it laid out solid principles for building apps that scale. But Kubernetes changed the game. When I work with teams adopting Kubernetes, I often see them apply 12-factor thinking directly, then hit unexpected walls. The factors still hold, but they need reinterpretation for a container-native world.
Config: environment variables to Kubernetes Secrets
Factor III (Config in the environment) maps naturally to Kubernetes: ConfigMaps and Secrets expose configuration as environment variables or mounted files. The Kubernetes-specific discipline: separate configuration concerns into ConfigMaps (non-sensitive) and Secrets (sensitive), use environment-specific Helm values files for different deployment targets, and avoid hardcoding environment-specific values in container images.
Logs: structured logging to stdout
Factor XI (Treat logs as event streams) aligns with Kubernetes logging: applications write to stdout, the kubelet captures stdout/stderr, and the logging infrastructure (Fluentd, Fluent Bit) ships logs to a centralised store. The Kubernetes-specific addition: structured logging (JSON) enables the log shipper to parse and index fields without regex configuration. Serilog (for .NET), Logrus and Zap (for Go), and Winston (for Node.js) provide structured logging.
Processes: stateless with external state
Factor VI (Execute the app as one or more stateless processes) is the Kubernetes readiness gate: stateless services are deployable, scalable, and restartable without data loss. The Kubernetes-specific check: no local filesystem writes for persistent data (write to PersistentVolumes, object storage, or databases instead), no in-memory session state (use Redis or database-backed sessions), and no affinity requirements that prevent pods from running on any available node.
Disposability: fast startup and graceful shutdown
Factor IX (Maximise robustness with fast startup and graceful shutdown) is a Kubernetes operational requirement: slow startup increases deployment time; improper shutdown loses in-flight requests. The Kubernetes mechanisms: readiness probes gate traffic until the application is ready, preStop hooks provide cleanup time before SIGTERM, and terminationGracePeriodSeconds sets the maximum shutdown time. Applications must handle SIGTERM by stopping request acceptance and finishing in-flight work.