Skip to content

Commit 679c08f

Browse files
committed
chore(controller): use valkey replace redis
1 parent 89ad67c commit 679c08f

19 files changed

Lines changed: 101 additions & 124 deletions

charts/controller/templates/_helpers.tpl

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ env:
6161
secretKeyRef:
6262
name: builder-key-auth
6363
key: builder-key
64+
{{- if (.Values.valkeyUrl) }}
65+
- name: DRYCC_VALKEY_URL
66+
valueFrom:
67+
secretKeyRef:
68+
name: controller-creds
69+
key: valkey-url
70+
{{- else if eq .Values.global.valkeyLocation "on-cluster" }}
71+
- name: VALKEY_PASSWORD
72+
valueFrom:
73+
secretKeyRef:
74+
name: valkey-creds
75+
key: password
76+
- name: DRYCC_VALKEY_URL
77+
value: "redis://:$(VALKEY_PASSWORD)@drycc-valkey.{{.Release.Namespace}}.svc.{{.Values.global.clusterDomain}}:16379/0"
78+
{{- end }}
6479
{{- if (.Values.databaseReplicaUrl) }}
6580
- name: DRYCC_DATABASE_REPLICA_URL
6681
valueFrom:
@@ -102,23 +117,13 @@ env:
102117
valueFrom:
103118
fieldRef:
104119
fieldPath: metadata.namespace
105-
- name: DRYCC_REDIS_ADDRS
106-
valueFrom:
107-
secretKeyRef:
108-
name: redis-creds
109-
key: addrs
110-
- name: DRYCC_REDIS_PASSWORD
111-
valueFrom:
112-
secretKeyRef:
113-
name: redis-creds
114-
key: password
115-
{{- if eq .Values.global.rabbitmqLocation "off-cluster" }}
120+
{{- if (.Values.prometheusUrl) }}
116121
- name: "DRYCC_PROMETHEUS_URL"
117122
valueFrom:
118123
secretKeyRef:
119-
name: prometheus-creds
120-
key: url
121-
{{- else }}
124+
name: controller-creds
125+
key: prometheus-url
126+
{{- else if eq .Values.global.prometheusLocation "on-cluster" }}
122127
- name: "DRYCC_PROMETHEUS_USERNAME"
123128
valueFrom:
124129
secretKeyRef:
@@ -132,26 +137,6 @@ env:
132137
- name: "DRYCC_PROMETHEUS_URL"
133138
value: "http://$(DRYCC_PROMETHEUS_USERNAME):$(DRYCC_PROMETHEUS_PASSWORD)@drycc-prometheus.{{$.Release.Namespace}}.svc.{{$.Values.global.clusterDomain}}:9090"
134139
{{- end }}
135-
{{- if (.Values.rabbitmqUrl) }}
136-
- name: DRYCC_RABBITMQ_URL
137-
valueFrom:
138-
secretKeyRef:
139-
name: controller-creds
140-
key: rabbitmq-url
141-
{{- else if eq .Values.global.rabbitmqLocation "on-cluster" }}
142-
- name: "DRYCC_RABBITMQ_USERNAME"
143-
valueFrom:
144-
secretKeyRef:
145-
name: rabbitmq-creds
146-
key: username
147-
- name: "DRYCC_RABBITMQ_PASSWORD"
148-
valueFrom:
149-
secretKeyRef:
150-
name: rabbitmq-creds
151-
key: password
152-
- name: "DRYCC_RABBITMQ_URL"
153-
value: "amqp://$(DRYCC_RABBITMQ_USERNAME):$(DRYCC_RABBITMQ_PASSWORD)@drycc-rabbitmq.{{$.Release.Namespace}}.svc.{{$.Values.global.clusterDomain}}:5672/controller"
154-
{{- end }}
155140
{{- if eq .Values.global.passportLocation "on-cluster"}}
156141
- name: "DRYCC_PASSPORT_URL"
157142
{{- if .Values.global.certManagerEnabled }}

charts/controller/templates/controller-api-deployment.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ spec:
3434
- netcat
3535
- -v
3636
- -u
37-
- $(DRYCC_DATABASE_URL),$(DRYCC_DATABASE_REPLICA_URL),$(DRYCC_RABBITMQ_URL)
38-
- -a
39-
- $(DRYCC_REDIS_ADDRS)
37+
- $(DRYCC_DATABASE_URL),$(DRYCC_VALKEY_URL),$(DRYCC_DATABASE_REPLICA_URL)
4038
{{- include "controller.envs" . | indent 8 }}
4139
containers:
4240
- name: drycc-controller

charts/controller/templates/controller-celery-deloyment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ spec:
3434
- netcat
3535
- -v
3636
- -u
37-
- $(DRYCC_DATABASE_URL),$(DRYCC_DATABASE_REPLICA_URL),$(DRYCC_RABBITMQ_URL)
37+
- $(DRYCC_DATABASE_URL),$(DRYCC_VALKEY_URL),$(DRYCC_DATABASE_REPLICA_URL)
3838
- -a
39-
- $(DRYCC_REDIS_ADDRS),$(DRYCC_CONTROLLER_API_SERVICE_HOST):$(DRYCC_CONTROLLER_API_SERVICE_PORT)
39+
- $(DRYCC_CONTROLLER_API_SERVICE_HOST):$(DRYCC_CONTROLLER_API_SERVICE_PORT)
4040
{{- include "controller.envs" . | indent 8 }}
4141
containers:
4242
- name: drycc-controller-celery

charts/controller/templates/controller-cronjob-daily.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ spec:
2929
- netcat
3030
- -v
3131
- -u
32-
- $(DRYCC_DATABASE_URL),$(DRYCC_DATABASE_REPLICA_URL),$(DRYCC_RABBITMQ_URL)
32+
- $(DRYCC_DATABASE_URL),$(DRYCC_VALKEY_URL),$(DRYCC_DATABASE_REPLICA_URL)
3333
- -a
34-
- $(DRYCC_REDIS_ADDRS),$(DRYCC_CONTROLLER_API_SERVICE_HOST):$(DRYCC_CONTROLLER_API_SERVICE_PORT)
34+
- $(DRYCC_CONTROLLER_API_SERVICE_HOST):$(DRYCC_CONTROLLER_API_SERVICE_PORT)
3535
{{- include "controller.envs" . | indent 12 }}
3636
containers:
3737
- image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/controller:{{.Values.imageTag}}

charts/controller/templates/controller-cronjob-hourly.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ spec:
2929
- netcat
3030
- -v
3131
- -u
32-
- $(DRYCC_DATABASE_URL),$(DRYCC_DATABASE_REPLICA_URL),$(DRYCC_RABBITMQ_URL)
32+
- $(DRYCC_DATABASE_URL),$(DRYCC_VALKEY_URL),$(DRYCC_DATABASE_REPLICA_URL)
3333
- -a
34-
- $(DRYCC_REDIS_ADDRS),$(DRYCC_CONTROLLER_API_SERVICE_HOST):$(DRYCC_CONTROLLER_API_SERVICE_PORT)
34+
- $(DRYCC_CONTROLLER_API_SERVICE_HOST):$(DRYCC_CONTROLLER_API_SERVICE_PORT)
3535
{{- include "controller.envs" . | indent 12 }}
3636
containers:
3737
- image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/controller:{{.Values.imageTag}}

charts/controller/templates/controller-job-upgrade.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ spec:
1818
- netcat
1919
- -v
2020
- -u
21-
- $(DRYCC_DATABASE_URL),$(DRYCC_DATABASE_REPLICA_URL),$(DRYCC_RABBITMQ_URL)
22-
- -a
23-
- $(DRYCC_REDIS_ADDRS)
21+
- $(DRYCC_DATABASE_URL),$(DRYCC_VALKEY_URL),$(DRYCC_DATABASE_REPLICA_URL)
2422
{{- include "controller.envs" . | indent 8 }}
2523
containers:
2624
- name: drycc-controller-job-upgrade

charts/controller/templates/controller-mutate-deloyment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ spec:
2424
- netcat
2525
- -v
2626
- -u
27-
- $(DRYCC_DATABASE_URL),$(DRYCC_DATABASE_REPLICA_URL),$(DRYCC_RABBITMQ_URL)
27+
- $(DRYCC_DATABASE_URL),$(DRYCC_VALKEY_URL),$(DRYCC_DATABASE_REPLICA_URL)
2828
- -a
29-
- $(DRYCC_REDIS_ADDRS),$(DRYCC_CONTROLLER_API_SERVICE_HOST):$(DRYCC_CONTROLLER_API_SERVICE_PORT)
29+
- $(DRYCC_CONTROLLER_API_SERVICE_HOST):$(DRYCC_CONTROLLER_API_SERVICE_PORT)
3030
{{- include "controller.envs" . | indent 8 }}
3131
containers:
3232
- name: drycc-controller

charts/controller/templates/controller-secret-creds.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ metadata:
55
labels:
66
heritage: drycc
77
data:
8+
{{- if (.Values.valkeyUrl) }}
9+
valkey-url: {{ .Values.valkeyUrl | b64enc }}
10+
{{- end }}
811
{{- if (.Values.databaseUrl) }}
912
database-url: {{ .Values.databaseUrl | b64enc }}
1013
{{- end }}
1114
{{- if (.Values.databaseReplicaUrl) }}
1215
database-replica-url: {{ .Values.databaseReplicaUrl | b64enc }}
1316
{{- end }}
14-
{{- if (.Values.rabbitmqUrl) }}
15-
rabbitmq-url: {{ .Values.rabbitmqUrl | b64enc }}
17+
{{- if (.Values.prometheusUrl) }}
18+
prometheus-url: {{ .Values.prometheusUrl | b64enc }}
1619
{{- end }}
1720
{{- if (.Values.passportUrl) }}
1821
passport-url: {{ .Values.passportUrl | b64enc }}

charts/controller/values.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ mutateReplicas: 1
5454
# Forbid: The cron job does not allow concurrent runs; if it is time for a new job run and the previous job run hasn't finished yet, the cron job skips the new job run
5555
# Replace: If it is time for a new job run and the previous job run hasn't finished yet, the cron job replaces the currently running job run with a new job run
5656
concurrencyPolicy: "Replace"
57+
## valkeyUrl is will no longer use the built-in valkey component
58+
valkeyUrl: ""
5759
# databaseUrl and databaseReplicaUrl are will no longer use the built-in database component
5860
databaseUrl: ""
5961
databaseReplicaUrl: ""
@@ -66,9 +68,6 @@ workflowManagerUrl: ""
6668
workflowManagerAccessKey: ""
6769
workflowManagerSecretKey: ""
6870

69-
# Configuring this will no longer use the built-in rabbitmq component
70-
rabbitmqUrl: ""
71-
7271
# limit specs, plans config
7372
config:
7473
metrics: ""
@@ -131,9 +130,6 @@ mutate:
131130
extraMatchLabels:
132131
component: "drycc-controller-mutate"
133132

134-
redis:
135-
replicas: 1
136-
137133
storage:
138134
csi:
139135
storageClassName: drycc-storage
@@ -157,7 +153,6 @@ global:
157153
# configured above)
158154
# - off-cluster: Run PostgreSQL outside the Kubernetes cluster (configure in database section)
159155
databaseLocation: "on-cluster"
160-
161156
# Set the location of Workflow's Registry
162157
#
163158
# Valid values are:
@@ -186,3 +181,9 @@ global:
186181
# Whether cert_manager is enabled to automatically generate controller certificates
187182
certManagerEnabled: true
188183
passportLocation: "on-cluster"
184+
# Set the location of Workflow's prometheus cluster
185+
#
186+
# Valid values are:
187+
# - on-cluster: Run prometheus within the Kubernetes cluster
188+
# - off-cluster: prometheus is running outside of the cluster and credentials and connection information will be provided.
189+
prometheusLocation: "on-cluster"

rootfs/Dockerfile.test

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ COPY dev_requirements.txt ${DRYCC_HOME_DIR}/dev_requirements.txt
88

99
ENV PGDATA="/opt/drycc/postgresql/data" \
1010
PYTHON_VERSION="3.12" \
11-
REDIS_VERSION="7.2.4" \
12-
RABBITMQ_VERSION="3.12.13" \
11+
VALKEY_VERSION="8.0.1" \
1312
POSTGRES_VERSION="15.5" \
1413
GOSU_VERSION="1.17"
1514

@@ -18,8 +17,7 @@ RUN buildDeps='gcc rustc cargo libffi-dev musl-dev openssl'; \
1817
&& curl -SsL https://cli.codecov.io/latest/$([ $(dpkg --print-architecture) == "arm64" ] && echo linux-arm64 || echo linux)/codecov -o /usr/local/bin/codecov \
1918
&& chmod +x /usr/local/bin/codecov \
2019
&& install-stack python $PYTHON_VERSION \
21-
&& install-stack redis $REDIS_VERSION \
22-
&& install-stack rabbitmq $RABBITMQ_VERSION \
20+
&& install-stack valkey $VALKEY_VERSION \
2321
&& install-stack postgresql $POSTGRES_VERSION \
2422
&& install-stack gosu $GOSU_VERSION && . init-stack \
2523
&& python3 -m venv ${DRYCC_HOME_DIR}/.venv \

0 commit comments

Comments
 (0)