Skip to content

Commit a7f648d

Browse files
authored
Use proper kube context and kube config in helmfile (#3917)
## Motivation When deploying multiple networks in parallel, we need to make sure that helmfile is using the proper kube context and kube config, to prevent it from trying to deploy to an incorrect cluster. ## Proposal Pass those in and use them when appropriate ## Test Plan Deployed networks in parallel using local SSD, it works. ## Release Plan - Nothing to do / These changes follow the usual release cycle.
1 parent 7e02ebe commit a7f648d

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

kubernetes/linera-validator/helmfile.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ environments:
44
- writeToGrafanaCloud: {{ env "LINERA_WRITE_TO_GRAFANA_CLOUD" | default "false" }}
55
validatorLabel: {{ env "LINERA_VALIDATOR_LABEL" | default (printf "local-%s" (env "USER")) }}
66
usingLocalSsd: {{ env "LINERA_HELMFILE_SET_USING_LOCAL_SSD" | default "false" }}
7+
kubeContext: {{ env "LINERA_HELMFILE_SET_KUBE_CONTEXT" | default "" }}
8+
kubeConfigPath: {{ env "KUBECONFIG" | default "" }}
79

810
helmDefaults:
911
wait: true
1012
recreatePods: false
13+
kubeContext: {{ .Values.kubeContext | quote }}
1114

1215
{{- if .Values.usingLocalSsd }}
1316
hooks:
@@ -17,15 +20,26 @@ hooks:
1720
args:
1821
- -c
1922
- |
23+
set -euxo pipefail
24+
25+
kube_args=(
26+
{{- if .Values.kubeContext }}
27+
--context {{ .Values.kubeContext }}
28+
{{- end }}
29+
{{- if .Values.kubeConfigPath }}
30+
--kubeconfig {{ .Values.kubeConfigPath }}
31+
{{- end }}
32+
)
33+
2034
echo "Ensuring RAID0 and Local‑CSI driver are setup..."
2135
22-
kubectl create -f ./scylla-setup/gke-daemonset-raid-disks.yaml
23-
kubectl -n default rollout status daemonset/gke-raid-disks
36+
kubectl "${kube_args[@]}" apply -f ./scylla-setup/gke-daemonset-raid-disks.yaml
37+
kubectl "${kube_args[@]}" -n default rollout status daemonset/gke-raid-disks
2438
25-
kubectl apply -f ./scylla-setup/local-csi-driver
26-
kubectl -n local-csi-driver rollout status daemonset.apps/local-csi-driver
39+
kubectl "${kube_args[@]}" apply -f ./scylla-setup/local-csi-driver
40+
kubectl "${kube_args[@]}" -n local-csi-driver rollout status daemonset.apps/local-csi-driver --timeout=5m
2741
28-
kubectl apply -f ./scylla-setup/local-ssd-sc.yaml
42+
kubectl "${kube_args[@]}" apply -f ./scylla-setup/local-ssd-sc.yaml
2943
{{- end }}
3044

3145
---

0 commit comments

Comments
 (0)