Skip to content

Commit

Permalink
[WIP #177] Feature_refector_nginx_deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mwallschlaeger committed Jun 6, 2024
1 parent 1dcf0a3 commit a677ebd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ data:
invoke updateadmin
fi

invoke statics
# invoke statics
invoke waitforgeoserver
invoke geoserverfixture
invoke postscript
Expand Down
2 changes: 2 additions & 0 deletions charts/geonode/templates/geonode/geonode-tasks-py-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ data:
def initialized(ctx):
print("**************************init file********************************")
ctx.run("date > /mnt/volumes/statics/geonode_init.lock")
ctx.run("mkdir -p /mnt/volumes/statics/uploads")
@task
def prescript(ctx):
Expand Down
24 changes: 21 additions & 3 deletions charts/geonode/templates/nginx/nginx-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ spec:
imagePullSecrets:
- name: {{ .Values.nginx.imagePullSecret }}
{{ end }}
initContainers:
# This is the django app server
- name: {{ .Values.nginx.container_name }}-build-static
image: "{{ .Values.geonode.image.name }}:{{ .Values.geonode.image.tag }}"
imagePullPolicy: {{ .Values.geonode.imagePullPolicy }}
command:
- bash
- -c
- |
mkdir -p $STATIC_ROOT
python manage.py collectstatic --noinput
envFrom:
- configMapRef:
name: {{ include "geonode_pod_name" . }}-env
volumeMounts:
- name: pvc-{{ .Release.Name }}-statics
mountPath: /mnt/volumes/statics
subPath: statics

containers:
- name: {{ .Values.nginx.container_name }}
Expand All @@ -37,7 +55,7 @@ spec:
{{- end }}

volumeMounts:
- name: "{{ include "persistant_volume_name" . }}"
- name: pvc-{{ .Release.Name }}-statics
mountPath: /mnt/volumes/statics
subPath: statics
- name: geonode-favicon
Expand All @@ -61,6 +79,6 @@ spec:
- name: geonode-favicon
configMap:
name: {{ .Release.Name }}-geonode-favicon
- name: "{{ include "persistant_volume_name" . }}"
- name: pvc-{{ .Release.Name }}-statics
persistentVolumeClaim:
claimName: pvc-{{ .Release.Name }}-geonode
claimName: pvc-{{ .Release.Name }}-statics
12 changes: 12 additions & 0 deletions charts/geonode/templates/nginx/nginx-statics-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-{{ .Release.Name }}-statics
namespace: {{ .Release.Namespace }}
spec:
accessModes:
- {{ .Values.global.accessMode }}
storageClassName: {{ .Values.global.storageClass }}
resources:
requests:
storage: 2Gi

0 comments on commit a677ebd

Please sign in to comment.