Skip to content

Commit

Permalink
add geowebcache component to the helm chart (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
edevosc2c authored Jul 11, 2024
1 parent e137115 commit 17ae26b
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 0 deletions.
89 changes: 89 additions & 0 deletions templates/geowebcache/geowebcache-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{{- $webapp := .Values.georchestra.webapps.geowebcache -}}
{{- if $webapp.enabled -}}

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "georchestra.fullname" . }}-geowebcache
labels:
{{- include "georchestra.labels" . | nindent 4 }}
app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-geowebcache
spec:
replicas: {{ $webapp.replicaCount }}
selector:
matchLabels:
{{- include "georchestra.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-geowebcache
template:
metadata:
labels:
{{- include "georchestra.selectorLabels" . | nindent 8 }}
org.georchestra.service/name: {{ include "georchestra.fullname" . }}-geowebcache
app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-geowebcache
spec:
nodeSelector:
"kubernetes.io/os": linux
{{- with .Values.georchestra.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
fsGroup: 999
initContainers:
{{ include "georchestra.bootstrap_georchestra_datadir" . | nindent 6 }}
containers:
- name: georchestra-geowebcache
image: {{ $webapp.docker_image }}
imagePullPolicy: Always
env:
{{- include "georchestra.database-georchestra-envs" . | nindent 10 }}
{{- if $webapp.extra_environment }}
{{- $webapp.extra_environment | toYaml | nindent 10 }}
{{- end }}
volumeMounts:
- mountPath: /etc/georchestra
name: georchestra-datadir
- mountPath: /mnt/geowebcache_tiles
name: geowebcache-tiles
{{- if $webapp.extra_volumeMounts }}
{{ $webapp.extra_volumeMounts | toYaml | nindent 10 }}
{{- end }}
ports:
- containerPort: 80
name: http
{{- if $webapp.livenessProbe }}
{{ $webapp.livenessProbe | toYaml | nindent 8 }}
{{- else }}
livenessProbe:
httpGet:
path: /geowebcache/
port: http
{{- end }}
startupProbe:
failureThreshold: 5
httpGet:
path: /geowebcache/
port: http
initialDelaySeconds: 45
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 1
volumes:
- name: georchestra-datadir
emptyDir: {}
- name: geowebcache-tiles
persistentVolumeClaim:
claimName: {{ include "georchestra.fullname" . }}-geowebcache-tiles
{{- if .Values.georchestra.datadir.git.ssh_secret }}
- name: ssh-secret
secret:
secretName: {{ .Values.georchestra.datadir.git.ssh_secret }}
defaultMode: 0400
{{- end }}
{{- if $webapp.extra_volumes }}
{{ $webapp.extra_volumes | toYaml | nindent 6 }}
{{- end }}
{{- if $webapp.registry_secret }}
imagePullSecrets:
- name: {{ $webapp.registry_secret }}
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions templates/geowebcache/geowebcache-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- $webapp := .Values.georchestra.webapps.geowebcache -}}
{{- if $webapp.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "georchestra.fullname" . }}-geowebcache-svc
labels:
{{- include "georchestra.labels" . | nindent 4 }}
app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-geowebcache
{{- with $webapp.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ports:
- port: 80
protocol: TCP
targetPort: http
selector:
org.georchestra.service/name: {{ include "georchestra.fullname" . }}-geowebcache
{{- end }}
38 changes: 38 additions & 0 deletions templates/geowebcache/geowebcache-tiles-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- $webapp := .Values.georchestra.webapps.geowebcache -}}
{{- $webapp_storage := .Values.georchestra.storage.geowebcache_tiles -}}
{{- if and $webapp.enabled .Values.georchestra.storage.geowebcache_tiles -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "georchestra.fullname" . }}-geowebcache-tiles
labels:
{{- include "georchestra.labels" . | nindent 4 }}
app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-geowebcache
helm.sh/resource-policy: "keep"
spec:
accessModes:
{{- if $webapp_storage.accessModes }}
{{- range $webapp_storage.accessModes }}
- {{ . | quote }}
{{- end }}
{{- else }}
{{- range .Values.georchestra.storage.accessModes }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- if (eq "-" $webapp_storage.storage_class_name) }}
storageClassName: ""
{{- else if $webapp_storage.storage_class_name }}
storageClassName: {{ $webapp_storage.storage_class_name }}
{{- else if (eq "-" .Values.georchestra.storage.storage_class_name) }}
storageClassName: ""
{{- else if .Values.georchestra.storage.storage_class_name }}
storageClassName: {{ .Values.georchestra.storage.storage_class_name }}
{{- end }}
{{- if $webapp_storage.pv_name }}
volumeName: {{ $webapp_storage.pv_name }}
{{- end }}
resources:
requests:
storage: {{ $webapp_storage.size }}
{{- end }}
10 changes: 10 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ georchestra:
# registry_secret: default
service:
annotations: {}
geowebcache:
enabled: false
replicaCount: "1"
docker_image: georchestra/geowebcache:latest
extra_environment: []
service:
annotations: {}
header:
enabled: true
replicaCount: "1"
Expand Down Expand Up @@ -236,6 +243,9 @@ georchestra:
geoserver_tiles:
# pv_name: geoserver_tiles
size: 2Gi
geowebcache_tiles:
# pv_name: geowebcache_tiles
size: 5Gi
# We also might need to specify a custom storageClass
# Leave it commented if not needed
# storage_class_name: default or "-" for empty storageClassName
Expand Down

0 comments on commit 17ae26b

Please sign in to comment.