Creating Local helm Repository
# test deploying Chart Museum from the custom repository | |
# offical repository for chartmuseum is | |
# https://artifacthub.io/packages/helm/chartmuseum/chartmuseum | |
helm repo add chartmuseum https://chartmuseum.github.io/charts | |
helm install chartmuseum chartmuseum/chartmuseum --dry-run --debug | |
# deploy Chart Museum | |
helm install chartmuseum chartmuseum/chartmuseum --set env.open.DISABLE_API=false | |
# Ref - helm install my-chartmuseum chartmuseum/chartmuseum --version 3.10.1 | |
# view release | |
helm list | |
# view Chart Museum pod ans its labels | |
kubectl get pods --show-labels | |
# grab the Chart Museum pod name using the label retrieved from the previous command | |
# Powershell | |
$POD_NAME=$(kubectl get pods -l "app.kubernetes.io/name=chartmuseum" -o jsonpath="{.items[0].metadata.name}") | |
#Linux | |
POD_NAME=$(kubectl get pods -l "app.kubernetes.io/name=chartmuseum" -o jsonpath="{.items[0].metadata.name}") | |
echo $POD_NAME | |
# set up port forwarding | |
# this would be accessible only by 127.0.0.1 | |
kubectl port-forward $POD_NAME 8080:8080 --namespace default | |
# this would be accessible by NodeIP of the host where u ran a command | |
kubectl port-forward --address 0.0.0.0 $POD_NAME 8080:8080 --namespace default | |
# confirm Chart Museum is up and running | |
# http://127.0.0.1:8080 | |
# view Helm help to get location of Helm Configuration Path | |
helm --help | |
# navigate to folder containing repository names and URLs, e.g. - | |
# C:\Users\apruski\AppData\Roaming\helm\ | |
# add Chart Museum as a Helm repository | |
helm repo add chartmuseum http://127.0.0.1:8080 | |
# list repositories | |
helm repo list | |
# view updated repositories.yaml file | |
# C:\Users\apruski\AppData\Roaming\helm\ | |
# naviage to packaged Chart | |
cd C:\Charts | |
# confirm curl | |
curl --help | |
# if using powershell v5.1 you'll need to remove | |
# the alias that maps curl to Invoke-WebRequest | |
Remove-Item alias:\curl | |
# push chart to Chart Museum | |
# a place where u have ourchart-0.1.0.tgz | |
cd /home/ubuntu/charts | |
curl --data-binary "@ourchart-0.1.0.tgz" http://localhost:8080/api/charts | |
# search for the chart | |
helm search repo chartmuseum/ourchart | |
# view helm help again to get Helm Cache Path | |
helm --help | |
# view cached chartmuseum-index.yaml file for repository | |
# C:\Users\apruski\AppData\Local\Temp\helm\repository | |
# update Helm repositories | |
helm repo update | |
# view updated chartmuseum-index.yaml file for repository | |
# C:\Users\apruski\AppData\Local\Temp\helm\repository | |
# search Chart Museum for our chart | |
helm search repo chartmuseum/ourchart | |
# we can also see the chart in the Helm section of | |
# of the Kubernetes extension for vs code | |
# deploy the chart from Chart Museum | |
helm install ourchart chartmuseum/ourchart | |
# view release | |
helm list |
################################################## | |
# go to Github and create a repository | |
################################################## | |
# clone repository locally | |
git clone https://github.com/dbafromthecold/DemoHelmRepo.git | |
# navigate to repo | |
cd C:\git\DemoHelmRepo | |
# copy packaged chart into repo | |
cp C:\charts\ourchart-0.1.0.tgz . | |
# index repo | |
helm repo index . | |
# view index.yaml | |
cat index.yaml | |
# push chart to Github | |
git config user.name "Rajesh Kumar" | |
git congig user.email "devops@rajeshkumar.xyz" | |
git add . | |
git commit -m "added ourchart to repo" | |
git push | |
################################################## | |
# get URL from index.yaml file in GitHub repository | |
################################################## | |
# add Githb repo as a Helm repository | |
helm repo add dbafromthecold https://raw.githubusercontent.com/dbafromthecold/DemoHelmRepo/master | |
helm repo add rajesh https://raw.githubusercontent.com/devopsschool-demo-temporary/demp4helm/main | |
# navigate to folder containing repository names and URLs | |
# C:\Users\apruski\AppData\Roaming\helm\ | |
helm env | |
cd /root/.config/helm | |
cd /root/.cache/helm | |
more repositories.yaml | |
cd repository/ | |
more rajesh-index.yaml | |
# view cached index.yaml file for repository | |
# C:\Users\apruski\AppData\Local\Temp\helm\repository | |
# search new Helm repository | |
helm search repo dbafromthecold/ourchart | |
# we can also see the chart in the Helm section of | |
# of the Kubernetes extension for vs code | |
# deploy chart from repository | |
helm install ourchart dbafromthecold/ourchart | |
# confirm deployment | |
helm list |
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND