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

Part 4 introduction to Kubernetes package Management tool-helm

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

Share

Shulou(Shulou.com)06/03 Report--

01 Overview

Helm is a kubernetes package management tool, which can easily and quickly install, manage and uninstall kubernetes applications, similar to the role of yum or apt-get software in Linux operating system. Its main design purpose is:

Create a new chart package

Package and compress charts package files

Integrate with chart repository to obtain charts files

Install and uninstall charts to kubernetes cluster

Manage charts applications installed through helm

02 concept introduction

Chart: a Helm package that contains images, dependencies, resource definitions, etc., needed to run an application, and possibly service definitions in an Kubernetes cluster.

Release: an instance of Chart running on a Kubernetes cluster. On the same cluster, a Chart can be installed many times, and each installation creates a new release.

Repository: a repository for publishing and storing Chart. Helm clients access the index files and compressed packages of Chart in the warehouse through the HTTP protocol.

03 component

Helm: a client program provided to the user that can communicate with the server-tiller in the form of a command line.

Tiller: server-side software used to interact with helm clients and kubernetes api server components.

The architecture is as follows:

04 installation and deployment

1. Installation and deployment of helm

Version download, version list github.com/helm/helm/r...

Decompress, tar-zxvf helm-v2.0.0-linux-amd64.tgz

Put the extracted binaries in the executable directory mv linux-amd64/helm / usr/local/bin/helm, and then execute helm-- help to view the help documentation

2. Installation and deployment of tiller

The console executes the > helm init command, which downloads the charts package from the charts repository and deploys it to the kubernetes cluster according to its configuration.

The default charts repository is https://kubernetes-charts.storage.googleapis.com/index.yaml

The default tiller image is gcr.io/kubernetes-helm/tiller:v2.13.1

In China, it is impossible to access directly because of the wall, so we need to handle alternative repositories and image versions by ourselves, and install and deploy the helm server with the following command:

> helm init-- tiller-image registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.13.1--stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts Creating / root/.helm/repository/repositories.yaml Adding stable repowithURL: https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts Adding local repowithURL: http://127.0.0.1:8879/charts $HELM_HOME has been configured at / root/.helm. Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster. Please note: bydefault, Tiller is deployedwithan insecure'allow unauthenticated users'policy. To preventthis, run`helm init`withthe-- tiller-tls-verify flag. For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation Happy Helming!

Wait a moment, then execute the following command, and see the following output indicating that the installation is successful:

> helmversion Client: & version.Version {SemVer: "v2.13.1", GitCommit: "618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState: "clean"} Server: & version.Version {SemVer: "v2.13.1", GitCommit: "618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState: "clean"}

You can see the commonly used commands by executing helm-- help, which are described as follows:

Search search application in helm warehouse

Fetch downloads the chart package from the repository to the local

Release list of list deployments in this K8s cluster

Status displays specific information of release

Install install charts

Inspect describes charts information

Delete deletes the deployed release

Create creates a charts

Package packages and compresses a charts.

Repo displays, adds, removes charts repositories

05 access authorization

In the above steps, we deployed the resources required by tiller to the kubernetes cluster, but access to apiserver was denied because Deployment tiller-deploy did not define an authorized ServiceAccount. Execute the following command to authorize tiller-deploy:

> kubectl create serviceaccount-- namespace kube-system tiller > kubectl create clusterrolebinding tiller-cluster-rule-- clusterrole=cluster-admin-- serviceaccount=kube-system:tiller > kubectl patch deploy-- namespace kube-system tiller-deploy-p'{"spec": {"template": {"spec": {"serviceAccount": "tiller"}'06 deploy WordPress through helm

By entering the following command, we can create a WordPress blog site through helm

> helm install-name wordpress-test-set "persistence.enabled=false,mariadb.persistence.enabled=false" stable/wordpress

Get the login information with the following command:

> kubectlgetsvc-o wide > kubectlgetsecret-- namespacedefaultwordpress-test-wordpress-o jsonpath= "{.data.wordpress-password}" | base64-- decode

Open the page in the browser and enter your user name and password to see the WordPress blog site.

07 upgrade

When a new chart package is released or you want to change the configuration of an existing release, you can use the helm upgrade command, such as:

> helm upgrade wordpress-test\ >-set "persistence.enabled=true,mariadb.persistence.enabled=true"\ > stable/wordpress

Reference documentation:

Helm.sh/docs/

Yq.aliyun.com/articles/15...

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