Develop #131

Merged
metal3d merged 9 commits from develop into master 2025-07-07 21:02:13 +00:00
3 changed files with 96 additions and 88 deletions
Showing only changes of commit 69c528e5e0 - Show all commits

View File

@@ -1,19 +1,28 @@
# Labels documentation # Labels documentation
Katenary proposes labels to set in `compose.yaml` files (or override files) to configure the Helm Chart generation. Because it is sometimes needed to have structured values, it is necessary to use the Yaml syntax. While compose labels are string, we can use `|` to use Yaml multilines as value. Katenary proposes labels to set in `compose.yaml` files (or override files) to configure the Helm Chart generation.
Because it is sometimes needed to have structured values, it is necessary to use the YAML syntax.
While compose labels are string, we can use _here-doc_ syntax using `|` to use YAML multiline as value.
Katenary will try to Unmarshal these labels. ```yaml
label-name: |-
# this is actually a multiline string here
key1: value1
key2: value2
```
Katenary will try to _Unmarshal_ these labels.
## Label list and types ## Label list and types
<!-- START_LABEL_DOC : do not remove this tag !--> <!-- START_LABEL_DOC : do not remove this tag !-->
| Label name | Description | Type | | Label name | Description | Type |
| ------------------------------ | ---------------------------------------------------------------- | -------------------------------- | | ------------------------------ | ---------------------------------------------------------------- | -------------------------------- |
| `katenary.v3/configmap-files` | Add files to the configmap. | `[]string` | | `katenary.v3/configmap-files` | Inject files as Configmap. | `[]string` |
| `katenary.v3/cronjob` | Create a cronjob from the service. | `object` | | `katenary.v3/cronjob` | Create a cronjob from the service. | `object` |
| `katenary.v3/dependencies` | Add Helm dependencies to the service. | `[]object` | | `katenary.v3/dependencies` | Add Helm dependencies to the service. | `[]object` |
| `katenary.v3/description` | Description of the service | `string` | | `katenary.v3/description` | Description of the service | `string` |
| `katenary.v3/env-from` | Add environment variables from antoher service. | `[]string` | | `katenary.v3/env-from` | Add environment variables from another service. | `[]string` |
| `katenary.v3/exchange-volumes` | Add exchange volumes (empty directory on the node) to share data | `[]object` | | `katenary.v3/exchange-volumes` | Add exchange volumes (empty directory on the node) to share data | `[]object` |
| `katenary.v3/health-check` | Health check to be added to the deployment. | `object` | | `katenary.v3/health-check` | Health check to be added to the deployment. | `object` |
| `katenary.v3/ignore` | Ignore the service | `bool` | | `katenary.v3/ignore` | Ignore the service | `bool` |
@@ -33,7 +42,7 @@ Katenary will try to Unmarshal these labels.
<!-- START_DETAILED_DOC : do not remove this tag !--> <!-- START_DETAILED_DOC : do not remove this tag !-->
### katenary.v3/configmap-files ### katenary.v3/configmap-files
Add files to the configmap. Inject files as Configmap.
**Type**: `[]string` **Type**: `[]string`
@@ -157,7 +166,7 @@ labels:
### katenary.v3/env-from ### katenary.v3/env-from
Add environment variables from antoher service. Add environment variables from another service.
**Type**: `[]string` **Type**: `[]string`

View File

@@ -13,7 +13,7 @@ katenary convert
This will create a `chart` directory with the helm chart inside. This will create a `chart` directory with the helm chart inside.
But, in general, you will need to add a few configuration to help Katenary to transpose the compose file to a working But, in general, you will need to add a few configurations to help Katenary to transpose the compose file to a working
helm chart. helm chart.
There are two ways to configure Katenary: There are two ways to configure Katenary:
@@ -25,7 +25,7 @@ The Katenary file `katenary.yaml` has benefits over the labels in the compose fi
- you can validate the configuration with a schema, and use completion in your editor - you can validate the configuration with a schema, and use completion in your editor
- you separate the configuration and leave the compose file "intact" - you separate the configuration and leave the compose file "intact"
- the syntax is a bit simpler, instead of using `katenary.v3/xxx: |-" you can use`xxx: ...` - the syntax is a bit simpler, instead of using `katenary.v3/xxx: |-` you can use `xxx: ...`
But: **this implies that you have to maintain two files if the compose file changes.** But: **this implies that you have to maintain two files if the compose file changes.**
@@ -46,7 +46,6 @@ services:
port: 8080 port: 8080
katenary.v3/map-env: |- katenary.v3/map-env: |-
DB_HOST: "{{ .Release.Name }}-database" DB_HOST: "{{ .Release.Name }}-database"
``` ```
Using a Katenary file, you can do: Using a Katenary file, you can do:
@@ -130,8 +129,8 @@ After having installed `katenary`, the standard usage is to call:
It will search standard compose files in the current directory and try to create a helm chart in "chart" directory. It will search standard compose files in the current directory and try to create a helm chart in "chart" directory.
!!! Info !!! Info
Katenary uses the compose-go library which respects the Docker and Docker-Compose specification. Keep in mind that Katenary uses the compose-go library which respects the Docker and Docker-Compose specification. Keep in mind that
it will find files exactly the same way as `docker-compose` and `podman-compose` do it. it will find files exactly the same way as `docker-compose` and `podman-compose` do it.
Of course, you can provide others files than the default with (cumulative) `-c` options: Of course, you can provide others files than the default with (cumulative) `-c` options:
@@ -142,7 +141,7 @@ Of course, you can provide others files than the default with (cumulative) `-c`
Katenary proposes a lot of labels to configure the helm chart generation, but some are very important. Katenary proposes a lot of labels to configure the helm chart generation, but some are very important.
!!! Info !!! Info
For more complete label usage, see [the labels page](labels.md). For more complete label usage, see [the labels page](labels.md).
### Work with Depends On? ### Work with Depends On?

View File

@@ -224,7 +224,7 @@
type: "[]object" type: "[]object"
"configmap-files": "configmap-files":
short: "Add files to the configmap." short: "Inject files as Configmap."
long: |- long: |-
It makes a file or directory to be converted to one or more ConfigMaps It makes a file or directory to be converted to one or more ConfigMaps
and mounted in the pod. The file or directory is relative to the and mounted in the pod. The file or directory is relative to the
@@ -266,7 +266,7 @@
type: "object" type: "object"
"env-from": "env-from":
short: "Add environment variables from antoher service." short: "Add environment variables from another service."
type: "[]string" type: "[]string"
long: |- long: |-
It adds environment variables from another service to the current service. It adds environment variables from another service to the current service.