Skip to content

Commit 16f3514

Browse files
committed
chore(charts): use condition
1 parent 3322bf8 commit 16f3514

3 files changed

Lines changed: 24 additions & 37 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{/* Generate fluentbit envs */}}
2+
{{- define "fluentbit.envs" }}
3+
env:
4+
{{- if (.Values.valkeyUrl) }}
5+
- name: DRYCC_VALKEY_URL
6+
valueFrom:
7+
secretKeyRef:
8+
name: logger-fluentbit-creds
9+
key: valkey-url
10+
{{- else if .Values.valkey.enabled }}
11+
- name: VALKEY_PASSWORD
12+
valueFrom:
13+
secretKeyRef:
14+
name: valkey-creds
15+
key: password
16+
- name: DRYCC_VALKEY_URL
17+
value: "redis://:$(VALKEY_PASSWORD)@drycc-valkey.{{.Release.Namespace}}.svc.{{.Values.global.clusterDomain}}:16379/2"
18+
{{- end }}
19+
{{- end }}

charts/fluentbit/templates/logger-fluentbit-daemon.yaml

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,7 @@ spec:
3030
- -v
3131
- -u
3232
- $(DRYCC_VALKEY_URL)
33-
env:
34-
{{- if (.Values.valkeyUrl) }}
35-
- name: DRYCC_VALKEY_URL
36-
valueFrom:
37-
secretKeyRef:
38-
name: logger-fluentbit-creds
39-
key: valkey-url
40-
{{- else if eq .Values.global.valkeyLocation "on-cluster" }}
41-
- name: VALKEY_PASSWORD
42-
valueFrom:
43-
secretKeyRef:
44-
name: valkey-creds
45-
key: password
46-
- name: DRYCC_VALKEY_URL
47-
value: "redis://:$(VALKEY_PASSWORD)@drycc-valkey.{{.Release.Namespace}}.svc.{{.Values.global.clusterDomain}}:16379/2"
48-
{{- end }}
33+
{{- include "fluentbit.envs" . | indent 8 }}
4934
containers:
5035
- name: drycc-logger-fluentbit
5136
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/fluentbit:{{.Values.imageTag}}
@@ -64,27 +49,7 @@ spec:
6449
memory: {{.Values.limitsMemory}}
6550
{{- end}}
6651
{{- end}}
67-
env:
68-
{{- if (.Values.valkeyUrl) }}
69-
- name: DRYCC_VALKEY_URL
70-
valueFrom:
71-
secretKeyRef:
72-
name: logger-fluentbit-creds
73-
key: valkey-url
74-
{{- else if eq .Values.global.valkeyLocation "on-cluster" }}
75-
- name: VALKEY_PASSWORD
76-
valueFrom:
77-
secretKeyRef:
78-
name: valkey-creds
79-
key: password
80-
- name: DRYCC_VALKEY_URL
81-
value: "redis://:$(VALKEY_PASSWORD)@drycc-valkey.{{.Release.Namespace}}.svc.{{.Values.global.clusterDomain}}:16379/2"
82-
{{- end }}
83-
- name: DRYCC_VALKEY_PASSWORD
84-
valueFrom:
85-
secretKeyRef:
86-
name: valkey-creds
87-
key: password
52+
{{- include "fluentbit.envs" . | indent 8 }}
8853
volumeMounts:
8954
- name: varlog
9055
mountPath: /var/log

charts/fluentbit/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,6 @@ config:
9292
plugins: |
9393
[PLUGINS]
9494
Path ${FLUENT_BIT_PLUGINS_PATH}/out_drycc.so
95+
96+
valkey:
97+
enabled: true

0 commit comments

Comments
 (0)