Skip to content

Commit d1cd1dc

Browse files
ncr38ncrbeingncr
andauthored
feat: Add Redis server address as ConfigMap param for agent and principal (#508)
Signed-off-by: navin <[email protected]> Signed-off-by: navin <[email protected]> Co-authored-by: navin <[email protected]>
1 parent d0f1678 commit d1cd1dc

File tree

10 files changed

+41
-4
lines changed

10 files changed

+41
-4
lines changed

docs/configuration/agent/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ The recommended approach for production deployments is to use ConfigMap entries
217217
#### Redis Address
218218
- **Command Line Flag**: `--redis-addr`
219219
- **Environment Variable**: `REDIS_ADDR`
220-
- **ConfigMap Entry**: *(Not available in ConfigMap)*
220+
- **ConfigMap Entry**: `agent.redis.address`
221221
- **Description**: The redis host to connect to
222222
- **Type**: String
223223
- **Default**: `"argocd-redis:6379"`

docs/configuration/principal/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ The recommended approach for production deployments is to use ConfigMap entries
341341
#### Redis Server Address
342342
- **Command Line Flag**: `--redis-server-address`
343343
- **Environment Variable**: `ARGOCD_PRINCIPAL_REDIS_SERVER_ADDRESS`
344-
- **ConfigMap Entry**: *(Not available in ConfigMap)*
344+
- **ConfigMap Entry**: `principal.redis.server.address`
345345
- **Description**: Redis server hostname and port
346346
- **Type**: String
347347
- **Default**: `"argocd-redis:6379"`

install/helm-repo/argocd-agent-agent/templates/agent-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ spec:
108108
name: argocd-agent-params
109109
key: agent.healthz.port
110110
optional: true
111+
- name: REDIS_ADDR
112+
valueFrom:
113+
configMapKeyRef:
114+
name: argocd-agent-params
115+
key: agent.redis.address
116+
optional: true
111117
name: argocd-agent-agent
112118
imagePullPolicy: Always
113119
image: "{{ .Values.image }}:{{ .Values.imageTag }}"

install/helm-repo/argocd-agent-agent/templates/agent-params-cm.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,7 @@ data:
5656
agent.metrics.port: {{ .Values.metricsPort | quote }}
5757
# agent.healthz.port: The port the health check server should listen on.
5858
# Default: 8002
59-
agent.healthz.port: {{ .Values.healthzPort | quote }}
59+
agent.healthz.port: {{ .Values.healthzPort | quote }}
60+
# agent.redis.address: The address of the Redis server.
61+
# Default: "argocd-redis:6379"
62+
agent.redis.address: {{ .Values.redisAddress | quote }}

install/helm-repo/argocd-agent-agent/templates/tests/test-configMap.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ spec:
118118
echo "✗ agent.healthz.port missing"
119119
exit 1
120120
fi
121+
122+
# Test agent.redis.address
123+
if [ -f /etc/config/agent.redis.address ]; then
124+
echo "✓ agent.redis.address exists"
125+
cat /etc/config/agent.redis.address
126+
else
127+
echo "✗ agent.redis.address missing"
128+
exit 1
129+
fi
121130

122131
echo "All ConfigMap keys verified successfully!"
123132
']

install/helm-repo/argocd-agent-agent/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ serverPort: "443"
2020
metricsPort: "8181"
2121
tlsClientInSecure: "false"
2222
healthzPort: "8002"
23+
redisAddress: "argocd-redis:6379"
2324
tlsClientKeyPath: "/app/config/tls/tls.key"
2425
tlsClientCertPath: "/app/config/tls/tls.crt"
2526
tlsRootCAPath: "/app/config/tls/ca.crt"

install/kubernetes/agent/agent-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ spec:
135135
name: argocd-agent-params
136136
key: agent.pprof.port
137137
optional: true
138+
- name: REDIS_ADDR
139+
valueFrom:
140+
configMapKeyRef:
141+
name: argocd-agent-params
142+
key: agent.redis.address
143+
optional: true
138144
- name: REDIS_PASSWORD
139145
valueFrom:
140146
secretKeyRef:

install/kubernetes/agent/agent-params-cm.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,7 @@ data:
8282
agent.pprof.port: "0"
8383
# agent.resource-proxy.enable: Whether to enable the resource proxy.
8484
# Default: true
85-
agent.resource-proxy.enable: "true"
85+
agent.resource-proxy.enable: "true"
86+
# agent.redis.address: The address of the Redis server.
87+
# Default: "argocd-redis:6379"
88+
agent.redis.address: "argocd-redis:6379"

install/kubernetes/principal/principal-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@ spec:
201201
name: argocd-agent-params
202202
key: principal.redis.compression.type
203203
optional: true
204+
- name: ARGOCD_PRINCIPAL_REDIS_SERVER_ADDRESS
205+
valueFrom:
206+
configMapKeyRef:
207+
name: argocd-agent-params
208+
key: principal.redis.server.address
209+
optional: true
204210
- name: ARGOCD_PRINCIPAL_ENABLE_RESOURCE_PROXY
205211
valueFrom:
206212
configMapKeyRef:

install/kubernetes/principal/principal-params-cm.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,6 @@ data:
137137
# principal.pprof.port: The port the pprof server will listen on.
138138
# Default: 0
139139
principal.pprof.port: "0"
140+
# principal.redis.server.address: The address of the Redis server.
141+
# Default: "argocd-redis:6379"
142+
principal.redis.server.address: "argocd-redis:6379"

0 commit comments

Comments
 (0)