Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze Helm and App Hub

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to carry out Helm and App Hub analysis, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.

Helm: K8s Application deployment and Packaging tool

If a user wants to deploy a K8s application, what is the quickest way?

We know that Kubernetes (k8s for short) is a platform that can deploy and manage containers. However, the concept of "application" has not been abstracted to K8s. An application is often composed of multiple K8s resources (Deployment, Service, ConfigMap). Therefore, we need a tool to deploy and manage the resources contained in an application (K8s API Resource) on K8s, which is what Helm does.

In addition, Helm defines a set of Chart formats to describe an application. How to understand Chart? For example, an Android program packaged in APK format can be installed on any phone running Android. If we compare K8s to Android and K8s apps to Android programs, then Chart can be compared to APK. This also means that K8s applications can be deployed to any K8s cluster through Helm as long as they are packaged into Chart.

Generally speaking, we can directly use Helm Chart that someone else has already done, just like using a Docker image. As a result, the Helm community has maintained an official Helm Hub, which contains a wealth of applications and is currently the main site for cloud native developers to search and download applications.

AppHub: Helm Hub's China small Station

However, it is a pity that using Helm Hub in China is a very painful thing for most developers.

The reason is simple: open any Charts file and you will see that it is filled with a large number of inaccessible mirror URL:

Or rely on Charts libraries that are not accessible at all:

Our software engineers' time is so precious (little) that we don't want to spend time solving these boring network problems (fog)!

However, watching foreign programmers deploy applications through a helm install command, we still feel a little sour.

So before we officially explore cloud native application management, we'd like to introduce you to a service called "Open Cloud Native Tencent App Center" (AppHub), whose home page is https://developer.aliyun.com/hub.

AppHub is a public welfare Helm Hub "China station" hosted on the domestic public cloud, and its back end is developed by three engineers of Aliyun Container platform team in 20% of the time.

One of the important duties of this site is to automatically synchronize all Helm official Hub hosted applications to China; at the same time, automatically replace all URL with network access problems such as gcr.io in Charts files with stable domestic mirror URL.

In this way, domestic developers are also free to use helm install to install applications!

Next, we will enter the practice that we like to hear and hear!

Example: deploy Guestbook as quickly as possible

First of all, install Helm, of course.

We highly recommend that you use Helm v3 here.

Helm v3 is as different from Helm v2 as Python 2 and 3, and much easier to use than Helm v2 (for example, there is no need to install the server component Tiller). Next week's article "Why do you have to turn to Helm v3" will explain this to you.

For the convenience of domestic developers, we have automatically synchronized the download link of Helm v3 binaries to China (be sure to try, really in seconds):

MacOS amd64 tar.gz

MacOS amd64 zip

Linux 386

Linux amd64

Linux arm64

Windows amd64

Download to the Helm binary file and extract it directly to $PATH and you can use it.

Next, we use Helm to quickly deploy a guestbook application. Suppose you have an Aliyun Kubernetes service running (it doesn't matter if not, and here's an example of a self-built K8s cluster).

The first step is to add apphub as your Helm Hub Repo:

$helm repo add apphub https://apphub.aliyuncs.com

You can search for guestbook directly on the command line:

$helm search guestbookNAME CHART VERSION APP VERSION DESCRIPTIONapphub/guestbook 0.2.0 1.0.0 A Helm chart to deploy Guestbook three tier web...

Then, all you need is a single command:

$helm install guestbook apphub/guestbook accesses Guestbook service

After the deployment is complete, run the following command to query and wait for the pods to start (Running):

$kubectl get podNAME READY STATUS RESTARTS AGEguestbook-d85895895-5mdx6 1 5m59sredis-slave-859585ff7f-4v9hj 1 Running 0 5m59sguestbook-d85895895-zh5l4 1 5m59sredis-slave-859585ff7f-fppqn 1 Running 0 5m59sredis-master-7b5cc58fc8-2wjmn 1 Running 0 5m59sredis-slave-859585ff7f-4v9hj 1 Running 0 5m59sredis-slave-859585ff7f-fppqn 1/1 Running 0 5m59s

Inquire about the service address:

$kubectl get service-l app.kubernetes.io/name=guestbookNAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEguestbook LoadBalancer 172.21.1.213 47.95.136.189 3000:32244/TCP 11m

Guestbook services can be accessed through External IP:

Use Minikube or build your own K8s cluster?

In fact, K8s itself does not distinguish between cloud-based services and self-built clusters. However, if there is no cloud load balancer service, the access method of Service will be a little more troublesome, such as using NodePort:

$helm install guestbook apphub/guestbook-set service.type=NodePort

After this command is executed, the application will automatically prompt you for the next access method. We'll talk more about what it is to set application parameters through-set.

If it is a Minikube, you also need to map the NodePort Service from the Minikube to access:

$minikube service guestbook try "one-click installation" (experience feature)

In addition to the normal deployment method, you can also use the web page UI on AppHub to experience one-click deployment of Chart to any cloud K8s.

For example, just open the guestbook application details page and click "one click to install":

Then fill in the corresponding server URL and base64 encoded certificate data in the "installation parameters" pop-up window, click "OK", and AppHub will try to install guestbook chart to the corresponding K8s cluster.

However, this feature is only an "experience" at the moment, because you can't modify the configuration parameters of the application directly on AppHub. The function of "application customization" online is in AppHub's Roadmap and is expected to be available next month.

But when it comes to Roadmap:

Roadmap within 6 months of AppHub is open source on Github!

Yes, you can use Github to put forward your improvement ideas for this Helm Hub China small site at any time. For example: how to better do "application customization"? How to dock and host your own Charts Repo? Wait.

Our slogan is: every Chinese developer is our PM! (serious face)

Much more than Helm!

As you can see, in the process of rapidly deploying K8s applications through Helm, the barriers to use and mental burden are very low. Compared with the traditional process of application construction, choreography and release, the automation combination of Helm + K8s is rapidly becoming the only magic weapon to improve the efficiency of developers in the cloud era.

And all the Charts applications introduced here that synchronize from the official Hub Repo are hosted on this Github: cloudnativeapp/charts. If you have any complaints about AppHub, you are welcome to come to this Repo to mention issue; you are also welcome to add your Charts and Repo to AppHub by submitting pull requests.

However, if you have used Helm deeply for a while, you may have some other feelings:

For example: "what exactly does the concept of Release in Helm mean? what's going on with Helm's Rollback? what's the relationship with K8s?"

"the process of managing the application of K8s by Helm doesn't seem to be so Native, it always feels like something's wrong."

The above content is how to analyze Helm and App Hub. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report