This is the fifth day of my participation in the August More text Challenge. For details, see: August More Text Challenge

Chart is introduced

The application, which is actually called chart in helm, is a collection of kubernetes resource files, which is also the package format name

Chart is a collection of files that can be packaged, uploaded and distributed. How do we use chart

Chart operation

Assuming that we need an Nginx, helm can simply install a chart as a single command

You can also see which repositories provide NGINx and choose one of them to install

helm search repo nginx
Copy the code

Here we choose Bitnami’s Nginx because it’s fast

helm install bitnami/nginx --generate-name
Copy the code

You can see that it has been installed, and how to access the output, run the export 2 command, get 2 global variables, IP and port, access can be

By default, the latest version of Nginx in chart is installed. How to view the information about chart

helm show chart bitnami/nginx
Copy the code

Importantly, appVersion refers to the version of NGINx used, as well as the repository and source addresses, which can be viewed directly

Now that you have it installed, you can see that helm also has the concept of namespaces and also has isolation

Helm list # View helm list-a for all command SpacesCopy the code

Using Kubectl Get Pods you can also see that a Pod is launched and it is launched from the Deployment controller

As you can see, helm is much easier and faster for installing natively deployed applications

Chart names are viewed using helm list

helm uninstall chartName
Copy the code

Chart file structure

Yaml, service. Yaml and an nginx image address are required if we use the native deployment mode, assuming that nginx is deployed in deployment mode and can be accessed using IP:PORT

We used the helm and we didn’t see it, it was made for us by the helm, but we can also download it

helm pull bitnami/nginx
Copy the code

The nginx-9.4.1. TGZ package will be downloaded from the directory where the command was executed

tar xf nginx-9.41..tgz
cd nginx
tree 
Copy the code

Result: The TPL file in the Charts directory is hidden, which is not described here

Nginx ├── Charts ├─ chart.yaml ├─ ci │ ├── ct-value.yaml │ ├─ values-withYaml │ ├── deployment. Yaml │ ├── extra- List. Yaml │ ├── ├── helpers.tpl │ ├── bass exercises. Yaml │ ├── lips.yaml │ ├─ ldAP-daemon-secrets. Yaml │ ├── notes.txt │ ├── Servicemonitor.yaml │ ├─ Servicemonitor.yaml │ ├─ svc.yaml │ ├─ Bass exercises │ ├── lS-secrets.yaml ├── value.schema.json ├─ value.yamlCopy the code

The functions of the file are as follows:

  • Chart.yaml # The YAML file that contains the Chart information
  • Readme. md # Optional: Readable README file
  • Values. Yaml # chart default configuration value
  • Json # Optional: a values. Yaml file that uses the JSON structure
  • Charts / # Include other charts that chart depends on
  • CRDS / # Custom resource definition
  • Templates / # templates directory which, when combined with values, generates a valid Kubernetes manifest file
  • Templates/notes.txt # Optional: a plain text file with brief instructions

If you look at cat chart.yaml, you can see that this is actually the same as the previous show command

helm show chart bitnami/nginx

conclusion

The current simple use of the helm tool shows that it is very convenient and convenient, and the design of Chart completely wraps up the complex application deployment process into a finished product. Direct delivery is fine