New to helm! Is it possible to get into the chart which has been pulled from the stable repo?

3/3/2020

Is it possible to get into the chart which has been pulled from the bitnami or stable repo? and what are the requirements if want to write my own chart.yml and deploy that into kubernetes pod, and what would be the command.

If I type the command helm install bitnami/tomcat, helm deploys a service right! so in the background there has to be a chart.yml which supports this execution, so is it possible to edit that chart.yml?

Please help me out!

-- hemanth43
kubernetes
kubernetes-helm

2 Answers

3/3/2020

We can't modify public repositories from other companies for obvious reasons.

But you can download, modify and apply it!

Using your bitnami/tomcat as example.

  • On Helm 2 you can use fetch:
$ helm version
Client: &version.Version{SemVer:"v2.16.1", GitCommit:"bbdfe5e7803a12bbdf97e94cd847859890cf4050", GitTreeState:"clean"}

$ helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories

$ helm fetch bitnami/tomcat

ls
tomcat-6.2.4.tgz
  • If you are running Helm 3 the fetch was replaced by pull:
$ helm version
version.BuildInfo{Version:"v3.0.2", GitCommit:"19e47ee3283ae98139d98460de796c1be1e3975f", GitTreeState:"clean", GoVersion:"go1.13.5"}

$ helm repo add bitnami https://charts.bitnami.com/bitnami 
"bitnami" has been added to your repositories

$ helm pull bitnami/tomcat                                

$ ls
tomcat-6.2.4.tgz
  • It will download a tgz of the chart, just unpack it, modify what you want carefully and then you can apply it locally pointing to the folder where it was unpacked:
$ tar -xvzf tomcat-6.2.4.tgz 
tomcat/Chart.yaml
tomcat/values.yaml
tomcat/templates/NOTES.txt
tomcat/templates/_helpers.tpl
tomcat/templates/deployment.yaml
tomcat/templates/ingress.yaml
tomcat/templates/pvc.yaml
tomcat/templates/secrets.yaml
tomcat/templates/svc.yaml
tomcat/.helmignore
tomcat/README.md
tomcat/ci/values-with-ingress-and-initcontainers.yaml

$ ls
tomcat  tomcat-6.2.4.tgz

$ cd tomcat 

$ ls
Chart.yaml  ci  README.md  templates  values.yaml

$ head Chart.yaml 
apiVersion: v1
appVersion: 9.0.31
description: Chart for Apache Tomcat
home: http://tomcat.apache.org
icon: https://bitnami.com/assets/stacks/tomcat/img/tomcat-stack-110x117.png
keywords:
- tomcat
- java
- http
- web

$ helm install . --generate-name
NAME: chart-1583237097
LAST DEPLOYED: Tue Mar  3 13:04:58 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
** Please be patient while the chart is being deployed **
...
$ helm3 list
NAME                    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
chart-1583237097        default         1               2020-03-03 13:04:58.617410239 +0100 CET deployed        tomcat-6.2.4    9.0.31     
  • I didn't changed anything but as you could see the chart is open for you to modify as you like.

  • You can even create a private repository for your custom charts, learn more here: The Chart Repository Guide

-- willrof
Source: StackOverflow

3/3/2020

Below are the default path to find the data pulled from a repo (for Helm 3) :

  • Linux $HOME/.cache/helm
  • Mac OS $HOME/Library/Caches/helm
  • Windows %TEMP%\helm

You can find out more in the documentation

Also, if you're new to Helm 3, i've written a simple workshop to get started. You can find it here

-- Marc ABOUCHACRA
Source: StackOverflow