-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip(charts): add a seeder job to mapcache to generate local caches [p…
…ack mapcache]
- Loading branch information
1 parent
483534d
commit e94bf12
Showing
5 changed files
with
119 additions
and
123 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{- if .Values.seedJob.enabled }} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ include "common.names.fullname" . }}-seed-job | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: {{ required "Mapcache seed job's volume size must be defined !" .Values.seedJob.pvcSize }} | ||
{{- if .Values.seedJob.pvcStorageClassName }} | ||
storageClassName: {{ .Values.seedJob.pvcStorageClassName }} | ||
{{- end }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{- if .Values.seedJob.enabled }} | ||
apiVersion: batch/v1beta1 | ||
kind: CronJob | ||
metadata: | ||
name: {{ include "common.names.fullname" . }}-seed-job | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
suspend: true | ||
schedule: '0 1 * * *' | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
# ttlSecondsAfterFinished: 120 | ||
restartPolicy: Never | ||
initContainers: | ||
{{- if .Values.envsubstConfig }} | ||
{{- include "common.envsubstConfig.renderInitContainer" ( dict "args" .Values.envsubstConfig "context" $ ) | nindent 12 }} | ||
{{- end }} | ||
- name: seed-local-cache | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
command: | ||
- sh | ||
- -c | ||
- for LAYER in {{ .Values.seedJob.layers }}; do echo "Seeding layer $LAYER ..." && mapcache_seed -c /etc/mapcache/mapcache.xml -t $LAYER -z {{ .Values.seedJob.fromZ }},{{ .Values.seedJob.toZ }} -n {{ .Values.seedJob.threadCount }}; done | ||
volumeMounts: | ||
- mountPath: /etc/mapcache | ||
readOnly: true | ||
name: mapcache-config | ||
- mountPath: /mnt/data | ||
name: mapcache-cache | ||
containers: | ||
- name: rclone-local-cache | ||
image: rclone/rclone | ||
command: | ||
- sh | ||
- -c | ||
- CACHE_SOURCE={{ include "common.tplvalues.render" ( dict "value" .Values.localCacheSource "context" $) }} && CACHE_FILE=$(basename $CACHE_SOURCE) && cd /cache && tar -cf /scratch/$CACHE_FILE . && rclone copyto /scratch/$CACHE_FILE $CACHE_SOURCE --progress | ||
volumeMounts: | ||
- mountPath: /cache | ||
name: mapcache-cache | ||
- mountPath: /scratch | ||
name: scratch-space | ||
- mountPath: /config/rclone/rclone.conf | ||
name: rclone-config | ||
subPath: rclone.conf | ||
readOnly: true | ||
volumes: | ||
- name: mapcache-config | ||
{{- if .Values.envsubstConfig }} | ||
emptyDir: {} | ||
{{- else if .Values.configVolume }} | ||
{{- include "common.tplvalues.render" ( dict "value" .Values.configVolume "context" $ ) | nindent 14 }} | ||
{{- end }} | ||
{{- if .Values.envsubstConfig }} | ||
{{- include "common.envsubstConfig.renderVolume" ( dict "args" .Values.envsubstConfig "context" $ ) | nindent 12 }} | ||
{{- end }} | ||
- name: mapcache-cache | ||
persistentVolumeClaim: | ||
claimName: {{ include "common.names.fullname" . }}-seed-job | ||
- name: scratch-space | ||
emptyDir: {} | ||
- name: rclone-config | ||
secret: | ||
secretName: {{ include "common.tplvalues.render" ( dict "value" .Values.rcloneConfigSecretName "context" $) }} | ||
{{- end }} |
This file was deleted.
Oops, something went wrong.
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