Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#49 add a configurable fixture template #50

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -126,6 +126,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 @@ -223,6 +228,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 @@ -262,6 +273,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: {}
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' ]"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# 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.