Skip to content

Commit

Permalink
docs: Improve helm docs argoproj#15706 (argoproj#15755)
Browse files Browse the repository at this point in the history
* Add docs to make it easier to understand which values win

fix/docs/helm

Signed-off-by: phyzical <[email protected]>

* refactor the docs to not link to stackoverflow

fix/docs/helm

Signed-off-by: phyzical <[email protected]>

---------

Signed-off-by: phyzical <[email protected]>
  • Loading branch information
phyzical authored and tesla59 committed Dec 16, 2023
1 parent 45e7a94 commit cc16f28
Showing 1 changed file with 79 additions and 17 deletions.
96 changes: 79 additions & 17 deletions docs/user-guide/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ spec:
namespace: kubeseal
```
!!! note "When using multiple ways to provide values"
Order of precedence is `parameters > valuesObject > values > valueFiles > helm repository values.yaml` (see [Here](./helm.md#helm-value-precedence) for a more detailed example)

## Values Files

Helm has the ability to use a different, or even multiple "values.yaml" files to derive its
Expand Down Expand Up @@ -120,6 +123,65 @@ source:
value: LoadBalancer
```

## Helm Value Precedence
Values injections have the following order of precedence
`parameters > valuesObject > values > valueFiles > helm repository values.yaml`
Or rather

```
lowest -> valueFiles
-> values
-> valuesObject
highest -> parameters
```
so values/valuesObject trumps valueFiles, and parameters trump both.
Precedence of valueFiles themselves is the order they are defined in
```
if we have

valuesFile:
- values-file-2.yaml
- values-file-1.yaml

the last values-file i.e. values-file-1.yaml will trump the first
```
When multiple of the same key are found the last one wins i.e
```
e.g. if we only have values-file-1.yaml and it contains

param1: value1
param1: value3000

we get param1=value3000
```
```
parameters:
- name: "param1"
value: value2
- name: "param1"
value: value1

the result will be param1=value1
```
```
values: |
param1: value2
param1: value5

the result will be param1=value5
```
!!! note "When valuesFiles or values is used"
The list of parameters seen in the ui is not what is used for resources, rather it is the values/valuesObject merged with parameters (see [this issue](https://github.com/argoproj/argo-cd/issues/9213) incase it has been resolved)
As a workaround using parameters instead of values/valuesObject will provide a better overview of what will be used for resources
## Helm Release Name
By default, the Helm release name is equal to the Application name to which it belongs. Sometimes, especially on a centralised Argo CD,
Expand Down Expand Up @@ -147,23 +209,23 @@ is any normal Kubernetes resource annotated with the `helm.sh/hook` annotation.

Argo CD supports many (most?) Helm hooks by mapping the Helm annotations onto Argo CD's own hook annotations:

| Helm Annotation | Notes |
|---|---|
| `helm.sh/hook: crd-install` | Supported as equivalent to `argocd.argoproj.io/hook: PreSync`. |
| `helm.sh/hook: pre-delete` | Not supported. In Helm stable there are 3 cases used to clean up CRDs and 3 to clean-up jobs. |
| `helm.sh/hook: pre-rollback` | Not supported. Never used in Helm stable. |
| `helm.sh/hook: pre-install` | Supported as equivalent to `argocd.argoproj.io/hook: PreSync`. |
| `helm.sh/hook: pre-upgrade` | Supported as equivalent to `argocd.argoproj.io/hook: PreSync`. |
| `helm.sh/hook: post-upgrade` | Supported as equivalent to `argocd.argoproj.io/hook: PostSync`. |
| `helm.sh/hook: post-install` | Supported as equivalent to `argocd.argoproj.io/hook: PostSync`. |
| `helm.sh/hook: post-delete` | Not supported. Never used in Helm stable. |
| `helm.sh/hook: post-rollback` | Not supported. Never used in Helm stable. |
| `helm.sh/hook: test-success` | Not supported. No equivalent in Argo CD. |
| `helm.sh/hook: test-failure` | Not supported. No equivalent in Argo CD. |
| `helm.sh/hook-delete-policy` | Supported. See also `argocd.argoproj.io/hook-delete-policy`). |
| `helm.sh/hook-delete-timeout` | Not supported. Never used in Helm stable |
| `helm.sh/hook-weight` | Supported as equivalent to `argocd.argoproj.io/sync-wave`. |
| `helm.sh/resource-policy: keep` | Supported as equivalent to `argocd.argoproj.io/sync-options: Delete=false`. |
| Helm Annotation | Notes |
| ------------------------------- | --------------------------------------------------------------------------------------------- |
| `helm.sh/hook: crd-install` | Supported as equivalent to `argocd.argoproj.io/hook: PreSync`. |
| `helm.sh/hook: pre-delete` | Not supported. In Helm stable there are 3 cases used to clean up CRDs and 3 to clean-up jobs. |
| `helm.sh/hook: pre-rollback` | Not supported. Never used in Helm stable. |
| `helm.sh/hook: pre-install` | Supported as equivalent to `argocd.argoproj.io/hook: PreSync`. |
| `helm.sh/hook: pre-upgrade` | Supported as equivalent to `argocd.argoproj.io/hook: PreSync`. |
| `helm.sh/hook: post-upgrade` | Supported as equivalent to `argocd.argoproj.io/hook: PostSync`. |
| `helm.sh/hook: post-install` | Supported as equivalent to `argocd.argoproj.io/hook: PostSync`. |
| `helm.sh/hook: post-delete` | Not supported. Never used in Helm stable. |
| `helm.sh/hook: post-rollback` | Not supported. Never used in Helm stable. |
| `helm.sh/hook: test-success` | Not supported. No equivalent in Argo CD. |
| `helm.sh/hook: test-failure` | Not supported. No equivalent in Argo CD. |
| `helm.sh/hook-delete-policy` | Supported. See also `argocd.argoproj.io/hook-delete-policy`). |
| `helm.sh/hook-delete-timeout` | Not supported. Never used in Helm stable |
| `helm.sh/hook-weight` | Supported as equivalent to `argocd.argoproj.io/sync-wave`. |
| `helm.sh/resource-policy: keep` | Supported as equivalent to `argocd.argoproj.io/sync-options: Delete=false`. |

Unsupported hooks are ignored. In Argo CD, hooks are created by using `kubectl apply`, rather than `kubectl create`. This means that if the hook is named and already exists, it will not change unless you have annotated it with `before-hook-creation`.

Expand Down

0 comments on commit cc16f28

Please sign in to comment.