chore(argo-cd): Add chart tests and usage info in README for HA (#951)

* chore: Reconfigure KinD to 1 control-plane and 3 worker nodes

This prepares chart testing of 'argo-cd' chart with redis-ha enabled. Redis-ha defines hard pod anti-affinity and requires multiple worker nodes.

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* chore(argo-cd): Add chart tests for HA

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* Add HA chapter to README

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* Skip HPA tests of ArgoCD

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
Marco Kilchhofer 2021-10-19 17:50:42 +02:00 committed by GitHub
parent 7ce743b266
commit fbea5aa49b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 95 additions and 3 deletions

7
.github/configs/kind-config.yaml vendored Normal file
View file

@ -0,0 +1,7 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker

View file

@ -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'

View file

@ -1,2 +1,3 @@
/*.tgz
output
ci/

View file

@ -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"

View file

@ -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).

View file

@ -0,0 +1 @@
# Test with default values

View file

@ -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

View file

@ -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