Helm is a package manager for Kubernetes. Helm uses a package format called Chart.A Chart can consist of several files. Helm package is a versioned archive of a set of Charts that describe Kubernets resources. In Enterprise world we need to maintain our charts in our own private repository to deploy the application in kubernetes.
In this post we will see how to create our Helm Chart repository using an Apache web server.
Requirements :
1.Apache web server
2.Helm
3.Running Kubernetes cluster
Step 1:
Install Apache webserver, enable SSL and basic authentication,
Use this below link to do this step.
https://www.devopsart.com/2020/04/install-apache-webserver-create-self.html
My Apache url is, https://helmprivaterepo.com
Step 2:
Create a directory in apache webserver root path to save our helm charts,
# mkdir /var/www/html/charts
Create an index file in charts directory by below command.
# cd /var/www/html && helm repo index charts/ --url https://helmprivaterepo.com:443/charts
Now check the browser with below url,
https://helmprivaterepo.com/charts/index.yaml
You can see helm index file is generated and serving fine.
Step 3:
Upload helm chart,
Clone this example helm chart.
# git clone https://github.com/DevOpsArts/nginx-web.git
Now pack this chart and upload to our chart repository by below command,
# helm package nginx-web -d /var/www/html/charts/
Step 4:
Add our private helm chart repo and deploy an application,
Now in Kubernetes cluster server.
Use below command to add our private repo, as we are using self-signed certificate so we need to pass the crt file in the command,
# helm repo add --ca-file /ignite/ssl/helmprivaterepo.crt nginx-repo https://helmprivaterepo.com/charts --username admin --password admin
To check the list of repository in helm,
# helm repo list
update the helm repo before doing any installation,
# helm repo update
Now check the list of charts available in private repos,
# helm search nginx-repo
Now deploy our private repository application,
# helm install nginx-repo/nginx-web -n nginx-web
To check installed helm charts,
# helm list
To verify from Kubernetes side that our application is running or not by,
# kubectl get pods
That's all, we have successfully created helm chart private repository using Apache webserver and uploaded new helm chart and deployed in kubernetes cluster.
Post a Comment