Auto-Generated Helm Secrets

James Woodall
3 min readMay 15, 2020

Containers are awesome. I was dismissive at first (I shamefully admit) but now I’m all in. WorkfloPlus is now running on Kubernetes and everything we do now at Intoware is container-focused.

If you’re reading this, hopefully, you’ve successfully navigated the waters of Docker, realised the benefits of Kubernetes and made your life much easier with Helm!

However, some things just feel harder than they’re meant to be.

How do you auto-generate a secret once as part of an upgrade?

A Kubernetes secret is a resource that contains key/value pairs of data that you wish to be used by your code. These could be database connection strings, email passwords etc… By utilising secrets you create a clear separation between your code and your settings/secrets, allowing different deployments to be easily configurable, without changing the codebase.

A common use-case that we have come across is where 2 pods need to communicate with a shared “key”. Nothing outside the cluster needs to know this key as it is for pod-to-pod communication.

Creating Secrets

Normally, to create a secret in Helm you would:

  • Define the secret in your values file
  • Override it as part of your deployment

--

--

James Woodall
James Woodall

Written by James Woodall

James has been working in software development for several years and loves programming for web and wearable devices.