Skip to content

Commit

Permalink
fix(manifests): use params CM and env var for redis server (#13214) (#…
Browse files Browse the repository at this point in the history
…13396)

* fix(manifests): use params CM and env var for redis server (#13214)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* add release note

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* rephrase

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* rephrase

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
  • Loading branch information
crenshaw-dev committed May 1, 2023
1 parent 8645ad2 commit 064c8da
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 50 deletions.
9 changes: 9 additions & 0 deletions docs/operator-manual/upgrading/2.6-2.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,12 @@ Read the full [documentation](../deep_links.md) to see all possible combinations
Argo CD now supports the `helm.sh/resource-policy` annotation to control the deletion of resources. The behavior is the same as the behavior of
`argocd.argoproj.io/sync-options: Delete=false` annotation: if the annotation is present and set to `keep`, the resource will not be deleted
when the application is deleted.

## Check your Kustomize patches for `--redis` changes

Starting in Argo CD 2.7, the install manifests no longer pass the Redis server name via `--redis`.

If your environment uses Kustomize JSON patches to modify the Redis server name, the patch might break when you upgrade
to the 2.7 manifests. If it does, you can remove the patch and instead set the Redis server name via the `redis.server`
field in the argocd-cmd-params-cm ConfigMap. That value will be passed to the necessary components via `valueFrom`
environment variables.
3 changes: 0 additions & 3 deletions manifests/base/redis/argocd-redis-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ spec:
- ""
- "--appendonly"
- "no"
env:
- name: ARGOCD_REDIS_SERVICE
value: ""
ports:
- containerPort: 6379
securityContext:
Expand Down
12 changes: 0 additions & 12 deletions manifests/base/redis/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,3 @@ resources:
- argocd-redis-sa.yaml
- argocd-redis-service.yaml
- argocd-redis-network-policy.yaml

replacements:
- source:
kind: Service
name: argocd-redis
version: v1
targets:
- select:
kind: Deployment
name: argocd-redis
fieldPaths:
- spec.template.spec.containers.[name=redis].env.[name=ARGOCD_REDIS_SERVICE].value
2 changes: 0 additions & 2 deletions manifests/base/repo-server/argocd-repo-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ spec:
imagePullPolicy: Always
args:
- /usr/local/bin/argocd-repo-server
- "--redis"
- "$(ARGOCD_REDIS_SERVICE):6379"
env:
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
Expand Down
5 changes: 0 additions & 5 deletions manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16807,9 +16807,6 @@ spec:
- ""
- --appendonly
- "no"
env:
- name: ARGOCD_REDIS_SERVICE
value: argocd-redis
image: redis:7.0.11-alpine
imagePullPolicy: Always
name: redis
Expand Down Expand Up @@ -16863,8 +16860,6 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- $(ARGOCD_REDIS_SERVICE):6379
env:
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
Expand Down
1 change: 1 addition & 0 deletions manifests/ha/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ patches:
- path: overlays/argocd-repo-server-deployment.yaml
- path: overlays/argocd-server-deployment.yaml
- path: overlays/argocd-application-controller-statefulset.yaml
- path: overlays/argocd-cmd-params-cm.yaml


images:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ spec:
- name: argocd-application-controller
args:
- /usr/local/bin/argocd-application-controller
- --redis
- "argocd-redis-ha-haproxy:6379"
env:
- name: ARGOCD_REDIS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: redis.server
6 changes: 6 additions & 0 deletions manifests/ha/base/overlays/argocd-cmd-params-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cmd-params-cm
data:
redis.server: argocd-redis-ha-haproxy:6379
8 changes: 6 additions & 2 deletions manifests/ha/base/overlays/argocd-repo-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ spec:
- name: argocd-repo-server
args:
- /usr/local/bin/argocd-repo-server
- --redis
- "argocd-redis-ha-haproxy:6379"
env:
- name: ARGOCD_REDIS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: redis.server
7 changes: 5 additions & 2 deletions manifests/ha/base/overlays/argocd-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ spec:
env:
- name: ARGOCD_API_SERVER_REPLICAS
value: '2'
- name: ARGOCD_REDIS
valueFrom:
configMapKeyRef:
name: argocd-cmd-params-cm
key: redis.server
args:
- /usr/local/bin/argocd-server
- --redis
- "argocd-redis-ha-haproxy:6379"
23 changes: 17 additions & 6 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16777,6 +16777,8 @@ metadata:
name: argocd-cm
---
apiVersion: v1
data:
redis.server: argocd-redis-ha-haproxy:6379
kind: ConfigMap
metadata:
labels:
Expand Down Expand Up @@ -18284,9 +18286,12 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- argocd-redis-ha-haproxy:6379
env:
- name: ARGOCD_REDIS
valueFrom:
configMapKeyRef:
key: redis.server
name: argocd-cmd-params-cm
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
configMapKeyRef:
Expand Down Expand Up @@ -18547,11 +18552,14 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-server
- --redis
- argocd-redis-ha-haproxy:6379
env:
- name: ARGOCD_API_SERVER_REPLICAS
value: "2"
- name: ARGOCD_REDIS
valueFrom:
configMapKeyRef:
key: redis.server
name: argocd-cmd-params-cm
- name: ARGOCD_SERVER_INSECURE
valueFrom:
configMapKeyRef:
Expand Down Expand Up @@ -18855,9 +18863,12 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-application-controller
- --redis
- argocd-redis-ha-haproxy:6379
env:
- name: ARGOCD_REDIS
valueFrom:
configMapKeyRef:
key: redis.server
name: argocd-cmd-params-cm
- name: ARGOCD_CONTROLLER_REPLICAS
value: "1"
- name: ARGOCD_RECONCILIATION_TIMEOUT
Expand Down
23 changes: 17 additions & 6 deletions manifests/ha/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ metadata:
name: argocd-cm
---
apiVersion: v1
data:
redis.server: argocd-redis-ha-haproxy:6379
kind: ConfigMap
metadata:
labels:
Expand Down Expand Up @@ -1944,9 +1946,12 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- argocd-redis-ha-haproxy:6379
env:
- name: ARGOCD_REDIS
valueFrom:
configMapKeyRef:
key: redis.server
name: argocd-cmd-params-cm
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
configMapKeyRef:
Expand Down Expand Up @@ -2207,11 +2212,14 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-server
- --redis
- argocd-redis-ha-haproxy:6379
env:
- name: ARGOCD_API_SERVER_REPLICAS
value: "2"
- name: ARGOCD_REDIS
valueFrom:
configMapKeyRef:
key: redis.server
name: argocd-cmd-params-cm
- name: ARGOCD_SERVER_INSECURE
valueFrom:
configMapKeyRef:
Expand Down Expand Up @@ -2515,9 +2523,12 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-application-controller
- --redis
- argocd-redis-ha-haproxy:6379
env:
- name: ARGOCD_REDIS
valueFrom:
configMapKeyRef:
key: redis.server
name: argocd-cmd-params-cm
- name: ARGOCD_CONTROLLER_REPLICAS
value: "1"
- name: ARGOCD_RECONCILIATION_TIMEOUT
Expand Down
5 changes: 0 additions & 5 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17307,9 +17307,6 @@ spec:
- ""
- --appendonly
- "no"
env:
- name: ARGOCD_REDIS_SERVICE
value: argocd-redis
image: redis:7.0.11-alpine
imagePullPolicy: Always
name: redis
Expand Down Expand Up @@ -17363,8 +17360,6 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- $(ARGOCD_REDIS_SERVICE):6379
env:
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
Expand Down
5 changes: 0 additions & 5 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -967,9 +967,6 @@ spec:
- ""
- --appendonly
- "no"
env:
- name: ARGOCD_REDIS_SERVICE
value: argocd-redis
image: redis:7.0.11-alpine
imagePullPolicy: Always
name: redis
Expand Down Expand Up @@ -1023,8 +1020,6 @@ spec:
containers:
- args:
- /usr/local/bin/argocd-repo-server
- --redis
- $(ARGOCD_REDIS_SERVICE):6379
env:
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
Expand Down

0 comments on commit 064c8da

Please sign in to comment.