Configure Helm

Update Helm repository

helm repo update

Install Helm Secrets plugin

helm plugin install https://github.com/jkroepke/helm-secrets --version v3.6.0

Install SOPS

Mozilla SOPS (Secrets OPerationS) is a tool required by Helm Secrets plugin to encrypt and decrypt the secrets stored in plain text yaml files. Binaries and packages of the latest stable release are available at https://github.com/mozilla/sops/releases

Ubuntu/Debian

sudo apt install ./sops_3.7.0_amd64.deb

RHEL/Centos

Using rpm

sudo rpm -i sops-3.7.0-1.x86_64.rpm

Using yum

sudo yum localinstall sops-3.7.0-1.x86_64.rpm

Mac

brew install sops

Darwin build is available from releases page https://github.com/mozilla/sops/releases/download/3.7.0/sops-3.7.0.darwin

Windows

Download latest release from releases https://github.com/mozilla/sops/releases/download/3.7.0/sops-3.7.0.exe. Add the file location to PATHenvironment variable

Copying the exe file to a folder already present in PATH environment variable also works.

Test Helm setup

You can run helm list to test access to K8s cluster but it might not yield any results and that's OK at this point. You MUST always check that you are operating Helm against the desired K8s cluster using kubectl config use-context context_name with corresponding context-name and verifying with kubectl config current-context.

Example

You have two K8s clusters, sandbox-k8s and production-k8s with a valid kubeconfig setup.

Shell commands to manage use-context can be aliased:

  • Using bash: paste these lines inside ~/.bash_aliases file (create the file if it does not exist) and restart/re-source the terminal:

  • Using Powershell: PS Functions are required in this example, type notepad $PROFILE in PowerShell and paste these lines:

You can now switch between clusters effortlessly using sandbox-k8s and production-k8s commands.

Last updated