Exposing Octopus variables to a Kubernetes container
Blog post from Octopus Deploy
Kubernetes 1.16 introduced a feature that allows all values from a config map or secret to be exposed as environment variables in a pod, simplifying the process of externalizing configuration values. This blog post by Matthew Casperson explores how Octopus 2020.5 leverages this feature through the Deploy Kubernetes containers step, enabling groups of Octopus variables to be efficiently mapped to a container without manual mapping. By using custom resources, which are created with raw YAML and Octopus templates, users can define environment variables in a streamlined manner, ensuring they are treated as immutable to support advanced deployment strategies like rolling or blue/green deployments. The process involves creating a secret with a unique name for each deployment, allowing for seamless side-by-side operation of old and new deployments. This method addresses the challenge of managing numerous environment variables and aims to enhance the deployment of Kubernetes applications by offering a robust and convenient solution.