-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to create indices from existingConfigmap
Currently the Helm Chart supports creating new repositories via an existing ConfigMap. For deploying GraphDB as IaC this is quite useful. Unfortunately, there is no way to create indices at install time. This adds the option to provide a existing ConfigMap via values and create an index for one or multiple repositories. The ConfigMap has to consist out of keys that have the same name as the repository. The value is the SPARQL query.
- Loading branch information
1 parent
8b55cb4
commit 4eaa602
Showing
5 changed files
with
152 additions
and
0 deletions.
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
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
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
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,99 @@ | ||
{{- if .Values.indices.existingConfigmap }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "graphdb.fullname.job.provision-indices" . }} | ||
namespace: {{ include "graphdb.namespace" . }} | ||
labels: | ||
{{- include "graphdb.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": post-install, post-upgrade, post-rollback | ||
"helm.sh/hook-delete-policy": before-hook-creation, hook-succeeded, hook-failed | ||
"helm.sh/hook-weight": "5" | ||
{{- with .Values.annotations }} | ||
{{- tpl (toYaml .) $ | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
backoffLimit: {{ .Values.jobs.backoffLimit }} | ||
ttlSecondsAfterFinished: {{ .Values.jobs.ttlSecondsAfterFinished }} | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
automountServiceAccountToken: false | ||
{{- if .Values.jobs.schedulerName }} | ||
schedulerName: {{ .Values.jobs.schedulerName }} | ||
{{- end }} | ||
{{- with .Values.jobs.dnsConfig }} | ||
dnsConfig: {{ toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.jobs.dnsPolicy }} | ||
dnsPolicy: {{ .Values.jobs.dnsPolicy }} | ||
{{- end }} | ||
{{- if .Values.jobs.priorityClassName }} | ||
priorityClassName: {{ .Values.jobs.priorityClassName }} | ||
{{- end }} | ||
{{- with .Values.jobs.nodeSelector }} | ||
nodeSelector: {{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.jobs.affinity }} | ||
affinity: {{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.jobs.tolerations }} | ||
tolerations: {{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.jobs.topologySpreadConstraints }} | ||
topologySpreadConstraints: {{- tpl (toYaml .) $ | nindent 8 }} | ||
{{- end }} | ||
{{- if or .Values.global.imagePullSecrets .Values.image.pullSecrets }} | ||
imagePullSecrets: | ||
{{- include "graphdb.combinedImagePullSecrets" . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.jobs.podSecurityContext }} | ||
securityContext: {{ toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: job-temp | ||
emptyDir: {{ .Values.jobs.persistence.emptyDir | toYaml | nindent 12 }} | ||
- name: indices-config | ||
configMap: | ||
name: {{ .Values.indices.existingConfigmap }} | ||
- name: graphdb-utils | ||
configMap: | ||
name: {{ include "graphdb.fullname.configmap.utils" . }} | ||
containers: | ||
- name: provision-indices | ||
image: {{ include "graphdb.image" . }} | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
env: | ||
- name: GRAPHDB_POD_NAME | ||
value: {{ include "graphdb.fullname" . }} | ||
- name: GRAPHDB_SERVICE_NAME | ||
value: {{ include "graphdb.fullname.service.headless" . }} | ||
- name: GRAPHDB_SERVICE_PORT | ||
value: {{ .Values.headlessService.ports.http | quote }} | ||
- name: GRAPHDB_AUTH_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ (tpl .Values.security.provisioner.existingSecret .) | default (include "graphdb.fullname.secret.provisioning-user" .) }} | ||
key: {{ .Values.security.provisioner.tokenKey }} | ||
{{- with .Values.jobs.securityContext }} | ||
securityContext: {{ toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.jobs.resources }} | ||
resources: {{ toYaml . | nindent 12 }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: job-temp | ||
mountPath: /tmp | ||
- name: graphdb-utils | ||
mountPath: /tmp/utils | ||
- name: indices-config | ||
mountPath: /tmp/indices-config | ||
workingDir: /tmp | ||
command: ["bash"] | ||
args: | ||
- "/tmp/utils/graphdb.sh" | ||
- "createIndicesFromFiles" | ||
- "{{ .Values.replicas }}" | ||
- "/tmp/indices-config" | ||
{{- end }} |
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