diff --git a/charts/argocd-applicationset/Chart.yaml b/charts/argocd-applicationset/Chart.yaml index 387ee7ba..68f2b3b1 100644 --- a/charts/argocd-applicationset/Chart.yaml +++ b/charts/argocd-applicationset/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: argocd-applicationset description: A Helm chart for installing ArgoCD ApplicationSet type: application -version: 1.8.0 +version: 1.9.0 appVersion: "v0.3.0" home: https://github.com/argoproj/argo-helm icon: https://argocd-applicationset.readthedocs.io/en/stable/assets/logo.png @@ -14,4 +14,4 @@ maintainers: - name: maruina annotations: artifacthub.io/changes: | - - "[Changed]: Bumped argocd-applicationset to 0.3.0" + - "[Added]: Add ingress for webhook, not enabled by default." diff --git a/charts/argocd-applicationset/README.md b/charts/argocd-applicationset/README.md index 53fd218f..c1abad4d 100644 --- a/charts/argocd-applicationset/README.md +++ b/charts/argocd-applicationset/README.md @@ -57,6 +57,7 @@ kubectl apply -k https://github.com/argoproj-labs/applicationset.git/manifests/c | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | [Assign custom affinity rules to the deployment](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/) | +| apiVersionOverrides.ingress | string | `""` | String to override apiVersion of ingresses rendered by this helm chart | | args.argocdRepoServer | string | `"argocd-repo-server:8081"` | The default Argo CD repo server address | | args.debug | bool | `false` | Print debug logs | | args.dryRun | bool | `false` | Enable dry run mode | @@ -73,6 +74,7 @@ kubectl apply -k https://github.com/argoproj-labs/applicationset.git/manifests/c | image.repository | string | `"quay.io/argoproj/argocd-applicationset"` | The image repository | | image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | | imagePullSecrets | list | `[]` | If defined, uses a Secret to pull an image from a private Docker registry or repository. | +| kubeVersionOverride | string | `""` | Override the Kubernetes version, which is used to evaluate certain manifests | | metrics.enabled | bool | `false` | Deploy metrics service | | metrics.service.annotations | object | `{}` | Metrics service annotations | | metrics.service.labels | object | `{}` | Metrics service labels | @@ -102,6 +104,15 @@ kubectl apply -k https://github.com/argoproj-labs/applicationset.git/manifests/c | serviceAccount.create | bool | `true` | Specifies whether a service account should be created | | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | | tolerations | list | `[]` | [Tolerations for use with node taints](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | +| webhook.ingress.annotations | object | `{}` | Additional ingress annotations | +| webhook.ingress.enabled | bool | `false` | Enable an ingress resource for Webhooks | +| webhook.ingress.extraPaths | list | `[]` | Additional ingress paths | +| webhook.ingress.hosts | list | `[]` | List of ingress hosts | +| webhook.ingress.ingressClassName | string | `""` | Defines which ingress controller will implement the resource | +| webhook.ingress.labels | object | `{}` | Additional ingress labels | +| webhook.ingress.pathType | string | `"Prefix"` | Ingress path type. One of `Exact`, `Prefix` or `ImplementationSpecific` | +| webhook.ingress.paths | list | `["/api/webhook"]` | List of ingress paths | +| webhook.ingress.tls | list | `[]` | Ingress TLS configuration | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0) +Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) diff --git a/charts/argocd-applicationset/README.md.gotmpl b/charts/argocd-applicationset/README.md.gotmpl index 62f1145e..5468053b 100644 --- a/charts/argocd-applicationset/README.md.gotmpl +++ b/charts/argocd-applicationset/README.md.gotmpl @@ -54,4 +54,5 @@ kubectl apply -k https://github.com/argoproj-labs/applicationset.git/manifests/c {{ template "chart.valuesSection" . }} -{{ template "helm-docs.versionFooter" . }} +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) diff --git a/charts/argocd-applicationset/templates/_helpers.tpl b/charts/argocd-applicationset/templates/_helpers.tpl index e86139e1..5cdc123d 100644 --- a/charts/argocd-applicationset/templates/_helpers.tpl +++ b/charts/argocd-applicationset/templates/_helpers.tpl @@ -62,3 +62,25 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Return the target Kubernetes version +*/}} +{{- define "argo-applicationset.kubeVersion" -}} + {{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride }} +{{- end -}} + +{{/* +Return the appropriate apiVersion for ingress +*/}} +{{- define "argo-applicationset.ingress.apiVersion" -}} +{{- if .Values.apiVersionOverrides.ingress -}} +{{- print .Values.apiVersionOverrides.ingress -}} +{{- else if semverCompare "<1.14-0" (include "argo-applicationset.kubeVersion" $) -}} +{{- print "extensions/v1beta1" -}} +{{- else if semverCompare "<1.19-0" (include "argo-applicationset.kubeVersion" $) -}} +{{- print "networking.k8s.io/v1beta1" -}} +{{- else -}} +{{- print "networking.k8s.io/v1" -}} +{{- end -}} +{{- end -}} diff --git a/charts/argocd-applicationset/templates/webhook-ingress.yaml b/charts/argocd-applicationset/templates/webhook-ingress.yaml new file mode 100644 index 00000000..2f58d88d --- /dev/null +++ b/charts/argocd-applicationset/templates/webhook-ingress.yaml @@ -0,0 +1,89 @@ +{{- if .Values.webhook.ingress.enabled -}} +{{- $serviceName := include "argo-applicationset.fullname" . -}} +{{- $servicePort := "webhook" -}} +{{- $paths := .Values.webhook.ingress.paths -}} +{{- $extraPaths := .Values.webhook.ingress.extraPaths -}} +{{- $pathType := .Values.webhook.ingress.pathType -}} +apiVersion: {{ include "argo-applicationset.ingress.apiVersion" . }} +kind: Ingress +metadata: +{{- if .Values.webhook.ingress.annotations }} + annotations: + {{- range $key, $value := .Values.webhook.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +{{- end }} + name: {{ include "argo-applicationset.fullname" . }} + labels: + {{- include "argo-applicationset.labels" . | nindent 4 }} + {{- if .Values.webhook.ingress.labels }} + {{- toYaml .Values.webhook.ingress.labels | nindent 4 }} + {{- end }} +spec: + {{- if eq (include "argo-applicationset.ingress.apiVersion" $) "networking.k8s.io/v1" }} + {{- with .Values.webhook.ingress.ingressClassName }} + ingressClassName: {{ . }} + {{- end }} + {{- end }} + rules: + {{- if .Values.webhook.ingress.hosts }} + {{- range $host := .Values.webhook.ingress.hosts }} + - host: {{ $host }} + http: + paths: + {{- if $extraPaths }} + {{- toYaml $extraPaths | nindent 10 }} + {{- end }} + {{- range $p := $paths }} + - path: {{ $p }} + {{- if eq (include "argo-applicationset.ingress.apiVersion" $) "networking.k8s.io/v1" }} + pathType: {{ $pathType }} + {{- end }} + backend: + {{- if eq (include "argo-applicationset.ingress.apiVersion" $) "networking.k8s.io/v1" }} + service: + name: {{ $serviceName }} + port: + {{- if kindIs "float64" $servicePort }} + number: {{ $servicePort }} + {{- else }} + name: {{ $servicePort }} + {{- end }} + {{- else }} + serviceName: {{ $serviceName }} + servicePort: {{ $servicePort }} + {{- end }} + {{- end -}} + {{- end -}} + {{- else }} + - http: + paths: + {{- if $extraPaths }} + {{- toYaml $extraPaths | nindent 10 }} + {{- end }} + {{- range $p := $paths }} + - path: {{ $p }} + {{- if eq (include "argo-applicationset.ingress.apiVersion" $) "networking.k8s.io/v1" }} + pathType: {{ $pathType }} + {{- end }} + backend: + {{- if eq (include "argo-applicationset.ingress.apiVersion" $) "networking.k8s.io/v1" }} + service: + name: {{ $serviceName }} + port: + {{- if kindIs "float64" $servicePort }} + number: {{ $servicePort }} + {{- else }} + name: {{ $servicePort }} + {{- end }} + {{- else }} + serviceName: {{ $serviceName }} + servicePort: {{ $servicePort }} + {{- end }} + {{- end -}} + {{- end -}} + {{- if .Values.webhook.ingress.tls }} + tls: + {{- toYaml .Values.webhook.ingress.tls | nindent 4 }} + {{- end -}} +{{- end -}} diff --git a/charts/argocd-applicationset/values.yaml b/charts/argocd-applicationset/values.yaml index 56289f77..25b8fdce 100644 --- a/charts/argocd-applicationset/values.yaml +++ b/charts/argocd-applicationset/values.yaml @@ -146,3 +146,58 @@ extraVolumes: [] # -- List of extra cli args to add extraArgs: [] # - --loglevel=warn + +# -- Override the Kubernetes version, which is used to evaluate certain manifests +kubeVersionOverride: "" + +## Override APIVersions +## If you want to template helm charts but cannot access k8s API server +## you can set api versions here +apiVersionOverrides: + # -- String to override apiVersion of ingresses rendered by this helm chart + ingress: "" # networking.k8s.io/v1beta1 + +## Webhook for the Git Generator +## Ref: https://argocd-applicationset.readthedocs.io/en/master/Generators-Git/#webhook-configuration) +webhook: + ingress: + # -- Enable an ingress resource for Webhooks + enabled: false + # -- Additional ingress annotations + annotations: {} + # -- Additional ingress labels + labels: {} + # -- Defines which ingress controller will implement the resource + ingressClassName: "" + + # -- List of ingress hosts + ## Hostnames must be provided if Ingress is enabled. + ## Secrets must be manually created in the namespace + hosts: [] + # - argocd-applicationset.example.com + + # -- List of ingress paths + paths: + - /api/webhook + # -- Ingress path type. One of `Exact`, `Prefix` or `ImplementationSpecific` + pathType: Prefix + # -- Additional ingress paths + extraPaths: [] + # - path: /* + # backend: + # serviceName: ssl-redirect + # servicePort: use-annotation + ## for Kubernetes >=1.19 (when "networking.k8s.io/v1" is used) + # - path: /* + # pathType: Prefix + # backend: + # service: + # name: ssl-redirect + # port: + # name: use-annotation + + # -- Ingress TLS configuration + tls: [] + # - secretName: argocd-applicationset-tls + # hosts: + # - argocd-applicationset.example.com