feat(argo-cd): manage CRD by Helm (#1342)
* feat(argo-cd): manage CRD by Helm Signed-off-by: yu-croco <yuki.kita22@gmail.com> * feat: Implement "crds.keep" like argo-events chart Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com> * fix(argo-cd): update path of ArgoCD CRDs Signed-off-by: yu-croco <yu.croco@gmail.com> * fix: Don't keep CRDs during chart testing Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com> Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com> Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
parent
0717586410
commit
e6587671d3
13 changed files with 108 additions and 11 deletions
6
.github/workflows/lint-and-test.yml
vendored
6
.github/workflows/lint-and-test.yml
vendored
|
@ -1,7 +1,7 @@
|
||||||
## Reference: https://github.com/helm/chart-testing-action
|
## Reference: https://github.com/helm/chart-testing-action
|
||||||
name: Linting and Testing
|
name: Linting and Testing
|
||||||
on: pull_request
|
on: pull_request
|
||||||
jobs:
|
jobs:
|
||||||
chart-test:
|
chart-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -37,7 +37,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
- name: Run chart-testing (lint)
|
- name: Run chart-testing (lint)
|
||||||
run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml
|
run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml
|
||||||
|
|
||||||
- name: Run docs-testing (helm-docs)
|
- name: Run docs-testing (helm-docs)
|
||||||
id: helm-docs
|
id: helm-docs
|
||||||
run: |
|
run: |
|
||||||
|
@ -60,7 +60,7 @@ jobs:
|
||||||
if: |
|
if: |
|
||||||
contains(steps.list-changed.outputs.changed_charts, 'argocd-image-updater')
|
contains(steps.list-changed.outputs.changed_charts, 'argocd-image-updater')
|
||||||
run: |
|
run: |
|
||||||
kubectl apply -f charts/argo-cd/crds
|
kubectl apply -f charts/argo-cd/templates/crds
|
||||||
|
|
||||||
- name: Skip HPA tests of ArgoCD
|
- name: Skip HPA tests of ArgoCD
|
||||||
if: contains(steps.list-changed.outputs.changed_charts, 'argo-cd')
|
if: contains(steps.list-changed.outputs.changed_charts, 'argo-cd')
|
||||||
|
|
|
@ -2,7 +2,7 @@ apiVersion: v2
|
||||||
appVersion: v2.4.11
|
appVersion: v2.4.11
|
||||||
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
||||||
name: argo-cd
|
name: argo-cd
|
||||||
version: 5.1.0
|
version: 5.2.0
|
||||||
home: https://github.com/argoproj/argo-helm
|
home: https://github.com/argoproj/argo-helm
|
||||||
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
|
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
|
||||||
keywords:
|
keywords:
|
||||||
|
@ -21,4 +21,4 @@ dependencies:
|
||||||
condition: redis-ha.enabled
|
condition: redis-ha.enabled
|
||||||
annotations:
|
annotations:
|
||||||
artifacthub.io/changes: |
|
artifacthub.io/changes: |
|
||||||
- "[Added]: Ability to customize HPAs spec.behavior field"
|
- "[Changed]: manage CRD by Helm"
|
||||||
|
|
|
@ -81,15 +81,17 @@ cd argo-cd
|
||||||
git diff v1.8.7 v2.0.0 -- manifests/install.yaml
|
git diff v1.8.7 v2.0.0 -- manifests/install.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Changes in the `CustomResourceDefinition` resources shall be fixed easily by copying 1:1 from the [`manifests/crds` folder](https://github.com/argoproj/argo-cd/tree/master/manifests/crds) into this [`charts/argo-cd/crds` folder](https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd/crds).
|
Changes in the `CustomResourceDefinition` resources shall be fixed easily by copying 1:1 from the [`manifests/crds` folder](https://github.com/argoproj/argo-cd/tree/master/manifests/crds) into this [`charts/argo-cd/templates/crds` folder](https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd/templates/crds).
|
||||||
|
|
||||||
## Upgrading
|
## Upgrading
|
||||||
|
|
||||||
### Custom resource definitions
|
### Custom resource definitions
|
||||||
|
|
||||||
|
Some users would prefer to install the CRDs _outside_ of the chart. You can disable the CRD installation of this chart by using `--set crds.install=false` when installing the chart.
|
||||||
|
|
||||||
Helm cannot upgrade custom resource definitions [by design](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations).
|
Helm cannot upgrade custom resource definitions [by design](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations).
|
||||||
|
|
||||||
Please use `kubectl` to upgrade CRDs manually from [crds](crds/) folder or via the manifests from the upstream project repo:
|
Please use `kubectl` to upgrade CRDs manually from [templates/crds](templates/crds/) folder or via the manifests from the upstream project repo:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=<appVersion>"
|
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=<appVersion>"
|
||||||
|
@ -98,6 +100,23 @@ kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=<appVer
|
||||||
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=v2.4.9"
|
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=v2.4.9"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 5.2.0
|
||||||
|
|
||||||
|
Custom resource definitions were moved to `templates` folder so they can be managed by Helm.
|
||||||
|
|
||||||
|
To adopt already created CRDs, please use following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
YOUR_ARGOCD_NAMESPACE="" # e.g. argo-cd
|
||||||
|
YOUR_ARGOCD_RELEASENAME="" # e.g. argo-cd
|
||||||
|
|
||||||
|
for crd in "applications.argoproj.io" "applicationsets.argoproj.io" "argocdextensions.argoproj.io" "appprojects.argoproj.io"; do
|
||||||
|
kubectl label --overwrite crd $crd app.kubernetes.io/managed-by=Helm
|
||||||
|
kubectl annotate --overwrite crd $crd meta.helm.sh/release-namespace="$YOUR_ARGOCD_NAMESPACE"
|
||||||
|
kubectl annotate --overwrite crd $crd meta.helm.sh/release-name="$YOUR_ARGOCD_RELEASENAME"
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
### 5.0.0
|
### 5.0.0
|
||||||
|
|
||||||
This version **removes support for**:
|
This version **removes support for**:
|
||||||
|
@ -305,6 +324,9 @@ NAME: my-release
|
||||||
| apiVersionOverrides.autoscaling | string | `""` | String to override apiVersion of autoscaling rendered by this helm chart |
|
| apiVersionOverrides.autoscaling | string | `""` | String to override apiVersion of autoscaling rendered by this helm chart |
|
||||||
| apiVersionOverrides.certmanager | string | `""` | String to override apiVersion of certmanager resources rendered by this helm chart |
|
| apiVersionOverrides.certmanager | string | `""` | String to override apiVersion of certmanager resources rendered by this helm chart |
|
||||||
| apiVersionOverrides.ingress | string | `""` | String to override apiVersion of ingresses rendered by this helm chart |
|
| apiVersionOverrides.ingress | string | `""` | String to override apiVersion of ingresses rendered by this helm chart |
|
||||||
|
| crds.annotations | object | `{}` | Annotations to be added to all CRDs |
|
||||||
|
| crds.install | bool | `true` | Install and upgrade CRDs |
|
||||||
|
| crds.keep | bool | `true` | Keep CRDs on chart uninstall |
|
||||||
| createAggregateRoles | bool | `false` | Create clusterroles that extend existing clusterroles to interact with argo-cd crds |
|
| createAggregateRoles | bool | `false` | Create clusterroles that extend existing clusterroles to interact with argo-cd crds |
|
||||||
| extraObjects | list | `[]` | Array of extra K8s manifests to deploy |
|
| extraObjects | list | `[]` | Array of extra K8s manifests to deploy |
|
||||||
| fullnameOverride | string | `""` | String to fully override `"argo-cd.fullname"` |
|
| fullnameOverride | string | `""` | String to fully override `"argo-cd.fullname"` |
|
||||||
|
|
|
@ -81,15 +81,17 @@ cd argo-cd
|
||||||
git diff v1.8.7 v2.0.0 -- manifests/install.yaml
|
git diff v1.8.7 v2.0.0 -- manifests/install.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Changes in the `CustomResourceDefinition` resources shall be fixed easily by copying 1:1 from the [`manifests/crds` folder](https://github.com/argoproj/argo-cd/tree/master/manifests/crds) into this [`charts/argo-cd/crds` folder](https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd/crds).
|
Changes in the `CustomResourceDefinition` resources shall be fixed easily by copying 1:1 from the [`manifests/crds` folder](https://github.com/argoproj/argo-cd/tree/master/manifests/crds) into this [`charts/argo-cd/templates/crds` folder](https://github.com/argoproj/argo-helm/tree/master/charts/argo-cd/templates/crds).
|
||||||
|
|
||||||
## Upgrading
|
## Upgrading
|
||||||
|
|
||||||
### Custom resource definitions
|
### Custom resource definitions
|
||||||
|
|
||||||
|
Some users would prefer to install the CRDs _outside_ of the chart. You can disable the CRD installation of this chart by using `--set crds.install=false` when installing the chart.
|
||||||
|
|
||||||
Helm cannot upgrade custom resource definitions [by design](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations).
|
Helm cannot upgrade custom resource definitions [by design](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations).
|
||||||
|
|
||||||
Please use `kubectl` to upgrade CRDs manually from [crds](crds/) folder or via the manifests from the upstream project repo:
|
Please use `kubectl` to upgrade CRDs manually from [templates/crds](templates/crds/) folder or via the manifests from the upstream project repo:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=<appVersion>"
|
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=<appVersion>"
|
||||||
|
@ -98,6 +100,23 @@ kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=<appVer
|
||||||
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=v2.4.9"
|
kubectl apply -k "https://github.com/argoproj/argo-cd/manifests/crds?ref=v2.4.9"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 5.2.0
|
||||||
|
|
||||||
|
Custom resource definitions were moved to `templates` folder so they can be managed by Helm.
|
||||||
|
|
||||||
|
To adopt already created CRDs, please use following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
YOUR_ARGOCD_NAMESPACE="" # e.g. argo-cd
|
||||||
|
YOUR_ARGOCD_RELEASENAME="" # e.g. argo-cd
|
||||||
|
|
||||||
|
for crd in "applications.argoproj.io" "applicationsets.argoproj.io" "argocdextensions.argoproj.io" "appprojects.argoproj.io"; do
|
||||||
|
kubectl label --overwrite crd $crd app.kubernetes.io/managed-by=Helm
|
||||||
|
kubectl annotate --overwrite crd $crd meta.helm.sh/release-namespace="$YOUR_ARGOCD_NAMESPACE"
|
||||||
|
kubectl annotate --overwrite crd $crd meta.helm.sh/release-name="$YOUR_ARGOCD_RELEASENAME"
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
### 5.0.0
|
### 5.0.0
|
||||||
|
|
||||||
This version **removes support for**:
|
This version **removes support for**:
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
# Test with default values
|
# Test with default values
|
||||||
|
crds:
|
||||||
|
keep: false
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
crds:
|
||||||
|
keep: false
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
# Test High Availability with autoscaling
|
# Test High Availability with autoscaling
|
||||||
|
crds:
|
||||||
|
keep: false
|
||||||
|
|
||||||
redis-ha:
|
redis-ha:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
# Test High Availability without autoscaling
|
# Test High Availability without autoscaling
|
||||||
|
crds:
|
||||||
|
keep: false
|
||||||
|
|
||||||
redis-ha:
|
redis-ha:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
|
{{- if .Values.crds.install }}
|
||||||
apiVersion: apiextensions.k8s.io/v1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.crds.keep }}
|
||||||
|
"helm.sh/resource-policy": keep
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.crds.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: applications.argoproj.io
|
app.kubernetes.io/name: applications.argoproj.io
|
||||||
app.kubernetes.io/part-of: argocd
|
app.kubernetes.io/part-of: argocd
|
||||||
|
@ -2147,4 +2155,5 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
subresources: {}
|
subresources: {}
|
||||||
|
{{- end }}
|
|
@ -1,6 +1,14 @@
|
||||||
|
{{- if .Values.crds.install }}
|
||||||
apiVersion: apiextensions.k8s.io/v1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.crds.keep }}
|
||||||
|
"helm.sh/resource-policy": keep
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.crds.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: applicationsets.argoproj.io
|
app.kubernetes.io/name: applicationsets.argoproj.io
|
||||||
app.kubernetes.io/part-of: argocd
|
app.kubernetes.io/part-of: argocd
|
||||||
|
@ -6526,4 +6534,5 @@ spec:
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
subresources:
|
subresources:
|
||||||
status: {}
|
status: {}
|
||||||
|
{{- end }}
|
|
@ -1,6 +1,14 @@
|
||||||
|
{{- if .Values.crds.install }}
|
||||||
apiVersion: apiextensions.k8s.io/v1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.crds.keep }}
|
||||||
|
"helm.sh/resource-policy": keep
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.crds.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: argocdextensions.argoproj.io
|
app.kubernetes.io/name: argocdextensions.argoproj.io
|
||||||
app.kubernetes.io/part-of: argocd
|
app.kubernetes.io/part-of: argocd
|
||||||
|
@ -94,3 +102,4 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
|
{{- end }}
|
|
@ -1,6 +1,14 @@
|
||||||
|
{{- if .Values.crds.install }}
|
||||||
apiVersion: apiextensions.k8s.io/v1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.crds.keep }}
|
||||||
|
"helm.sh/resource-policy": keep
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.crds.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: appprojects.argoproj.io
|
app.kubernetes.io/name: appprojects.argoproj.io
|
||||||
app.kubernetes.io/part-of: argocd
|
app.kubernetes.io/part-of: argocd
|
||||||
|
@ -310,3 +318,4 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
|
{{- end }}
|
|
@ -9,6 +9,15 @@ fullnameOverride: ""
|
||||||
# -- Override the Kubernetes version, which is used to evaluate certain manifests
|
# -- Override the Kubernetes version, which is used to evaluate certain manifests
|
||||||
kubeVersionOverride: ""
|
kubeVersionOverride: ""
|
||||||
|
|
||||||
|
## Custom resource configuration
|
||||||
|
crds:
|
||||||
|
# -- Install and upgrade CRDs
|
||||||
|
install: true
|
||||||
|
# -- Keep CRDs on chart uninstall
|
||||||
|
keep: true
|
||||||
|
# -- Annotations to be added to all CRDs
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
global:
|
global:
|
||||||
image:
|
image:
|
||||||
# -- If defined, a repository applied to all Argo CD deployments
|
# -- If defined, a repository applied to all Argo CD deployments
|
||||||
|
|
Loading…
Reference in a new issue