feat(doc): Enhancement, cleanup, add package instructions
All checks were successful
Go-Tests / tests (pull_request) Successful in 1m48s
Go-Tests / sonar (pull_request) Successful in 52s
Go-Tests / tests (push) Successful in 3m30s
Go-Tests / sonar (push) Successful in 50s

- remove trailing spaces
- add instruction for packages
- reindent YAML examples
- remove section telling that there is no config files, as
`katenary.yaml` file can now be used
This commit is contained in:
2025-08-29 13:24:32 +02:00
parent 6c2e8fa9b2
commit 6cd1c92997
9 changed files with 297 additions and 261 deletions

View File

@@ -6,9 +6,9 @@ While compose labels are string, we can use _here-doc_ syntax using `|` to use Y
```yaml
label-name: |-
# this is actually a multiline string here
key1: value1
key2: value2
# this is actually a multiline string here
key1: value1
key2: value2
```
Katenary will try to _Unmarshal_ these labels.
@@ -46,17 +46,17 @@ Inject files as Configmap.
**Type**: `[]string`
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
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
service directory.
If it is a directory, all files inside it are added to the ConfigMap.
If the directory as subdirectories, so one configmap per subpath are created.
If the directory as subdirectories, so one ConfigMap per sub-path are created.
!!! Warning
It is not intended to be used to store an entire project in configmaps.
It is intended to be used to store configuration files that are not managed
It is not intended to be used to store an entire project in ConfigMaps.
It is intended to be used to store configuration files that are not managed
by the application, like nginx configuration files. Keep in mind that your
project sources should be stored in an application image or in a storage.
@@ -80,8 +80,9 @@ Create a cronjob from the service.
This adds a cronjob to the chart.
The label value is a YAML object with the following attributes:
- command: the command to be executed
- schedule: the cron schedule (cron format or @every where "every" is a
- command: the command to be executed
- schedule: the cron schedule (cron format or @every where "every" is a
duration like 1h30m, daily, hourly...)
- rbac: false (optionnal), if true, it will create a role, a rolebinding and
a serviceaccount to make your cronjob able to connect the Kubernetes API
@@ -90,9 +91,9 @@ The label value is a YAML object with the following attributes:
```yaml
labels:
katenary.v3/cronjob: |-
command: echo "hello world"
schedule: "* */1 * * *" # or @hourly for example
katenary.v3/cronjob: |-
command: echo "hello world"
schedule: "* */1 * * *" # or @hourly for example
```
@@ -102,8 +103,8 @@ Add Helm dependencies to the service.
**Type**: `[]object`
Set the service to be, actually, a Helm dependency. This means that the
service will not be exported as template. The dependencies are added to
Set the service to be, actually, a Helm dependency. This means that the
service will not be exported as template. The dependencies are added to
the Chart.yaml file and the values are added to the values.yaml file.
It's a list of objects with the following attributes:
@@ -115,12 +116,12 @@ It's a list of objects with the following attributes:
!!! Info
Katenary doesn't update the helm depenedencies by default.
Use `--helm-update` (or `-u`) flag to update the dependencies.
example: <code>katenary convert -u</code>
By setting an alias, it is possible to change the name of the dependency
By setting an alias, it is possible to change the name of the dependency
in values.yaml.
**Example:**
@@ -149,7 +150,7 @@ Description of the service
**Type**: `string`
This replaces the default comment in values.yaml file to the given description.
This replaces the default comment in values.yaml file to the given description.
It is useful to document the service and configuration.
The value can be set with a documentation in multiline format.
@@ -178,15 +179,15 @@ It adds environment variables from another service to the current service.
service1:
image: nginx:1.19
environment:
FOO: bar
FOO: bar
service2:
image: php:7.4-fpm
labels:
# get the congigMap from service1 where FOO is
# get the congigMap from service1 where FOO is
# defined inside this service too
katenary.v3/env-from: |-
- myservice1
- myservice1
```
@@ -196,7 +197,7 @@ Add exchange volumes (empty directory on the node) to share data
**Type**: `[]object`
This label allows sharing data between containres. The volume is created in
This label allows sharing data between containres. The volume is created in
the node and mounted in the pod. It is useful to share data between containers
in a "same pod" logic. For example to let PHP-FPM and Nginx share the same direcotory.
@@ -207,6 +208,7 @@ This will create:
- a `initContainer` for each definition
Fields:
- name: the name of the volume (manadatory)
- mountPath: the path where the volume is mounted in the pod (optional, default is `/opt`)
- init: a command to run to initialize the volume with data (optional)
@@ -275,7 +277,7 @@ Ingress rules to be added to the service.
**Type**: `object`
Declare an ingress rule for the service. The port should be exposed or
Declare an ingress rule for the service. The port should be exposed or
declared with `katenary.v3/ports`.
**Example:**
@@ -294,7 +296,7 @@ Mark the service as the main app.
**Type**: `bool`
This makes the service to be the main application. Its image tag is
This makes the service to be the main application. Its image tag is
considered to be the Chart appVersion and to be the defaultvalue in Pod
container image attribute.
@@ -309,7 +311,7 @@ ghost:
image: ghost:1.25.5
labels:
# The chart is now named ghost, and the appVersion is 1.25.5.
# In Deployment, the image attribute is set to ghost:1.25.5 if
# In Deployment, the image attribute is set to ghost:1.25.5 if
# you don't change the "tag" attribute in values.yaml
katenary.v3/main-app: true
```
@@ -322,8 +324,8 @@ Map env vars from the service to the deployment.
**Type**: `map[string]string`
Because you may need to change the variable for Kubernetes, this label
forces the value to another. It is also particullary helpful to use a template
value instead. For example, you could bind the value to a service name
forces the value to another. It is also particullary helpful to use a template
value instead. For example, you could bind the value to a service name
with Helm attributes:
`{{ tpl .Release.Name . }}`.
@@ -349,7 +351,7 @@ Ports to be added to the service.
**Type**: `[]uint32`
Only useful for services without exposed port. It is mandatory if the
Only useful for services without exposed port. It is mandatory if the
service is a dependency of another service.
**Example:**
@@ -368,10 +370,10 @@ Move the same-pod deployment to the target deployment.
**Type**: `string`
This will make the service to be included in another service pod. Some services
This will make the service to be included in another service pod. Some services
must work together in the same pod, like a sidecar or a proxy or nginx + php-fpm.
Note that volume and VolumeMount are copied from the source to the target
Note that volume and VolumeMount are copied from the source to the target
deployment.
**Example:**
@@ -393,7 +395,7 @@ Env vars to be set as secrets.
**Type**: `[]string`
This label allows setting the environment variables as secrets. The variable
This label allows setting the environment variables as secrets. The variable
is removed from the environment and added to a secret object.
The variable can be set to the `katenary.v3/values` too,
@@ -418,14 +420,14 @@ Environment variables to be added to the values.yaml
**Type**: `[]string or map[string]string`
By default, all environment variables in the "env" and environment
files are added to configmaps with the static values set. This label
files are added to ConfigMaps with the static values set. This label
allows adding environment variables to the values.yaml file.
Note that the value inside the configmap is `{{ tpl vaname . }}`, so
you can set the value to a template that will be rendered with the
Note that the value inside the configmap is `{{ tpl vaname . }}`, so
you can set the value to a template that will be rendered with the
values.yaml file.
The value can be set with a documentation. This may help to understand
The value can be set with a documentation. This may help to understand
the purpose of the variable.
**Example:**
@@ -442,7 +444,7 @@ labels:
- TO_CONFIGURE
# complex values, set as a template in values.yaml with a documentation
- A_COMPLEX_VALUE: |-
This is the documentation for the variable to
This is the documentation for the variable to
configure in values.yaml.
It can be, of course, a multiline text.
```