-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #419 from galaxyproject/cvmfs-workaround
Add a post-install hook to restart cvmfs csi pods
- Loading branch information
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Release.Name }}-configmap-cvmfs-fix | ||
labels: | ||
{{- include "galaxy.labels" . | nindent 4 }} | ||
data: | ||
cvmfs-fix.sh: | | ||
sleep 10; | ||
status=`kubectl get pods -n {{ .Release.Namespace }} -l 'app=cvmfscsi' -l 'component=nodeplugin' -o custom-columns=STATUS:.status.phase --no-headers | sort | uniq | tr -d '\n'` | ||
while [ "$status" != "Running" ]; do | ||
echo "Waiting on nodeplugin pod to enter 'Running' status. Currently '$status'."; | ||
sleep 1; | ||
status=`kubectl get pods -n {{ .Release.Namespace }} -l 'app=cvmfscsi' -l 'component=nodeplugin' -o custom-columns=STATUS:.status.phase --no-headers | sort | uniq | tr -d '\n'` | ||
done && \ | ||
echo "Deleting nodeplugin pods..." | ||
kubectl get pods -n {{ .Release.Namespace }} -l 'app=cvmfscsi' -l 'component=nodeplugin' -o name | xargs kubectl -n {{ .Release.Namespace }} delete && \ | ||
echo "Deleted nodeplugin pods." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: "{{ .Release.Name }}-post-install-cvmfs-fix-job" | ||
labels: | ||
{{- include "galaxy.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": post-install | ||
"helm.sh/hook-weight": "10" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
ttlSecondsAfterFinished: 120 | ||
template: | ||
metadata: | ||
name: "{{ .Release.Name }}-post-install-cvmfs-fix-job" | ||
labels: | ||
{{- include "galaxy.labels" . | nindent 8 }} | ||
spec: | ||
serviceAccountName: {{ include "galaxy.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 8 }} | ||
restartPolicy: Never | ||
containers: | ||
- name: post-install-kubectl | ||
image: bitnami/kubectl | ||
command: | ||
- "sh" | ||
- "/script/cvmfs-fix.sh" | ||
volumeMounts: | ||
- name: kubectl-script | ||
mountPath: "/script" | ||
volumes: | ||
- name: kubectl-script | ||
configMap: | ||
name: "{{ .Release.Name }}-configmap-cvmfs-fix" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters