当前位置:网站首页>Helm -- a powerful package management tool for kubernetes applications
Helm -- a powerful package management tool for kubernetes applications
2022-07-24 22:11:00 【xiaoxie_ coding】
Catalog
Helm What is it? ?
Helm yes Deis One developed for Kubernetes Applied package management tools , Mainly used for management Charts. It's kind of like Ubuntu Medium APT or CentOS Medium YUM.
Helm Chart It's for encapsulation Kubernetes A series of native applications YAML file . You can customize some of the applications when you deploy them Metadata, To facilitate application distribution .
For app Publishers , Can pass Helm Package applications 、 Manage application dependencies 、 Manage the application version and release it to the software warehouse .
For users , Use Helm There is no need to write complex application deployment files , In a simple way Kubernetes Up lookup 、 install 、 upgrade 、 Roll back 、 Uninstall application .
Use helm The advantages of
Generally, the process of deploying an application :
- To write yaml file ——》 establish service External exposure ——》 adopt ingress Domain access
There are many ways for external applications to access services in the cluster , I won't go into details here
Don't use helm
- Only suitable for simple applications . In fact, we deploy micro service projects , There could be dozens of services , It's not appropriate to use this way . A lot of... Needs to be maintained yaml file .
Use helm
- A large number of yaml Documents are managed as a whole
- Realization yaml Efficient reuse of files .
- Implement application level version management
Helm The overall architecture
Helm Main components
- Chart:Chart It's a Helm Software package , use tar Format . Includes running a K8S The image needed by the application 、 Dependency and resource definition, etc , That is, it contains a resource object required by an application YAML file .
- Repository( Warehouse ): yes Helm Software warehouse of ,Repository It's essentially a Web The server , The server holds a series of Chart Software package for users to download , And it provides the Repository Of Chart The manifest file of the package is easy to query .
- Config( The configuration data ): Set to on deployment Chart Configuration data in .
- Release: Use helm install Command in k8s Deployed in a cluster Chart be called Release . Is based on Chart and Config Deploy to K8S An instance running in the cluster . One Chart Can be deployed multiple times , Every time the Release Are different .
Helm Workflow
- Developers will develop good Chart Upload to Chart Warehouse .
- The operation and maintenance personnel are based on Chart The definition of , Set the necessary configuration data (Config), Use Helm The command line tool deploys the application to K8S In the cluster , With Release Concept management, subsequent update rollback, etc .
- Chart Warehouse Chart Can be used to share and distribute .
Helm edition
- V2 edition Helm rely on Tiller Components .Tiller Component is used to receive Helm Instructions from the client , And K8S Of API Server Interaction , Complete the deployment and management of resource objects .
- V3 edition Helm No longer use Tiller Components , It's going to be API Server Integration of interactive functions into Helm In the client program .
Helm Deployment installation
because helm Package abroad , Download through this website in China :
wget https://mirrors.huaweicloud.com/helm/v3.3.1/helm-v3.3.1-linux-amd64.tar.gz
tar -zxvf helm-v3.3.1-linux-amd64.tar.gz
cp linux-amd64/helm /usr/local/bin/
helm versionnotes : helm The client needs to be downloaded to the installation kubectl And it can be executed and passed normally kubectl operation kubernetes On , otherwise helm Will not be available
Construct a Helm Chart
helm create mychartThis command creates a mychart Catalog , The directory structure is as follows .
[[email protected] ~]# tree mychart/
mychart/ # Chart Catalog
├── charts # This charts Other dependent charts, Always installed
├── Chart.yaml # Describe this Chart Information about 、 Including the name 、 Description information 、 Version, etc
├── templates # The template directory
│ ├── deployment.yaml # deployment Controller Go Template file
│ ├── _helpers.tpl # With _ The starting file will not be deployed to k8s On , Can be used to customize general information
│ ├── hpa.yaml # hpa Template file
│ ├── ingress.yaml # ingress Template file
│ ├── NOTES.txt # Chart Some information after deployment to the cluster , for example : How to use 、 List default values
│ ├── serviceaccount.yaml # serviceaccount Of Go Template file
│ ├── service.yaml # service Of Go Template file
│ └── tests # test pod Catalog
│ └── test-connection.yaml # test pod Of deployment file
└── values.yaml # The value file of the template , These values will be applied to GO Template generation deployment file Templates Under the table of contents YAML The default values of the file template are all in values.yaml The definition of , For example deployment.yaml Container image defined in .
image: "{
{ .Values.image.repository }}:{
{ .Values.image.tag }}"Among them .Values.image.repository The value of is values.yaml The definition of nginx,.Values.image.tag The value is stable.
$ cat mychart/values.yaml|grep repository
repository: nginx
$ cat mychart/values.yaml|grep tag
tag: stable The values of the above two variables are in create chart The default value generated automatically when , It can be modified according to the actual situation .
Helm Basic commands
Add warehouse address
because helm The warehouse you bring is the address of the overseas warehouse , Pull application is slow . You can see that many servers have been installed through alicloud image installation charts.
helm repo add Repository name The repository URL
helm repo update
For example, add Alibaba cloud's warehouse address
helm repo add repo_name1 https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts-incubator/
Because the warehouse is constantly updated , So it's best to use update Update
helm repo update
View the list of added warehouses
helm repo listSearch by keyword chart package
$ helm search repo keyword
$ helm search hub keywordabove 2 The first command is only on the 3 The two fields are different ,repo Means to search in the warehouse added locally ;hub It means that Helm Hub Search in .
see helm package
$ helm inspect state/mysqlinstall helm
In the simplest case , It only needs one chart Name parameter of :
$ helm install stable/mysql
If you want to use your own release name Using parameter --name that will do
Can pass helm install --dry-run --debug Command to debug View installed chart list
$ helm listto update charts List for the latest version
helm repo update see chart Package file content
helm show chart chartName # see chart In bag chart.yaml The contents of the document
# chart Packages can be local, unpackaged chart Catalog ( namely helm create created chart Catalog ), It can also be packaged chart Compressed package ( from helm package pack ), It can also be stored in the warehouse chart package
helm show values chartName # see chart In bag values.yaml The contents of the document
helm show readme chartName # see chart In bag README The contents of the document
helm show all chartName # see chart In bag chart.yaml、values.yaml、README The contents of the document
uninstall release
$ helm uninstall releaseName Parameters :--keep-history( Adding this parameter will delete records )
upgrade release
$ helm upgrade releaseName chartNameRoll back release
$ helm rollback releaseName visionvision Expressed as the version ,1 Indicates the first version ,2 Indicates the second version , And so on
see release Basic information of
$ helm status releaseNameof Helm That's all for a brief introduction ,helm It's a very powerful k8s Package management tools , If you want to know more, you can look at the official documents carefully , I hope this article can help you !
边栏推荐
- General syntax and classification of SQL language (II)
- [good question with two points]
- PCL点云处理之创建二维格网组织点云数据(六十四)
- Sensor experiment - 485 air temperature and humidity
- Plane regularization of PCL point cloud processing (55)
- 从A76到A78——在变化中学习ARM微架构
- @typescript-eslint/ [email protected]
- C # use SQLite
- ansible-playbook 可用参数
- How to refine the top products of the website in the top 10 of the list for three consecutive months?
猜你喜欢

Kubernetes v1.24 is deployed based on containerd

Ue5 reports an error using the plug-in quixel Bridge

MySQL forced indexing

RISC0:Towards a Unified Compilation Framework for Zero Knowledge

Morris遍历

Gradle learning - integration of gradle and idea

AC automata

Web3 security go + security

Maixll dock QR code recognition

Using FRP to achieve intranet penetration
随机推荐
工程项目管理软件排名
Projection regularization of line point set in PCL point cloud processing (56)
C# 使用SQLite
Principle of an automatic nine point calibration tool (including part of the source code)
Image processing notes (1) image enhancement
在机器人行业的专业人士眼里,机器人行业目前的情况如何?
Moving least squares fitting experiment of PCL point cloud processing (62)
Uniform sampling and thinning of PCL point cloud processing (61)
Shallow copy deep copy
Machine learning kmeans
Leetcode 102. sequence traversal of binary tree
Description of differences between esp32c3 led PWM use and esp32
数据库之-元数据 DatabaseMetaData 初学
Gradle learning - getting started with gradle
Easily make 2D tile map with unity tilemap - Basics
Day10: declarative transaction control
一种兼容、更小、易用的WEB字体API
企业运营自媒体不能“自嗨”:内容要接地气不能接广告
[postgraduate entrance examination English vocabulary training camp] day 11 - offer, form, maintain, critical
PCL point cloud processing ply file reading and saving (54)