MLOps the Hard Way (A Gray Matter Enlightening Kit)
MLOps the Hard Way is a series of very short articles that will cover multiple topics, tools, and strategies in dealing with challenges associated with the development, delivery, and operations of Machine Learning-based applications in the cloud.
Get your Helm ready
When working with Helm, most developers do not dive into the details of the chart being used unless it’s not working as expected.
The general workflow is something similar to this:
1) Identify the chart’s values.yaml documentations.
2) Identify what configuration items the chart have and which one you want to override/customize.
3) Create your own Helm values file mychartname.yml.
4) Add and update your desired chart to the local repository cache.
5) Apply/Install the desired chart with your desired values into your Kubernetes environment optionally in the desired namespace.
# helm repo add [NAME] [URL] [flags]
helm repo add mychartname https://chartrepository.apache.org
helm repo update mychartname
helm upgrade --install --create-namespace --values mychartname.yml --namespace mychartname-namespace <myreleasename> mychartname
When you use the “helm add” command to add a chart, the chart code is now stored on your local machine within the local repository cache directory. Depending on your operating system and configuration, this directory is your cache location:
| Operating System | Cache Path | Configuration Path | Data Path |
|------------------|---------------------------|--------------------------------|-------------------------|
| Linux | $HOME/.cache/helm | $HOME/.config/helm | $HOME/.local/share/helm |
| macOS | $HOME/Library/Caches/helm | $HOME/Library/Preferences/helm | $HOME/Library/helm |
| Windows | %TEMP%\helm | %APPDATA%\helm | %APPDATA%\helm |
If everything goes well, you already know where the charts are located, and there is no need to check their code. However, since things rarely go smoothly, you may find yourself reading and analyzing the chart’s code in the local repository cache. Even worse, sometimes you might catch your self modifying a chart code within the cache diretory.
To be on the safe side while trying to demystify the magic of a Helm chart, consider the following:
# helm repo add [NAME] [URL] [flags]
helm repo add mychartname https://chartrepository.apache.org
helm repo update mychartname
mkdir mychartname
cd mychartname
# Please use your dedicated cache repository path as it is OS dependent
helm template $HOME/Library/Caches/helm/repository/chartname-<chart-version>.tgz --output-dir .
# as you would now see helm template Render chart templates locally and display/--outüut-dir stores the output.
This way, you can use a copy of the chart code to conduct the analysis you wish and even make modifications if needed, without affecting the default vendor’s code.
# Got your helmet on? Great! Join the team – we're hiring!
print('career@lionswerk.de')
# Got Questions? Let's chat! Reach out to us for any queries or clarifications.
print('https://lionswerk.slack.com/')
# Need Help with your project?
# Get a 15-minute Free Consultancy to kickstart your journey.
print('projects@lionswerk.de')