Sitemap
Geek Culture

A new tech publication by Start it up (https://medium.com/swlh).

Convert Kubernetes YAML Files Into Helm Charts

3 min readNov 28, 2022

--

Helm Charts

YAML

Helmify

Helmify

Install Helmify

brew install helmify

Create Sample YAML deployment file

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80

Convert YAML file to Helm

cat web.yaml | helmify nginx-server

From directory with yamls:

awk 'FNR==1 && NR!=1  {print "---"}{print}' /<my_directory>/*.yaml | helmify mychart
Example 1: 'kustomize build <kustomize_dir> | helmify mychart' 
- will create 'mychart' directory with Helm chart from kustomize output.
Example 2: 'cat my-app.yaml | helmify mychart'
- will create 'mychart' directory with Helm chart from yaml file.
Example 3: 'helmify -f ./test_data/dir mychart'
- will scan directory ./test_data/dir for files with k8s manifests and create 'mychart' directory with Helm chart.
Example 4: 'helmify -f ./test_data/dir -r mychart'
- will scan directory ./test_data/dir recursively and create 'mychart' directory with Helm chart.
Example 5: 'helmify -f ./test_data/dir -f ./test_data/sample-app.yaml -f ./test_data/dir/another_dir mychart'
- will scan provided multiple files and directories and create 'mychart' directory with Helm chart.
Example 6: 'awk 'FNR==1 && NR!=1 {print "---"}{print}' /my_directory/*.yaml | helmify mychart'
- will create 'mychart' directory with Helm chart from all yaml files in my_directory directory.

Conclusion

--

--

Vinodha kumara
Vinodha kumara

Written by Vinodha kumara

DevSecOps, MLOps, Cloud Computing, DE, ML, DL, Programmer, Blogger, Volunteer

No responses yet