Skip to content

Commit

Permalink
Issue#49 add a configurable fixture template (#50)
Browse files Browse the repository at this point in the history
Issue#49 add a configurable fixture template
  • Loading branch information
ridoo authored Aug 9, 2023
1 parent bde327c commit 3caa9ca
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deployment/geonode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Helm Chart for Geonode

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| favicon | string | AAABAAMAEBAAAAEAIABoBA ... AAAA== | A base64 encoded favicon |
| geonode.acme.email | string | `"[email protected]"` | the email to be used to gain certificates |
| geonode.acme.enabled | bool | `false` | enables cert-manager to do ACME challenges (aka certificates via letsencrypt) |
| geonode.acme.stageUrl | string | `"https://acme-staging-v02.api.letsencrypt.org/directory"` | ACME staging environment (use acme-staging to avoid running into rate limits) stageUrl: https://acme-v02.api.letsencrypt.org/directory |
Expand Down Expand Up @@ -136,6 +137,7 @@ Helm Chart for Geonode
| geonode.uwsgi.processes | int | `128` | Maximum number of workers allowed |
| geonode.uwsgi.reload_on_rss | int | `2048` | Restart workers after this much resident memory |
| geonode.uwsgi.worker_reload_mercy | int | `60` | How long to wait before forcefully killing workers |
| geonodeFixtures | map of fixture files | `{"somefixture.json":"[\n {\n \"pk\": 0,\n \"model\": \"myapp.sample\"\n \"description\": \"nice little content\"\n }\n]\n"}` | Fixture files which shall be made available under /usr/src/geonode/geonode/fixtures (refer to https://docs.djangoproject.com/en/4.2/howto/initial-data/) |
| geoserver | object | `{"admin_password":"geoserver","admin_username":"admin","container_name":"geoserver","image":{"name":"geonode/geoserver","tag":"2.23.0"},"pod_name":"geoserver","port":8080,"resources":{"limits":{"cpu":2,"memory":"4Gi"},"requests":{"cpu":1,"memory":"1Gi"}}}` | CONFIGURATION FOR GEOSERVER DEPLOYMENT |
| geoserver.admin_password | string | `"geoserver"` | geoserver admin password |
| geoserver.admin_username | string | `"admin"` | geoserver admin username |
Expand Down
22 changes: 22 additions & 0 deletions deployment/geonode/templates/geonode/geonode-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ spec:
mountPath: "/usr/src/geonode/geonode/geonode-k8s-settings.py"
subPath: geonode-k8s-settings.py
readOnly: true
{{ if .Values.geonodeFixtures }}
- name: geonode-fixtures
mountPath: "/usr/src/geonode/geonode/fixtures"
readOnly: true
{{ end }}

resources:
requests:
Expand Down Expand Up @@ -236,6 +241,12 @@ spec:
mountPath: "/usr/src/geonode/geonode/geonode-k8s-settings.py"
subPath: geonode-k8s-settings.py
readOnly: true
{{ if .Values.geonodeFixtures }}
- name: geonode-fixtures
mountPath: "/usr/src/geonode/geonode/fixtures"
readOnly: true
{{ end }}

resources:
requests:
memory: {{ .Values.geonode.celery.resources.requests.memory }}
Expand Down Expand Up @@ -275,6 +286,17 @@ spec:
items:
- key: geonode-k8s-settings.py
path: "geonode-k8s-settings.py"
{{- if .Values.geonodeFixtures }}
- name: geonode-fixtures
configMap:
name: {{ .Release.Name }}-geonode-fixtures
defaultMode: 0744
items:
{{- range $key, $value := .Values.geonodeFixtures }}
- key: {{ $key | quote }}
path: {{ $key | quote }}
{{- end }}
{{- end }}
# Using an emptyDir to cache compiled statics... it will survive container crashes, but not pod restarts
- name: cache-volume
emptyDir: {}
Expand Down
1 change: 1 addition & 0 deletions deployment/geonode/templates/geonode/geonode-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ data:

# General settings
FREETEXT_KEYWORDS_READONLY: {{ include "boolean2str" .Values.geonode.general.freetext_keywords_readonly | quote }}
FIXTURE_DIRS: "[ '/usr/src/geonode/fixtures' ]"
# PUBLISHING
RESOURCE_PUBLISHING: {{ include "boolean2str" .Values.geonode.general.publishing.resource_publishing_by_staff | quote }}
ADMIN_MODERATE_UPLOADS: {{ include "boolean2str" .Values.geonode.general.publishing.admin_moderate_uploads | quote }}
Expand Down
2 changes: 1 addition & 1 deletion deployment/geonode/templates/geonode/geonode-favicon.yaml

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions deployment/geonode/templates/geonode/geonode-fixtures.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ if .Values.geonodeFixtures }}
# fixture data for Django Geonode

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-geonode-fixtures
namespace: {{ .Release.Namespace }}
data:
{{ toYaml .Values.geonodeFixtures | nindent 2 }}

{{ end }}
17 changes: 17 additions & 0 deletions deployment/geonode/values.yaml

Large diffs are not rendered by default.

0 comments on commit 3caa9ca

Please sign in to comment.