feat: Add global kubeCapabilities

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
This commit is contained in:
Oliver Bähler 2021-04-29 23:00:41 +02:00
parent 7efd2d4a44
commit 945e348dac
4 changed files with 28 additions and 4 deletions

View file

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: 2.0.0 appVersion: 2.0.0
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd name: argo-cd
version: 3.2.2 version: 3.3.0
home: https://github.com/argoproj/argo-helm home: https://github.com/argoproj/argo-helm
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
keywords: keywords:

View file

@ -34,6 +34,20 @@ Changes in the `CustomResourceDefinition` resources shall be fixed easily by cop
## Upgrading ## Upgrading
### 3.2.*
With this minor version we introduced the evaluation for the ingress manifest (depending on the capabilities version), See [Pull Request](https://github.com/argoproj/argo-helm/pull/637). [This Issues](https://github.com/argoproj/argo-helm/issues/703) reported that the capabilities evaluation is not handled correctly on clusters running a cluster version prior to `1.19` (which misses the `Ingress.networking.k8s.io`).
If you are running a cluster version prior to `1.19` you can avoid this issue by directly installing chart version `3.3.0` and setting `global.kubeCapabilities` like:
```
global:
kubeCapabilities: "1.18.0"
```
Then you should no longer encounter this issue.
### 3.0.0 and above ### 3.0.0 and above
Helm apiVersion switched to `v2`. Requires Helm `3.0.0` or above to install. [Read More](https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/) on how to migrate your release from Helm 2 to Helm 3. Helm apiVersion switched to `v2`. Requires Helm `3.0.0` or above to install. [Read More](https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/) on how to migrate your release from Helm 2 to Helm 3.
@ -98,6 +112,7 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i
| global.securityContext | Toggle and define securityContext | See [values.yaml](values.yaml) | | global.securityContext | Toggle and define securityContext | See [values.yaml](values.yaml) |
| global.imagePullSecrets | If defined, uses a Secret to pull an image from a private Docker registry or repository. | `[]` | | global.imagePullSecrets | If defined, uses a Secret to pull an image from a private Docker registry or repository. | `[]` |
| global.hostAliases | Mapping between IP and hostnames that will be injected as entries in the pod's hosts files | `[]` | | global.hostAliases | Mapping between IP and hostnames that will be injected as entries in the pod's hosts files | `[]` |
| global.kubeCapabilities | Define Capabilities version for kubernetes, which is used to evaluate certain manifests | "" |
| nameOverride | Provide a name in place of `argocd` | `"argocd"` | | nameOverride | Provide a name in place of `argocd` | `"argocd"` |
| installCRDs | Install CRDs if you are using Helm2. | `true` | | installCRDs | Install CRDs if you are using Helm2. | `true` |
| configs.clusterCredentials | Provide one or multiple [external cluster credentials](https://argoproj.github.io/argo-cd/operator-manual/declarative-setup/#clusters) | `[]` (See [values.yaml](values.yaml)) | | configs.clusterCredentials | Provide one or multiple [external cluster credentials](https://argoproj.github.io/argo-cd/operator-manual/declarative-setup/#clusters) | `[]` (See [values.yaml](values.yaml)) |

View file

@ -144,11 +144,19 @@ app.kubernetes.io/component: {{ .component }}
Return the appropriate apiVersion for ingress Return the appropriate apiVersion for ingress
*/}} */}}
{{- define "argo-cd.ingress.apiVersion" -}} {{- define "argo-cd.ingress.apiVersion" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} {{- if semverCompare "<1.14-0" (include "argo-cd.capabilities" $) -}}
{{- print "extensions/v1beta1" -}} {{- print "extensions/v1beta1" -}}
{{- else if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}} {{- else if semverCompare "<1.19-0" (include "argo-cd.capabilities" $) -}}
{{- print "networking.k8s.io/v1beta1" -}} {{- print "networking.k8s.io/v1beta1" -}}
{{- else -}} {{- else -}}
{{- print "networking.k8s.io/v1" -}} {{- print "networking.k8s.io/v1" -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{/*
Return the appropriate apiVersion for ingress
*/}}
{{- define "argo-cd.capabilities" -}}
{{- default (default $.Capabilities.KubeVersion.GitVersion $.Capabilities.KubeVersion.Version) $.Values.global.kubeCapabilities }}
{{- end -}}

View file

@ -21,6 +21,7 @@ global:
# - ip: 10.20.30.40 # - ip: 10.20.30.40
# hostnames: # hostnames:
# - git.myhostname # - git.myhostname
kubeCapabilities: ""
## Controller ## Controller
controller: controller: