diff --git a/.github/configs/kind-config.yaml b/.github/configs/kind-config.yaml new file mode 100644 index 00000000..f4bf78cb --- /dev/null +++ b/.github/configs/kind-config.yaml @@ -0,0 +1,7 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: + - role: control-plane + - role: worker + - role: worker + - role: worker diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 3cc795ee..6dee7c2b 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -39,6 +39,8 @@ jobs: - name: Create kind cluster uses: helm/kind-action@v1.2.0 if: steps.list-changed.outputs.changed == 'true' + with: + config: .github/configs/kind-config.yaml - name: Deploy latest ArgoCD CRDs when testing ArgoCD extensions if: | @@ -48,6 +50,12 @@ jobs: run: | kubectl apply -f charts/argo-cd/crds + - name: Skip HPA tests of ArgoCD + if: contains(steps.list-changed.outputs.changed_charts, 'argo-cd') + run: | + ## Metrics API not available in kind cluster + rm charts/argo-cd/ci/ha-autoscaling-values.yaml + - name: Run chart-testing (install) run: ct install --config ./.github/configs/ct-install.yaml if: steps.list-changed.outputs.changed == 'true' diff --git a/charts/argo-cd/.helmignore b/charts/argo-cd/.helmignore index 94c89570..ebf177fc 100644 --- a/charts/argo-cd/.helmignore +++ b/charts/argo-cd/.helmignore @@ -1,2 +1,3 @@ /*.tgz output +ci/ diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 693a3e16..157ba164 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 2.1.3 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 3.25.2 +version: 3.25.3 home: https://github.com/argoproj/argo-helm icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png keywords: @@ -21,4 +21,4 @@ dependencies: condition: redis-ha.enabled annotations: artifacthub.io/changes: | - - "[Changed]: Reorganize some files in repo, move applications.yaml and projects.yaml into argocd-configs." + - "[Added]: Chart testing for HA setups" diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index 96633885..50711587 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -10,8 +10,52 @@ This is a **community maintained** chart. This chart installs [argo-cd](https:// The default installation is intended to be similar to the provided ArgoCD [releases](https://github.com/argoproj/argo-cd/releases). -This chart currently installs the non-HA version of ArgoCD. +## High Availability +This chart installs the non-HA version of ArgoCD by default. If you want to run ArgoCD in HA mode, you can use one of the example values in the next sections. +Please also have a look into the upstream [Operator Manual regarding High Availability](https://argoproj.github.io/argo-cd/operator-manual/high_availability/) to understand how scaling of ArgoCD works in detail. + +> **Warning:** +> You need at least 3 worker nodes as the HA mode of redis enforces Pods to run on separate nodes. + +### HA mode with autoscaling + +```yaml +redis-ha: + enabled: true + +controller: + enableStatefulSet: true + +server: + autoscaling: + enabled: true + minReplicas: 2 + +repoServer: + autoscaling: + enabled: true + minReplicas: 2 +``` + +### HA mode without autoscaling + +```yaml +redis-ha: + enabled: true + +controller: + enableStatefulSet: true + +server: + replicas: 2 + env: + - name: ARGOCD_API_SERVER_REPLICAS + value: '2' + +repoServer: + replicas: 2 +``` ### Synchronizing Changes from Original Repository In the original [ArgoCD repository](https://github.com/argoproj/argo-cd/) an [`manifests/install.yaml`](https://github.com/argoproj/argo-cd/blob/master/manifests/install.yaml) is generated using `kustomize`. It's the basis for the installation as [described in the docs](https://argo-cd.readthedocs.io/en/stable/getting_started/#1-install-argo-cd). diff --git a/charts/argo-cd/ci/default-values.yaml b/charts/argo-cd/ci/default-values.yaml new file mode 100644 index 00000000..507f1e54 --- /dev/null +++ b/charts/argo-cd/ci/default-values.yaml @@ -0,0 +1 @@ +# Test with default values diff --git a/charts/argo-cd/ci/ha-autoscaling-values.yaml b/charts/argo-cd/ci/ha-autoscaling-values.yaml new file mode 100644 index 00000000..b9a9e535 --- /dev/null +++ b/charts/argo-cd/ci/ha-autoscaling-values.yaml @@ -0,0 +1,16 @@ +# Test High Availability with autoscaling +redis-ha: + enabled: true + +controller: + enableStatefulSet: true + +server: + autoscaling: + enabled: true + minReplicas: 2 + +repoServer: + autoscaling: + enabled: true + minReplicas: 2 diff --git a/charts/argo-cd/ci/ha-static-values.yaml b/charts/argo-cd/ci/ha-static-values.yaml new file mode 100644 index 00000000..7acda8d1 --- /dev/null +++ b/charts/argo-cd/ci/ha-static-values.yaml @@ -0,0 +1,15 @@ +# Test High Availability without autoscaling +redis-ha: + enabled: true + +controller: + enableStatefulSet: true + +server: + replicas: 2 + env: + - name: ARGOCD_API_SERVER_REPLICAS + value: '2' + +repoServer: + replicas: 2