Giriş
Yeni proje oluşturur
Örnek
Şöyle yaparız
helm create mychart
Oluşturulan dosya ve dizinler şöyle.
mychart/ Chart.yaml - Chart'ın tanımını içerir values.yaml - Varsayılan değerleri içerir charts/ templates/ ...
Dizin yapısı şöyle
go-k8s |-- Chart.yaml |-- charts |-- templates | |-- NOTES.txt | |-- _helpers.tpl | |-- deployment.yaml | |-- ingress.yaml | `-- service.yaml `-- values.yaml
>> tree demo-chart demo-chart ├── charts ├── Chart.yaml # Information about your chart ├── templates │ ├── deployment.yaml │ ├── _helpers.tpl │ ├── hpa.yaml │ ├── ingress.yaml │ ├── NOTES.txt │ ├── serviceaccount.yaml │ ├── service.yaml │ └── tests │ └── test-connection.yaml └── values.yaml
1. .helmignore Dosyası
Açıklaması şöyle. Projeyi oluşturunca bu dosya da otomatik olarak yaratılır.
There may be cases where we need to ignore some files from the chart directory while creating the packaged version. In that case, we can create a file named .helmignore under the chart directory. And then we can populate the .helmignore file with the patterns or names of files to be ignored during the creation of a packaged version of the chart.For instance, Let’s assume we want to ignore ingress.yaml residing under the templates directory.>> cd demo-chart>> vim .helmignore# Add the folloing line into the .helmignore file---ingress.yamlAnd now, create the packaged version of the chart :>> helm package demo-chart --version 1.2---------------------------------------------------------------Successfully packaged chart and saved it to: /home/ec2-user/chart/demo-chart-1.2.tgz
Örnek
Şöyle yaparız
For instance, Let’s assume we want to ignore ingress.yaml residing under the templates directory.>> cd demo-chart>> vim .helmignore# Add the folloing line into the .helmignore file---ingress.yamlAnd now, create the packaged version of the chart :>> helm package demo-chart --version 1.2---------------------------------------------------------------Successfully packaged chart and saved it to: /home/ec2-user/chart/demo-chart-1.2.tgz
2. Chart.yaml Dosyası
Açıklaması şöyle
charts directory contains the charts that the corresponding chart depends on.Chart.yaml contains the metadata of the corresponding chart.
Bu dosyada version ve appVersion diye iki tane alan var. Açıklaması şöyle
Each Helm chart comes with 2 separate versions:
- Chart version itself [version inChart.yaml]
- Application version in chart [appVersion in Chart.yaml]
2. values.yaml Dosyası
Açıklaması şöyle. Yani template dosyalarında kullanılacak varsayılan değerler içerir.
This file declares variables to be passed into the templates. Modify the file to include your Docker image, tag, and service name, ports, type, and database values
Açıklaması şöyle. Eğer bazı değerleri ezmek istersek --values veya --set seçenekleri ile yapılabilir.
values.yaml contains the default values, which will be used to generate k8s manifest files residing under the template directory. The default values can be overwritten using the —values or — set command during the installation of a chart.
3. templates dizini
Açıklaması şöyle
templates contain all the manifest files that will be used to create k8s objects. Such as — deployment, service account, and so on.
Açıklaması şöyle
The templates/ directory is for template files. When Helm evaluates a chart, it will send all of the files in the templates/ directory through the template rendering engine. It then collects the results of those templates and sends them on to Kubernetes.The values.yaml file is also important to templates. This file contains the default values for a chart. These values may be overridden by users during helm install or helm upgrade.The Chart.yaml file contains a description of the chart. You can access it from within a template. The charts/ directory may contain other charts (which we call subcharts).
4. templates/_helpers.tpl dosyası
Açıklaması şöyle
_helpers.tpl contains several methods/sub-template (written in golang text templating syntax), which will be used by the YAML files residing under the templates dircetory.
Hiç yorum yok:
Yorum Gönder