Using Helm - Docker container technology in 5 minutes a day (163)

After Helm is successfully installed, you can  helm search view the currently installable charts.

This list is very long, only a part of it is intercepted here. You can't help but ask, where do these charts come from?

As mentioned earlier, Helm can manage charts like apt and yum manage packages. Packages for apt and yum are stored in repositories, and likewise, Helm has repositories.

Two repositories are configured by default when Helm is installed: stable and  local. stable It is the official warehouse and local the local warehouse where users store their own developed charts.

helm search Will show which repository the chart is in, such as  local/cool-chart and  stable/acs-engine-autoscaler.

Users can  helm repo add add more warehouses, such as private warehouses of enterprises. For the management and maintenance methods of warehouses, please refer to the official website documentation  https://docs.helm.sh

Like apt and yum, helm also supports keyword searches:

All information, including DESCRIPTION, will appear in the results list as long as it matches the keyword.

Installing chart is also very simple, execute the following command to install MySQL.

helm install stable/mysql

If you see the following error, it is usually because the Tiller server has insufficient permissions.

Execute the following naming to add permissions:

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"}}}}'

then execute again

helm install stable/mysql

The output is divided into three parts:

① chart Description of this deployment:

NAME Is the name of the release, because we didn't  -n specify it with parameters, Helm randomly generated one, here it is  fun-zorse.

NAMESPACE Is the namespace of release deployment, the default is  default, it can also be  --namespace specified.

STATUS ,  DEPLOYEDindicating that the chart has been deployed to the cluster.

② The resources contained in the current release: Service, Deployment, Secret and PersistentVolumeClaim, whose names are all  fun-zorse-mysqlin the format of  ReleasName- ChartName.

③Part  NOTES shows how to use release. For example, how to access the Service, how to obtain the database password, and how to connect to the database.

You can  kubectl get view the various objects that make up the release by:

Since we haven't prepared a PersistentVolume, the current release is not yet available.

helm list Displays the deployed release, helm delete you can delete the release.

The use of Helm is very similar to apt and yum, and it is very convenient to use Helm to manage Kubernetes applications.

Chart is Helm's application packaging format, which we will introduce in detail in the next section.

books:

1. "Play Kubernetes for 5 minutes a day"
https://item.jd.com/26225745440.html

2. "Fun with Docker container technology for 5 minutes a day"
https://item.jd.com/16936307278.html

3. "Fun with OpenStack for 5 minutes a day"
https://item.jd.com/12086376.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325261601&siteId=291194637