Helm is a package manager for Kubernetes. It allows you to easily install and update applications like Docker, Apache or MySQL on your cluster of containers. Helm can manage thousands of configurations in parallel so it’s ideal if you’re using this tool on multiple clusters with different software stacks running.
The “helm tutorial” is a great resource to get started with Kubernetes Helm. It includes step-by-step instructions on how to install and use the tool.
You’re in for a treat if you’re new to Kubernetes and searching for a means to manage your Kubernetes apps. Kubernetes Helm is a Kubernetes package management that lets you design, install, and update complicated Kubernetes applications.
You will learn how to use Helm to manage and deploy Kubernetes applications by executing commands in this course.
Ready? Let’s get this party started!
Hands-on demos are included in this lesson. You’ll need the following items to follow along:
- To install a testing Kubernetes cluster, you’ll require Minikube (v1.22.0), although you may utilize your existing cluster.
- Helm’s customer (v3.6.3).
- To interface with the cluster, use the Kubectl client (v1.21.2).
- An Ubuntu computer — This article utilizes the Linux Ubuntu 20.01.3 operating system, although any other operating system would do.
Installing Kubernetes on Ubuntu: A Step-by-Step Guide
Getting a Glimpse of Existing Kubernetes Resources
Kubernetes, often known as K8s, is a container orchestration engine that is open-source. The kubectl tool is used by Kubernetes to manage containerized applications and all of the resources they need. Persistent volumes, secrets, configmaps, and pods are examples of Kubernetes objects (groups of containers).
Kubernetes: An Architecture Diagram of How Components Fit Together
To manage Kubernetes resources, you’ll need to first figure out which ones are presently available. Based on the resource type you provided, each of the kubectl get commands below lists the existing resources.
To list all existing resources, open your terminal and perform the kubectl get all command as shown below.
# Displays a list of all available resources. kubectl get all # or use the commands below to retrieve a list of individual resources. get pods using kubectl # kubectl get service returns a list of pod resources. # Provides a list of service resources.
All resources, such as pod, service, deamonset, deployment, replicaset, and statefulset, are mentioned here.
Existing Kubernetes Resources are listed below.
Helm Charts are easy to find.
Manifest files may be used to describe complicated programs, but maintaining them is challenging since their information varies depending on the environment. Is there, perhaps, a better way? Yes!
Helm utilizes a Helm chart to produce manifest files and deploy Kubernetes applications. Helm charts build manifest files based on input parameters using a template engine. The template engine enables you to use a single Chart to deploy several configurations for the same application.
1. Look for existing Helm charts on the ArtifactHUB website. The primary Helm chart repository and the first place to go for a certain chart is ArtifactHUB.
Helm charts may also be seen on other websites like GitHub, Gitlab, Bitbucket, and other similar platforms.
2. In the search box on the ArtifactHUB website, insert the name of the Helm chart you’re searching for, as shown below. To view the information on the chart in this lesson, type jupyterhub and choose jupyterhub.
The Helm chart for jupyterhub hosts multi-user jupyter notebooks in the cloud. Jupyter notebooks are documents that combine live code, equations, graphics, and narrative prose into a single document.
Always go with the official chart created by the software’s developer, in this instance JupyterHub. You may also choose charts from reputable publishers such as Bitnami. When official charts aren’t available or aren’t good enough, their charts are an excellent substitute.
Helm Charts are easy to find. in Artifact Hub
A Helm chart is made up of the following elements:
- A templates directory containing files used by Helm to produce Kubernetes manifest files.
- A values.yaml file containing input values for templates that create manifest files. The default settings for each parameter are stored in a file for each chart, but you may alter them.
- A chart.yaml file that contains information about the chart as well as the software that comes with it. The jupyterhub Helm chart contains the software version as well as the dependencies (often other Helm Charts) that are necessary to execute the whole application.
These elements of the Helm chart may be seen on ArtifactHUB’s right-hand side, as illustrated below.
Parts of a Helm Chart to Recognize
3. Click the Templates icon to view a list of Helm chart templates (jupyterhub).
In ArtifactsHub, you may find Helm chart templates.
4. To examine the content of the hub/deployment.yaml template in the Templates window, choose it from the list in the left panel.
Making a Template Choice
Helm’s templates employ the Golang template system to add control structures like loops and conditionals.
A conditional block, for example, may be found on line 33 of the deployment.yaml template, as seen below. If the condition is satisfied, the inner code will appear in the final manifest file.
Also, keep in mind that sentences beginning with. The values in the picture below relate to user-defined input values (parameters) in the values.yaml file.
If.Values.scheduling.podPriority.enabled is true, then include “jupyterhub.priority.fullname” in priorityClassName. – the Conclusion
Template Contents are being viewed.
Helm templates include with everything you need to create manifest files based on your input parameters. Helm deploys an application by using manifest files.
You may generate various deployments from the same template for a given application using the templates system and its control structures, as well as other template techniques.
Using Helm to Deploy Applications
Let’s look at how to deploy apps using Helm now that you have a better understanding of the Helm chart. However, before you can do so, you must first download the Helm chart’s sources (jupyterhub).
- To view the needed instructions to deploy a Helm chart into a Kubernetes cluster, click the Install button in the jupyterhub Helm chart dashboard, as shown below.
Install the Helm Chart Sources by clicking the Install button.
2. At the bottom of the pop-up window, click the link (this link) to download the Helm chart (jupyterhub) package’s contents so you may interact with them directly. You may save the chart to any path on any computer having Kubernetes cluster access.
The Helm Chart Package’s Content may be downloaded here.
Open a terminal and change to the extracted folder’s directory after extracting the package’s content.
cd jupyterhub # adjust the directory to the extracted folder’s location.
Alternatively, you may use the following commands to download and extract the sources straight from the terminal.
# wget https://jupyterhub.github.io/helm-chart/jupyterhub/jupyterhub/jupyterhub/jupyterhub/jupyterhub/jupyterhub/jupyterhub/jup -1.1.3.tgz # tar -xvf jupyterhub-1.1.3.tgz extract sources # cd jupyterhub to get to the extracted folder
4. To use minikube to deploy a testing cluster, use the command below. To begin deploying an application, you’ll need this cluster.
If you already have another kind of cluster that you wish to utilize, you may skip the steps below. Consider utilizing a tool like Kubectx, which manages and switches between kubectl contexts. You won’t need to swap contexts if you just have one cluster.
# switch to minikube context and start the minikube engine minikube start
The program automatically configures your kubectl configuration to utilize minikube context, as seen below.
Using Minikube to Create a Kubernetes Cluster
Helm Charts Installation
You may now deploy the Helm chart with your chosen configuration once the cluster is ready. There is a values.yaml file in the downloaded sources that includes default values for every accessible setting. When installing a chart, you may add specific parameters based on the default values.
1. In your preferred code editor, open the values.yaml file and change the replicas to 3 to increase the number of pod replicas, as shown below. The greater the value of copies, the more readily available they are.
Increasing the default number of replicas by editing the values.yaml file
2. Next, install (helm install) the Helm chart (jupyterhub) to your Kubernetes cluster with a custom values file (-f values.yaml) in the working directory using the command below (.). Instead of the working directory, you may provide a relative or absolute path, or even a URL to a remote Helm.
You’ll see that the name allocated to this Helm application’s deployment is jupyterhub-example, although you could use any other name instead.
helm install jupyterhub-example -f values.yaml values.yaml values.yaml values.yaml values.yaml values.yaml values.yaml values.
The procedure may take a few minutes to complete because your computer will construct all of the necessary components to launch the program.
Minikube generates development environments, which you should not utilize in production if you want your cluster to function well. Minikube, for example, is only used for local development and testing, and it might be sluggish depending on your system resources.
The information printed after deployment includes instructions on how to use the application according to the developers’ recommendations. The IP and port necessary to connect to the program, as well as optional default passwords, are normally included.
Using Helm, install the JupyterHub application on a Kubernetes cluster with specific input settings.
3. Finally, execute the command below to view a list of the resources that were produced.
After installing the JupyterHub chart, Helm creates a list of resources.
Service that has been deployed is being tested.
You’ve probably already deployed a service in your cluster, but you should double-check that it’s working.
In a production cloud setting, you’d definitely add a DNS record to your DNS manager to allow people outside the cluster to access the new service. However, using kubectl, you may route ports from the cluster to your localhost.
To list all available services, use the kubectl command below (get service).
Each service has a CLUSTER-IP field, as you can see in the list below. The IP address is unique to the cluster and is used by other services to communicate with one another. CLUSTER-IP addresses are cluster-specific and not accessible from your browser; however, we’ll solve that in the following step.
On a Kubernetes cluster, a list of available services is shown.
2. Use the command below to pass (port-forward) the JupyterHub service’s port 8081 to your localhost address. You may use this command to access the service from your local computer.
port-forward service/hub 8081 kubectl
Ports from the cluster are forwarded to your localhost.
Another option for accessing the service from your local computer is to assign it an external IP address. However, it is beyond the scope of this course.
3. To verify whether the deployed service is functioning, connect to localhost in your browser and add the port forward from the previous command (localhost:8081).
Putting the deployed service to the test
You learnt how Kubernetes Helm bundles apps using Helm charts in this lesson. You’ve learnt how to deploy a functional service using your first Helm chart. You’re now prepared to work with Kubernetes cloud-native apps that are more complicated.
What types of apps do you have in mind to deploy using Helm now that you have this newfound knowledge? Maybe some dependencies for your applications, like a rabbit MQ service or a MySQL database?
Helm is a tool that allows you to deploy and manage Kubernetes applications. This tutorial will teach you how to use Helm to create, update, and delete Kubernetes application in your cluster. Reference: helm chart.
- helm tutorial for beginners
- helm kubernetes
- helm install
- helm chart example
- helm install local chart