Home / Companies / Octopus Deploy / Blog / Post Details
Content Deep Dive

Using variables for Kubernetes without breaking YAML

Blog post from Octopus Deploy

Post Details
Company
Date Published
Author
Robert Erez
Word Count
900
Language
English
Hacker News Points
-
Summary

Octopus Deploy's version 2023.2 introduces an enhanced structured variable replacement feature that simplifies the process of injecting Octopus-specific variables into Kubernetes YAML configurations. This update allows developers to use locally tested YAML files without needing to embed Octostache variable templates, thus maintaining clean configurations while enabling customization for different environments. By registering a Kubernetes cluster and creating a project with a "Deploy raw Kubernetes YAML" step, developers can deploy applications like a web server pod and service, adjusting variables such as text and ports according to the deployment environment. The structured variables feature uses a naming convention with colons to target specific values in the configuration, although it does have limitations, such as not supporting large structural code replacements or distinguishing between multiple YAML documents in the same file. This innovation aims to offer a flexible, lightweight method for configuration management, with future enhancements planned for richer configuration experiences using tools like kustomize.