Can Helm chart copy the manifest from another Helm Chart? - kubernetes-helm

I have question regarding the Helm Chart. I'm curious whether this scenario can be implemented. I have Helm Chart #1 which holds deployment resource. The Helm Chart #2 should copy the manifest file (like a template) from Helm Chart #1, and modify some values (such as label) dynamically.
Can this be achieved?

You can create Helm Template and override the values using -f values.yaml!

Related

Build Helm chart with custom app version for Sub Charts

For a regular helm-chart I can use helm package --app-version="foo-bar" to be able to overwrite app-version while packing the helm chart.
Is there a way to achieve the same with sub-charts.
Consider the following helm-chart structure
uber-chart
\sub-chart-1
\sub-chart-2
\sub-chart-3
Is it possible to pass different app-versions to different sub-charts while packaging uber-chart?

Is There a Way to Detect Changes made to Resources Deployed by a Helm Chart

We have several resources deployed as part of a helm (v3) chart. Some time ago, I made changes to resources deployed by that helm chart manually, via kubectl. This caused some drift between the values in the yaml resources deployed by the helm release (as show by helm get values <release>) and what is actually deployed in the cluster
Example: kubectl describe deployment <deployment> shows an updated image that was manually applied via a kubectl re-apply. Whereas helm show values <release> shows the original image used by helm for said deployment.
I realize that I should have performed a helm upgrade with a modified values.yaml file to execute the image change, but I am wondering if there is a way for me to sync the state of the values I manually updated with the values in the helm release. The goal is to create a new default values.yaml that reflect the current state of the cluster resources.
Thanks!
This is a community wiki answer posted for better visibility. Feel free to expand it.
According to the Helm issue 2730 this feature will not be added in the Helm, as it is outside of the scope of the project.
It looks like there is no existing tool right from the Helm, that would help to port/adapt the life kubernetes resource back into existing or new helm charts/releases.
Based on this, you can use one of the following options:
As suggested by #David Maze. The Helm Diff Plugin will show you the difference between the chart output and the cluster, but then you need to manually update values.yaml and templates.
The helm-adopt plugin is a helm plugin to adopt existing k8s resources into a new generated helm chart.

How to edit the Configurations of a Helm Chart?

Hi everyone,
I have deployed a Kubernetes cluster based on kubeadm and for the purpose of performing HorizontalPodAutoscaling based on the Custom Metrics, I have deployed prometheus-adpater through Helm.
Now, i want to edit the configuration for prometheus-adpater and because i am new to Helm, i don't know how to do this. So could you guid me how to edit the deployed helm charts?
I guess helm upgrade is that are you looking for.
This command upgrades a release to a specified version of a chart and/or updates chart values.
So if you have deployed prometheus-adapter, you can use command helm fetch
Download a chart from a repository and (optionally) unpack it in local directory
You will have all yamls, you can edit them and upgrade your current deployed chart via helm upgrade
I found an example, which should explain it to you more precisely.
You're trying to customize an installed chart. Please use this guide Customizing the Chart Before Installing.
The key parts:
There are two ways to pass configuration data during install:
--values (or -f): Specify a YAML file with overrides. This can be specified multiple times and the rightmost file will take precedence
--set name=value: Specify overrides on the command line
There are a couple more ways to customize a Helm Chart values:
You may create a file with defined config and then helm install my-app [chart] -f /path/to/myconfig.yaml
As an example for a config file, please refer, for example, to redis one.
The second one is to check for the files the helm repo add or helm repo update create. You may check with helm env the variable HELM_REPOSITORY_CACHE that shows where those files are.
Untar the chart and look for the values config file or even go to the Kubernetes manifests /templates for a more in-depth customization. Then, install the chart.

How made umbrella chart update existing helm deployment

I have a umbrella chart and I want to know if it's possible to update an existing helm deployment through my requirements.yaml in my umbrella chart.
Not directly. If you did some kind of funky CRD with one of the existing Helm operators then maybe, but overall releases don't know about each other.

How do I upgrade a helm chart with a new values.yaml and keep the previous deployments data?

I deployed a helm chart using config-v1.yaml. I added some data to my helm chart app via an api exposed in the helm chart
I want to deploy/update the current chart with values from config-v2.yaml because there is a feature I want to expose.
When I use helm upgrade -f config-v2.yaml my-chart stable/chart. The previous helm version is blown away meaning the data I added with the API is gone. So I figure I need to add a volume to my container.
When I add a PersistentVolume and PersistentVolumeClaim, the app fails to update with values from config-v2.yaml which means I don't get the new features I want.
What is the proper way to do these types of updates to helm charts?
To upgrade, use '--reuse-values' flag as you are providing extra customization to the existing values.
In your case, you can use
helm upgrade --reuse-values -f config-v2.yaml my-chart stable/chart
Please refer the docs.
Use the '--version' flag to set your version. Look up current version first via 'helm list -A' and set it. This issue caught me as well.