Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CVMFS fix configurable #498

Merged
merged 7 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ current default values can be found in `values.yaml` file.
| `cvmfs.deploy` | Deploy the Galaxy-CVMFS-CSI Helm Chart. This is an optional dependency, and for production scenarios it should be deployed separately as a cluster-wide resource |
| `cvmfs.enabled` | Enable use of CVMFS in configs, and deployment of CVMFS Persistent Volume Claims for Galaxy |
| `cvmfs.pvc.{}` | Persistent Volume Claim to deploy for CVMFS repositories. See <a href="galaxy/values.yaml">`values.yaml`</a> for examples. |
| `cvmfs.deployPostInstallFix` |Deploy the fix for Galaxy-CVMFS-CSI Helm Chart. |
| `cvmfs.externalCvmfsNamespace` | Define the namespace where the cvmfs NodePlugin is deployed, if cvmfs.deploy is true, this isn't used. |
| `setupJob.ttlSecondsAfterFinished` | Sets `ttlSecondsAfterFinished` for the initialization jobs. See the [Kubernetes documentation](https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/#ttl-controller) for more details. |
| `setupJob.downloadToolConfs.enabled` | Download configuration files and the `tools` directory from an archive via a job at startup |
| `setupJob.downloadToolConfs.archives.startup` | A URL to a `tar.gz` publicly accessible archive containing AT LEAST conf files and XML tool wrappers. Meant to be enough for Galaxy handlers to startup. |
Expand Down
2 changes: 2 additions & 0 deletions VALUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
| refdata.type | `s3fs` or `cvmfs`, determines the CSI to use for mounting reference data. `cvmfs` is the default and recommended for the time being. |
| cvmfs | Configuration block if `cvmfs` is used as `refdata.type` |
| cvmfs.deploy | Deploy the Galaxy-CVMFS-CSI Helm Chart. This is an optional dependency, and for production scenarios it should be deployed separately as a cluster-wide resource |
| cvmfs.deployPostInstallFix| Deploy the fix for Galaxy-CVMFS-CSI Helm Chart. |
| cvmfs.externalCvmfsNamespace|Define the namespace where the cvmfs NodePlugin is deployed, if cvmfs.deploy is true, this isn't used. |
| s3csi | Configuration block if `s3csi` is used as the `refdata.type` |
| s3csi.deploy | Deploy the CSI-S3 Helm Chart. This is an optional dependency, and for production scenarios it should be deployed separately as a cluster-wide resource. |
| useSecretConfigs | When this flag is set to true, all configs will be set in secrets, when it is set to false, all configs will be set in configmaps |
Expand Down
9 changes: 6 additions & 3 deletions galaxy/templates/configmap-cvmfs-fix.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if and .Values.cvmfs.deployPostInstallFix .Values.refdata.enabled (eq .Values.refdata.type "cvmfs") }}
{{ $Namespace := .Values.cvmfs.deploy | ternary .Release.Namespace .Values.cvmfs.externalCvmfsNamespace }}
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -8,12 +10,13 @@ metadata:
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'`
status=`kubectl get pods -n {{ $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'`
status=`kubectl get pods -n {{ $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 && \
kubectl get pods -n {{ $Namespace }} -l 'app=cvmfscsi' -l 'component=nodeplugin' -o name | xargs kubectl -n {{ $Namespace }} delete && \
echo "Deleted nodeplugin pods."
{{- end }}
5 changes: 2 additions & 3 deletions galaxy/templates/hook-cvmfs-fix.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.refdata.enabled (eq .Values.refdata.type "cvmfs") }}
{{- if and .Values.cvmfs.deployPostInstallFix .Values.refdata.enabled (eq .Values.refdata.type "cvmfs") }}
---
# Include the code you want to run when both conditions are met
apiVersion: batch/v1
Expand All @@ -19,7 +19,7 @@ spec:
labels:
{{- include "galaxy.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "galaxy.serviceAccountName" . }}
serviceAccountName: {{ .Values.cvmfs.deploy | ternary ( include "galaxy.serviceAccountName" . ) (printf "%s-cvmfs-fix" (include "galaxy.fullname" .)) }}
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}
restartPolicy: Never
Expand All @@ -37,4 +37,3 @@ spec:
configMap:
name: "{{ .Release.Name }}-configmap-cvmfs-fix"
{{- end }}

42 changes: 42 additions & 0 deletions galaxy/templates/rbac-fix-cvmfs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{- if and .Values.cvmfs.deployPostInstallFix (not .Values.cvmfs.deploy) .Values.refdata.enabled (eq .Values.refdata.type "cvmfs") }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "galaxy.fullname" . }}-cvmfs-fix
namespace: {{ .Release.Namespace }}
labels:
{{- include "galaxy.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: {{ .Values.cvmfs.externalCvmfsNamespace }}
name: {{ include "galaxy.fullname" . }}-cvmfs-fix
labels:
{{- include "galaxy.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list","watch","delete"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "galaxy.fullname" . }}-cvmfs-fix
namespace: {{ .Values.cvmfs.externalCvmfsNamespace }}
NilsKrattinger marked this conversation as resolved.
Show resolved Hide resolved
labels:
{{- include "galaxy.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "galaxy.fullname" . }}-cvmfs-fix
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: {{ include "galaxy.fullname" . }}-cvmfs-fix
apiGroup: rbac.authorization.k8s.io
{{ end }}
4 changes: 4 additions & 0 deletions galaxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ refdata:
cvmfs:
#- Deploy the Galaxy-CVMFS-CSI Helm Chart. This is an optional dependency, and for production scenarios it should be deployed separately as a cluster-wide resource
deploy: true
#- Deploy the CVMF post install fix,
deployPostInstallFix: true
#- Define the namespace where the cvmfs NodePlugin is deployed, if cvmfs.deploy is true, this isn't used.
externalCvmfsNamespace:
storageClassName: "{{ $.Release.Name }}-cvmfs"

#- Configuration block if `s3csi` is used as the `refdata.type`
Expand Down
Loading