Skip to content

Commit 7b67eec

Browse files
authored
Always specify kube args in kubectl commands in helmfile (#4344)
## Motivation If running multiple deploys in parallel, you could accidentally run these kubectl commands in the wrong context. ## Proposal Ensure that all kubectl commands have the proper args specified ## Test Plan Deployed a network with this, works as expected. ## Release Plan - Nothing to do / These changes follow the usual release cycle.
1 parent cb7b592 commit 7b67eec

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

kubernetes/linera-validator/helmfile.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,21 @@ hooks:
1919
showlogs: true
2020
command: bash
2121
args:
22-
- -lc
22+
- -c
2323
- |
2424
set -euxo pipefail
25+
26+
kube_args=(
27+
{{- if .Values.kubeContext }}
28+
--context {{ .Values.kubeContext }}
29+
{{- end }}
30+
{{- if .Values.kubeConfigPath }}
31+
--kubeconfig {{ .Values.kubeConfigPath }}
32+
{{- end }}
33+
)
34+
2535
echo "Installing Prometheus ServiceMonitor CRD…"
26-
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
36+
kubectl "${kube_args[@]}" apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
2737
{{- if and .Values.gcpRun .Values.usingLocalSsd }}
2838
- events: ["prepare"]
2939
showlogs: true
@@ -109,9 +119,9 @@ releases:
109119
echo "Deploy NodeConfig, Local-CSI driver and StorageClass"
110120
111121
kubectl "${kube_args[@]}" apply -f ./scylla-setup/nodeconfig.yaml
112-
kubectl wait --for=condition=Progressing=False --timeout=10m nodeconfig/scylla-nvme
113-
kubectl wait --for=condition=Degraded=False --timeout=10m nodeconfig/scylla-nvme
114-
kubectl wait --for=condition=Available=True --timeout=10m nodeconfig/scylla-nvme
122+
kubectl "${kube_args[@]}" wait --for=condition=Progressing=False --timeout=10m nodeconfig/scylla-nvme
123+
kubectl "${kube_args[@]}" wait --for=condition=Degraded=False --timeout=10m nodeconfig/scylla-nvme
124+
kubectl "${kube_args[@]}" wait --for=condition=Available=True --timeout=10m nodeconfig/scylla-nvme
115125
116126
kubectl "${kube_args[@]}" apply -f ./scylla-setup/local-csi-driver
117127
kubectl "${kube_args[@]}" -n local-csi-driver rollout status daemonset/local-csi-driver --timeout=5m

0 commit comments

Comments
 (0)