https://rancher.com/ logo
Title
a

average-night-25048

12/12/2022, 4:49 PM
Hi Team, im pretty new with helm and k3s, I'm using jenkins pipeline to handle the deployment to 3 of my servers (dev, test, prod) based in some conditions inside the pipeline, i was making this with docker using its exposed api from each server, now im trying to do this with helm, install the chart in one of those servers, based on the same condition in my pipeline, is there any way to achieve this? hope i made myself clear 😅
w

worried-helmet-59461

12/12/2022, 7:39 PM
With helm you could create a different values.yaml file for each environment. We have used values.dev.yaml for instance and then based on the condition in our CICD pipeline we pass it the correct values file with the -f flag
create a base values.yaml with what stays the same in all environments then just put in the things that change in each like the ingress hosts for example or the number of replicas. You can pass more than one values file using multiple -f flags
the one that comes second replaces just the pieces that overlap
a

average-night-25048

12/12/2022, 7:41 PM
But that will install the chart in the server where I run that command right? 🤔
w

worried-helmet-59461

12/12/2022, 7:41 PM
It will install the chart on the kubernetes cluster based on the context you have set
helm install --kube-context ~/.kube/dev.yaml -f values.dev.yaml
👍 1
You can also change context with a flag to point it at a different set of servers you want to install on
👀 1
a

average-night-25048

12/12/2022, 7:44 PM
Okay, I'll read more about contexts looks better approach than use ssh-pipeline-steps in my Jenkins pipeline. Thanks for the reply