Skip to content

Commit ca423ad

Browse files
authored
BC-10251 replace bitnami valkey (#73)
1 parent 9219438 commit ca423ad

File tree

6 files changed

+161
-59
lines changed

6 files changed

+161
-59
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
TLDRAW_VALKEY_CHART_VERSION: 3.0.22
1+
# https://github.com/groundhog2k/helm-charts/blob/master/charts/valkey/RELEASENOTES.md
2+
TLDRAW_VALKEY_CHART_VERSION: 2.2.1
3+
TLDRAW_VALKEY_IMAGE_VERSION: 9.0.0
4+
TLDRAW_VALKEY_REDIS_EXPORTER_IMAGE_VERSION: v1.80.0
25
TLDRAW_VALKEY_REPLICAS: 3

ansible/roles/tldraw-valkey/tasks/main.yml

Lines changed: 32 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,44 @@
77
tags:
88
- 1password
99

10+
- name: External Secret tldraw-valkey-config
11+
kubernetes.core.k8s:
12+
kubeconfig: ~/.kube/config
13+
namespace: "{{ NAMESPACE }}"
14+
template: es-valkey-config.yml.j2
15+
when: EXTERNAL_SECRETS_OPERATOR
16+
tags:
17+
- 1password
18+
19+
- name: External Secret tldraw-valkey-sentinel-config
20+
kubernetes.core.k8s:
21+
kubeconfig: ~/.kube/config
22+
namespace: "{{ NAMESPACE }}"
23+
template: es-valkey-sentinel-config.yml.j2
24+
when: EXTERNAL_SECRETS_OPERATOR
25+
tags:
26+
- 1password
27+
28+
- name: External Secret tldraw-valkey-exporter
29+
kubernetes.core.k8s:
30+
kubeconfig: ~/.kube/config
31+
namespace: "{{ NAMESPACE }}"
32+
template: es-valkey-exporter.yml.j2
33+
when: EXTERNAL_SECRETS_OPERATOR
34+
tags:
35+
- 1password
36+
1037
- name: Install valkey sentinel
1138
kubernetes.core.helm:
12-
chart_ref: oci://docker.io/bitnamicharts/valkey
13-
chart_version: "{{ TLDRAW_VALKEY_CHART_VERSION }}"
39+
chart_repo_url: "https://groundhog2k.github.io/helm-charts/"
40+
chart_ref: valkey
41+
chart_version: '{{ TLDRAW_VALKEY_CHART_VERSION }}'
1442
release_name: tldraw-valkey
15-
release_namespace: "{{ NAMESPACE }}"
43+
release_namespace: '{{ NAMESPACE }}'
1644
release_state: present
1745
create_namespace: yes
1846
kubeconfig: ~/.kube/config
1947
update_repo_cache: no
20-
values:
21-
global:
22-
defaultStorageClass: "{{ SC_DEFAULT_STORAGE_CLASS_NAME }}"
23-
security:
24-
allowInsecureImages: true
25-
image:
26-
repository: "bitnamilegacy/valkey"
27-
replica:
28-
replicaCount: "{{ TLDRAW_VALKEY_REPLICAS }}"
29-
pdb:
30-
create: false
31-
resources:
32-
limits:
33-
cpu: "{{ TLDRAW_VALKEY_CPU_LIMITS|default('1000m', true) }}"
34-
memory: "{{ TLDRAW_VALKEY_MEMORY_LIMITS|default('4Gi', true) }}"
35-
requests:
36-
cpu: "{{ TLDRAW_VALKEY_CPU_REQUESTS|default('100m', true) }}"
37-
memory: "{{ TLDRAW_VALKEY_MEMORY_REQUESTS|default('1Gi', true) }}"
38-
primary:
39-
pdb:
40-
create: false
41-
readinessProbe:
42-
timeoutSeconds: 5
43-
resources:
44-
limits:
45-
cpu: "{{ TLDRAW_VALKEY_CPU_LIMITS|default('1000m', true) }}"
46-
memory: "{{ TLDRAW_VALKEY_MEMORY_LIMITS|default('4Gi', true) }}"
47-
requests:
48-
cpu: "{{ TLDRAW_VALKEY_CPU_REQUESTS|default('100m', true) }}"
49-
memory: "{{ TLDRAW_VALKEY_MEMORY_REQUESTS|default('1Gi', true) }}"
50-
auth:
51-
existingSecret: tldraw-valkey-password
52-
existingSecretPasswordKey: REDIS_SENTINEL_PASSWORD
53-
usePasswordFiles: false
54-
sentinel:
55-
enabled: true
56-
image:
57-
repository: "bitnamilegacy/valkey-sentinel"
58-
readinessProbe:
59-
timeoutSeconds: 5
60-
metrics:
61-
enabled: true
62-
image:
63-
repository: "bitnamilegacy/redis-exporter"
64-
podMonitor:
65-
enabled: true
66-
serviceMonitor:
67-
enabled: true
68-
# OPS-6762 still up to debate if we will enable this
69-
networkPolicy:
70-
enabled: false
71-
serviceAccount:
72-
create: false
73-
# https://github.com/bitnami/charts/issues/9689
74-
useHostnames: false
48+
values: "{{ lookup('template', 'values.yml.j2') | from_yaml }}"
7549
tags:
7650
- helm
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: external-secrets.io/v1
2+
kind: ExternalSecret
3+
metadata:
4+
name: tldraw-valkey-config
5+
namespace: {{ NAMESPACE }}
6+
labels:
7+
app: tldraw-valkey
8+
spec:
9+
refreshInterval: {{ EXTERNAL_SECRETS_REFRESH_INTERVAL }}
10+
secretStoreRef:
11+
kind: SecretStore
12+
name: {{ EXTERNAL_SECRETS_K8S_STORE }}
13+
target:
14+
name: tldraw-valkey-config
15+
template:
16+
engineVersion: v2
17+
data:
18+
valkey-auth.conf: |
19+
requirepass "{% raw %}{{ .REDIS_SENTINEL_PASSWORD }}{% endraw %}"
20+
masterauth "{% raw %}{{ .REDIS_SENTINEL_PASSWORD }}{% endraw %}"
21+
dataFrom:
22+
- extract:
23+
key: tldraw-valkey-password
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: external-secrets.io/v1
2+
kind: ExternalSecret
3+
metadata:
4+
name: tldraw-valkey-exporter
5+
namespace: {{ NAMESPACE }}
6+
labels:
7+
app: tldraw-valkey
8+
spec:
9+
refreshInterval: {{ EXTERNAL_SECRETS_REFRESH_INTERVAL }}
10+
secretStoreRef:
11+
kind: SecretStore
12+
name: {{ EXTERNAL_SECRETS_K8S_STORE }}
13+
target:
14+
name: tldraw-valkey-exporter
15+
template:
16+
engineVersion: v2
17+
data:
18+
REDIS_PASSWORD: "{% raw %}{{ .REDIS_SENTINEL_PASSWORD }}{% endraw %}"
19+
dataFrom:
20+
- extract:
21+
key: tldraw-valkey-password
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: external-secrets.io/v1
2+
kind: ExternalSecret
3+
metadata:
4+
name: tldraw-valkey-sentinel-config
5+
namespace: {{ NAMESPACE }}
6+
labels:
7+
app: tldraw-valkey
8+
spec:
9+
refreshInterval: {{ EXTERNAL_SECRETS_REFRESH_INTERVAL }}
10+
secretStoreRef:
11+
kind: SecretStore
12+
name: {{ EXTERNAL_SECRETS_K8S_STORE }}
13+
target:
14+
name: tldraw-valkey-sentinel-config
15+
template:
16+
engineVersion: v2
17+
data:
18+
sentinel-auth.conf: |
19+
sentinel auth-pass myprimary "{% raw %}{{ .REDIS_SENTINEL_PASSWORD }}{% endraw %}"
20+
dataFrom:
21+
- extract:
22+
key: tldraw-valkey-password
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
storage:
2+
className: "{{ SC_DEFAULT_STORAGE_CLASS_NAME }}"
3+
4+
haMode:
5+
enabled: true
6+
replicas: {{ TLDRAW_VALKEY_REPLICAS }}
7+
masterGroupName: myprimary
8+
9+
image:
10+
registry: "docker.io"
11+
repository: "valkey/valkey"
12+
tag: "{{ TLDRAW_VALKEY_IMAGE_VERSION }}"
13+
14+
resources:
15+
limits:
16+
cpu: "{{ TLDRAW_VALKEY_CPU_LIMITS|default('1000m', true) }}"
17+
memory: "{{ TLDRAW_VALKEY_MEMORY_LIMITS|default('4Gi', true) }}"
18+
requests:
19+
cpu: "{{ TLDRAW_VALKEY_CPU_REQUESTS|default('100m', true) }}"
20+
memory: "{{ TLDRAW_VALKEY_MEMORY_REQUESTS|default('1Gi', true) }}"
21+
22+
sentinelResources:
23+
limits:
24+
cpu: "{{ TLDRAW_VALKEY_SENTINEL_CPU_LIMITS|default('150m', true) }}"
25+
memory: "{{ TLDRAW_VALKEY_SENTINEL_MEMORY_LIMITS|default('192Mi', true) }}"
26+
requests:
27+
cpu: "{{ TLDRAW_VALKEY_SENTINEL_CPU_REQUESTS|default('100m', true) }}"
28+
memory: "{{ TLDRAW_VALKEY_SENTINEL_MEMORY_REQUESTS|default('128Mi', true) }}"
29+
30+
extraSecretValkeyConfigs: "tldraw-valkey-config"
31+
extraSecretSentinelConfigs: "tldraw-valkey-sentinel-config"
32+
33+
metrics:
34+
enabled: true
35+
exporter:
36+
image:
37+
registry: "docker.io"
38+
repository: "oliver006/redis_exporter"
39+
tag: "{{ TLDRAW_VALKEY_REDIS_EXPORTER_IMAGE_VERSION }}"
40+
resources:
41+
limits:
42+
cpu: "{{ TLDRAW_VALKEY_EXPORTER_CPU_LIMITS|default('150m', true) }}"
43+
memory: "{{ TLDRAW_VALKEY_EXPORTER_MEMORY_LIMITS|default('192Mi', true) }}"
44+
requests:
45+
cpu: "{{ TLDRAW_VALKEY_EXPORTER_CPU_REQUESTS|default('100m', true) }}"
46+
memory: "{{ TLDRAW_VALKEY_EXPORTER_MEMORY_REQUESTS|default('128Mi', true) }}"
47+
args:
48+
- --check-key-groups=(jwt):.+
49+
extraExporterEnvSecrets:
50+
- "tldraw-valkey-exporter"
51+
serviceMonitor:
52+
interval: 30s
53+
extraEndpointParameters:
54+
metricRelabelings:
55+
- sourceLabels: [ __name__ ]
56+
regex: redis_key_group_count
57+
action: replace
58+
targetLabel: longterm
59+
replacement: "true"

0 commit comments

Comments
 (0)