Skip to content

Commit

Permalink
invenio: add vocabularies
Browse files Browse the repository at this point in the history
* Adds the option to customize vocabularies (closes inveniosoftware#135)
  • Loading branch information
egabancho committed Dec 5, 2024
1 parent 473243a commit 006a018
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 1 deletion.
14 changes: 14 additions & 0 deletions charts/invenio/templates/install-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,24 @@ spec:
secretKeyRef:
name: invenio-secrets
key: INVENIO_CSRF_SECRET_SALT
volumeMounts:
{{- if .Values.invenio.vocabularies }}
{{- range $key, $value := .Values.invenio.vocabularies }}
- name: vocabularies
mountPath: "/opt/invenio/var/instance/app_data/vocabularies/{{ $key }}"
subPath: "{{ $key }}"
{{- end }}
{{- end }}
{{- if .Values.web.resources }}
resources: {{- toYaml .Values.web.resources | nindent 10 }}
{{- end }}
restartPolicy: OnFailure
volumes:
{{- if .Values.invenio.vocabularies}}
- name: vocabularies
configMap:
name: "invenio-vocabularies"
{{- end }}
{{- if .Values.web.imagePullSecret }}
imagePullSecrets:
- name: {{ .Values.web.imagePullSecret }}
Expand Down
13 changes: 13 additions & 0 deletions charts/invenio/templates/vocabularies-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.invenio.vocabularies}}
apiVersion: v1
kind: ConfigMap
metadata:
name: invenio-vocabularies
labels:
{{- include "invenio.labels" . | nindent 4 }}
data:
{{- range $key, $value := .Values.invenio.vocabularies }}
{{ $key }}: |
{{- $value | nindent 4 }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/invenio/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ spec:
- name: kerberos-credentials-cache
mountPath: /tmp
{{- end }}
{{- if .Values.invenio.vocabularies }}
{{- range $key, $value := .Values.invenio.vocabularies }}
- name: vocabularies
mountPath: "/opt/invenio/var/instance/app_data/vocabularies/{{ $key }}"
subPath: "{{ $key }}"
{{- end }}
{{- end }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down Expand Up @@ -274,6 +281,11 @@ spec:
- name: kerberos-credentials-cache
emptyDir: {}
{{- end }}
{{- if .Values.invenio.vocabularies}}
- name: vocabularies
configMap:
name: "invenio-vocabularies"
{{- end }}
{{- if .Values.web.imagePullSecret }}
imagePullSecrets:
- name: {{ .Values.web.imagePullSecret }}
Expand Down
12 changes: 12 additions & 0 deletions charts/invenio/templates/worker-beat-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ spec:
- mountPath: /opt/invenio/var/instance/data
name: shared-volume
{{- end }}
{{- if .Values.invenio.vocabularies }}
{{- range $key, $value := .Values.invenio.vocabularies }}
- name: vocabularies
mountPath: "/opt/invenio/var/instance/app_data/vocabularies/{{ $key }}"
subPath: "{{ $key }}"
{{- end }}
{{- end }}
envFrom:
- configMapRef:
name: invenio-config
Expand Down Expand Up @@ -122,6 +129,11 @@ spec:
persistentVolumeClaim:
claimName: {{ .Values.persistence.name }}
{{- end }}
{{- if .Values.invenio.vocabularies}}
- name: vocabularies
configMap:
name: "invenio-vocabularies"
{{- end }}
{{- if .Values.worker.imagePullSecret }}
imagePullSecrets:
- name: {{ .Values.worker.imagePullSecret }}
Expand Down
13 changes: 12 additions & 1 deletion charts/invenio/templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ spec:
- name: kerberos-credentials-cache
mountPath: /tmp
{{- end }}
{{- if .Values.invenio.vocabularies }}
{{- range $key, $value := .Values.invenio.vocabularies }}
- name: vocabularies
mountPath: "/opt/invenio/var/instance/app_data/vocabularies/{{ $key }}"
subPath: "{{ $key }}"
{{- end }}
{{- end }}
{{- if .Values.kerberos.enabled }}
- name: kerberos-credentials
image: {{ required "Missing .Values.kerberos.image" .Values.kerberos.image }}
Expand Down Expand Up @@ -160,7 +167,11 @@ spec:
- name: kerberos-credentials-cache
emptyDir: {}
{{- end }}

{{- if .Values.invenio.vocabularies}}
- name: vocabularies
configMap:
name: "invenio-vocabularies"
{{- end }}
{{- if .Values.worker.imagePullSecret }}
imagePullSecrets:
- name: {{ .Values.worker.imagePullSecret }}
Expand Down
25 changes: 25 additions & 0 deletions charts/invenio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,31 @@ invenio:
# name: name-of-my-secret
# key: KEY_IN_MY_SECRET

## @param invenio.vocabularies Vocabularies to be loaded as files under /app_data/vocabularies
## Example
## vocabularies:
## resource_types.yaml: |
## - id: publication
## icon: file alternate
## props:
## csl: report
## datacite_general: Text
## datacite_type: ""
## openaire_resourceType: "0017"
## openaire_type: publication
## eurepo: info:eu-repo/semantics/other
## schema.org: https://schema.org/CreativeWork
## subtype: ""
## type: publication
## marc21_type: publication
## marc21_subtype: ""
## title:
## en: Publication
## tags:
## - depositable
## - linkable
vocabularies: {}

haproxy:
enabled: true
image: "haproxy:2.8.3"
Expand Down

0 comments on commit 006a018

Please sign in to comment.