Skip to content

Commit 93767a4

Browse files
committed
Make sure that the Scylla config ConfigMap exists when Scylla gets created
1 parent b0fe256 commit 93767a4

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

kubernetes/linera-validator/helmfile.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,30 @@ releases:
9797
- scylla-operator/scylla-operator
9898
values:
9999
- {{ env "LINERA_HELMFILE_VALUES_SCYLLA" | default "scylla.values.yaml.gotmpl" }}
100-
{{- if and .Values.gcpRun .Values.usingLocalSsd }}
101100
hooks:
101+
- events: ["presync"]
102+
showlogs: true
103+
command: bash
104+
args:
105+
- -c
106+
- |
107+
set -euxo pipefail
108+
109+
kube_args=(
110+
{{- if .Values.kubeContext }}
111+
--context {{ .Values.kubeContext }}
112+
{{- end }}
113+
{{- if .Values.kubeConfigPath }}
114+
--kubeconfig {{ .Values.kubeConfigPath }}
115+
{{- end }}
116+
)
117+
118+
echo "Ensuring scylla namespace exists..."
119+
kubectl "${kube_args[@]}" create namespace scylla 2>/dev/null || true
120+
121+
echo "Ensuring scylla-config ConfigMap exists before deploying ScyllaCluster..."
122+
kubectl "${kube_args[@]}" apply -f templates/scylla-config.yaml
123+
{{- if and .Values.gcpRun .Values.usingLocalSsd }}
102124
- events: ["presync"]
103125
showlogs: true
104126
command: bash

kubernetes/linera-validator/templates/scylla-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ kind: ConfigMap
33
metadata:
44
name: scylla-config
55
namespace: scylla
6+
labels:
7+
app.kubernetes.io/managed-by: Helm
8+
annotations:
9+
meta.helm.sh/release-name: linera-core
10+
meta.helm.sh/release-namespace: default
611
data:
712
scylla.yaml: |
813
query_tombstone_page_limit: 200000

0 commit comments

Comments
 (0)