Publish Helm Chart for Jenkins

23 / Apr / 2023 by Deepak Parihari 0 comments

Helm is the first application package manager running atop Kubernetes. It allows describing the application structure through convenient helm-charts and managing it with simple commands.

It is a collection of all your versioned, per-configured application resources which can be deployed as one unit. You can then deploy another version of the chart with a different set of configurations.

Jenkins is an open-source Continuous Integration server written in Java for orchestrating a chain of actions to achieve the Continuous Integration process in an automated fashion. Jenkins supports the complete development life cycle of software from the building, testing, documenting of the software, deploying, and other stages of the software development life cycle.

In Kubernetes, we package all the running resources in a zip file known as the chart. A Helm chart can contain any number of Kubernetes objects, all of which are deployed as part of the chart. A Helm chart will usually contain at least a Deployment and a Service, but it can also contain an Ingress, Persistent Volume Claims, or any other Kubernetes object.

In version 3 helm provides more facilities i.e. install helm on the client side only. It provides more security than version 2. We can install Helm on Mac, Windows, and Linux.

The URL where you can download Helm according to your operating system link

  • Extract the zip and goto folder that will come after extracting
  • Copy the path and add it into the environment variable because in the command line everywhere we can do access helm.
  • and check the helm in cmd with the command: helm version
  • Create a new workspace or folder with the same name that you’ll give to the chart because the workspace and chart names are the same.
  • mkdir jenkins
  • Now create Chart.yaml inside the workspace “Jenkins”.

  • Now create one more folder inside the workspace “Jenkins” Folder name will “templates” it contained all the YML manifest that launch our resources. Like, YML manifests for launching Deployment and for exposing the services. (mkdir /jenkins/templates)
  • now create jenkins.yaml file inside the templates folder.

  • Create YML manifest file for exposing the services of Jenkins. The manifest looks like this. As I already mentioned that file creates in the templates folder.

  • Now we will install the chart we create earlier using Helm.
  • helm install <name> /path/to/the/folder
  • It will install your chart. After it, you found your Jenkins deployment and service have been installed also.

To check run the commands:

kubectl get deploy
kubectl get svc

Now open a web browser and navigate to http://minikube ip:30000.

A page will appear asking for an administrator password and instructions on retrieving this password from the Jenkins Pod logs.

Next, check the Pod’s logs for the admin password. Replace the highlighted section with your pod name.

  • kubectl logs <podname>

now put it in the password and install Jenkins step by step.

Artifact hub is a web-based application that helps to store and install helm packages. It is a public repository everyone can contribute to it by creating and publishing charts for any technology.

Run the following command to create the package

$ helm package jenkins -d charts

We have to need to create an index.yaml file for every chart. it contains all the information or we can say metadata of our chart.

Now, run the following command to create index.yaml

Create a new repository in GitHub and upload charts/ source code into the GitHub repository.

Go to the settings of your Github repository and go down where you can see the GitHub Pages section.

Select master as a branch and click on save.

Select the kind as Helm charts, provide a name to the repository, and enter the URL to the charts provided by the GitHub pages

Click add, It will publish a chart for you.

Here it is finally added in the artifactHub.io !!

If you love this, like and share it with your friends.

 

FOUND THIS USEFUL? SHARE IT

Tag -

devops

Leave a Reply

Your email address will not be published. Required fields are marked *