Files
chart/library/common/docs/persistence/README.md
Stavros Kois 929e60d801 NAS-121003 / 23.10 / Adapt charts CI and improve/fix common (#1011)
* Adapt charts CI and improve/fix common

* add check on permissions contaienr

* add postgres template

* update comments

* Update create_app.sh

* add check

* update script

* auto gen item.yaml from Chart,yaml

* rename readme on dest

* duplicate readme from the same source

* correct comment

* reoder

* remove extra space

* keep both README and app-readme

* update regex, to also allow 2 letter names, which is also valid

* No need to check host network if there aren't any pod values

* use same pattern as the pod.name label (not prepending release-name

* update deps

* add chart dirs to ci

* Add a validation to check if there is any yaml errors after merging files

* update charts path on ci

* common/1.0.0/ -> common/

* update common-test dep path

* temp update create_app script

* make permissions container name configurable, incase we want to change order of execution

* update naming convention

* fix typo and a missed name change

* do not allow `--` in names
2023-03-16 17:36:19 +02:00

98 lines
6.6 KiB
Markdown

# Persistence
| Key | Type | Required | Helm Template | Default | Description |
| :------------------------------------------------------------------------------------ | :-------: | :------: | :-----------: | :----------------------------------------------: | :---------------------------------------------------------------------------------- |
| persistence | `dict` | ❌ | ❌ | `{}` | Define the persistence as dicts |
| persistence.[volume-name] | `dict` | ✅ | ❌ | `{}` | Holds persistence definition |
| persistence.[volume-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the persistence |
| persistence.[volume-name].type | `string` | ❌ | ❌ | `{{ .Values.fallbackDefaults.persistenceType }}` | Define the persistence type (ixVolume, hostPath, configmap, secret, device) |
| persistence.[volume-name].mountPath | `string` | ✅ | ✅ | `""` | Default mountPath for all containers that are selected |
| persistence.[volume-name].mountPropagation | `string` | ❌ | ✅ | `""` | Default mountPropagation for all containers that are selected |
| persistence.[volume-name].subPath | `string` | ❌ | ✅ | `""` | Default subPath for all containers that are selected |
| persistence.[volume-name].readOnly | `boolean` | ❌ | ❌ | `false` | Default readOnly for all containers that are selected |
| persistence.[volume-name].targetSelectAll | `boolean` | ❌ | ❌ | `false` | Define wether to define this volume to all workloads and mount it on all containers |
| persistence.[volume-name].targetSelector | `dict` | ❌ | ❌ | `{}` | Define a dict with pod and containers to mount |
| persistence.[volume-name].targetSelector.[pod-name] | `dict` | ❌ | ❌ | `{}` | Define a dict named after the pod to define the volume |
| persistence.[volume-name].targetSelector.[pod-name].[container-name] | `dict` | ❌ | ❌ | `{}` | Define a dict named after the container to mount the volume |
| persistence.[volume-name].targetSelector.[pod-name].[container-name].mountPath | `string` | ❌ | ✅ | `[volume-name].mountPath` | Define the mountPath for the container |
| persistence.[volume-name].targetSelector.[pod-name].[container-name].mountPropagation | `string` | ❌ | ✅ | `[volume-name].mountPropagation` | Define the mountPropagation for the container |
| persistence.[volume-name].targetSelector.[pod-name].[container-name].subPath | `string` | ❌ | ✅ | `[volume-name].subPath` | Define the subPath for the container |
| persistence.[volume-name].targetSelector.[pod-name].[container-name].readOnly | `boolean` | ❌ | ❌ | `[volume-name].readOnly` | Define the readOnly for the container |
> When `targetSelectAll` is `true`, it will define the volume to all pods and volumeMount to all containers (`targetSelector` is ignored in this case)
> When `targetSelector` is defined, it will define the volume to the pod(s) and volumeMount to the container(s) selected. See below for the selector structure.
> When `targetSelector` is a empty, it will define the volume to the primary pod and volumeMount to the primary container
> `targetSelectAll` is only useful when you want to mount a shared volume to all pods and containers.
> Otherwise, you should use `targetSelector` to define the volume to specific pods and containers.
---
Appears in:
- `.Values.persistence`
---
Naming scheme:
- `$FullName-$PersistenceName` (release-name-chart-name-PersistenceName)
---
> Those are the common `keys` for all **persistence**.
> Additional keys, information and examples, see on the specific kind of persistence.
- [configmap](configmap.md)
- [emptyDir](emptyDir.md)
- [ixVolume](ixVolume.md)
- [hostPath](hostPath.md)
- [device](device.md)
- [secret](secret.md)
---
Examples:
```yaml
# Example of a shared emptyDir volume
persistence:
shared:
enabled: true
type: emptyDir
mountPath: /shared
readOnly: false
targetSelectAll: true
```
```yaml
# Example of a volume mounted to a specific container with a specific mountPath
persistence:
config:
enabled: true
type: emptyDir
targetSelector:
my-pod:
my-container: {}
mountPath: /path
readOnly: false
my-other-container: {}
mountPath: /other/path
readOnly: false
```
```yaml
# Example of a volume mounted to a specific container using the default mountPath
persistence:
config:
enabled: true
type: emptyDir
mountPath: /path
readOnly: true
targetSelector:
my-pod:
my-container: {}
my-other-container:
mountPath: /other/path
readOnly: false
```