Skip to content

Commit 5cfcd59

Browse files
committed
Make sure that the Scylla config ConfigMap exists when Scylla gets created (#4871)
## Motivation We're setting Scylla settings using this ConfigMap, but there's actually no guarantee that it will exist by the time Scylla starts. I've seen networks deployed that just ignore the ConfigMap and use default settings, for example, because the ConfigMap wasn't created yet when Scylla started. ## Proposal Enforce that the ConfigMap will be created before Scylla starts. ## Test Plan Deployed a network, it uses the ConfigMap options more reliably now ## Release Plan - These changes should be backported to the latest `testnet` branch, then - be released in a validator hotfix.
1 parent a9f55eb commit 5cfcd59

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)