diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index 224d7d3e..ae7e6853 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -36,13 +36,14 @@ Changes in the `CustomResourceDefinition` resources shall be fixed easily by cop ### 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`). +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). +[Issue 703](https://github.com/argoproj/argo-helm/issues/703) reported that the capabilities evaluation is **not handled correctly when deploying the chart via an ArgoCD instance**, +especially deploying on clusters running a cluster version prior to `1.19` (which misses `Ingress` on apiVersion `networking.k8s.io/v1`). -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: +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 `kubeVersionOverride` like: -``` -global: - kubeCapabilities: "1.18.0" +```yaml +kubeVersionOverride: "1.18.0" ``` Then you should no longer encounter this issue. @@ -112,7 +113,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.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.kubeCapabilities | Define Capabilities version for kubernetes, which is used to evaluate certain manifests | "" | +| kubeVersionOverride | Override the Kubernetes version, which is used to evaluate certain manifests | `""` | | nameOverride | Provide a name in place of `argocd` | `"argocd"` | | 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)) | diff --git a/charts/argo-cd/templates/_helpers.tpl b/charts/argo-cd/templates/_helpers.tpl index f0ca4de8..f1ab124c 100644 --- a/charts/argo-cd/templates/_helpers.tpl +++ b/charts/argo-cd/templates/_helpers.tpl @@ -144,9 +144,9 @@ app.kubernetes.io/component: {{ .component }} Return the appropriate apiVersion for ingress */}} {{- define "argo-cd.ingress.apiVersion" -}} -{{- if semverCompare "<1.14-0" (include "argo-cd.capabilities" $) -}} +{{- if semverCompare "<1.14-0" (include "argo-cd.kubeVersion" $) -}} {{- print "extensions/v1beta1" -}} -{{- else if semverCompare "<1.19-0" (include "argo-cd.capabilities" $) -}} +{{- else if semverCompare "<1.19-0" (include "argo-cd.kubeVersion" $) -}} {{- print "networking.k8s.io/v1beta1" -}} {{- else -}} {{- print "networking.k8s.io/v1" -}} @@ -154,9 +154,9 @@ Return the appropriate apiVersion for ingress {{- end -}} {{/* -Return the appropriate apiVersion for ingress +Return the target Kubernetes version */}} -{{- define "argo-cd.capabilities" -}} - {{- default (default $.Capabilities.KubeVersion.GitVersion $.Capabilities.KubeVersion.Version) $.Values.global.kubeCapabilities }} +{{- define "argo-cd.kubeVersion" -}} + {{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride }} {{- end -}} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index 1325fe8b..5cf75d71 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -3,6 +3,7 @@ ## nameOverride: argocd fullnameOverride: "" +kubeVersionOverride: "" # Optional CRD installation for those without Helm hooks installCRDs: true @@ -21,7 +22,6 @@ global: # - ip: 10.20.30.40 # hostnames: # - git.myhostname - kubeCapabilities: "" ## Controller controller: