Generic chart for basic Django-based web app
Homepage: https://www.djangoproject.com/
Name | Url | |
---|---|---|
lucernae | [email protected] |
Repository | Name | Version |
---|---|---|
../../common/v1.0.1 | common | 1.0.1 |
../../postgis/v0.2.2 | postgis | 0.2.2 |
This is Kartoza's base chart for Django app
This helm chart was intended to be the base chart for any Django-based deployment. The customization are provided via values.yml and pod environment.
For helm:
helm install release-name kartoza/django
This chart bootstrap a Django web framework. Django is a web framework based on python programming language. It is a general purpose web framework. This helm chart is created as a base chart for you. It is supposed to be overrideable for you to provide your own Django image/app.
Django can be deployed as a standalone web app. In this chart, we deployed Django coupled with Nginx webserver with WSGI protocol and Postgis database backend.
The default deployment install generic Django image coupled with Nginx webserver and Postgis RDBMS backend.
Optional customizations:
- Enable/Disable Postgis RDBMS
- Override entrypoint script of Django
- Override python module requirements
- Override Nginx config (if you want to use different staticfiles mapping or protocols)
- Add extra configuration file
- Add custom settings.py
- Add custom urls.py
- Override DJANGO_SETTINGS_MODULE
- Toggle Debug mode
Key | Type | Default | Description |
---|---|---|---|
tpl/map |
extraConfigMap: |
# file_1: conf content |
Define this for extra config map to be included in django-shared-config |
|
tpl/array |
+ExpandextraPodEnv: |
- name: DJANGO_SETTINGS_MODULE
value: "django.settings"
- name: DEBUG
value: {{ .Values.global.debug | quote }}
- name: ROOT_URLCONF
value: {{ .Values.global.rootURLConf | quote }}
- name: MAIN_APP_NAME
value: {{ .Values.global.mainAppName | quote }} |
Define this for extra Django environment variables |
|
tpl/object |
extraPodSpec: |
# nodeSelector:
# a.label: value |
This will be evaluated as pod spec |
|
tpl/map |
extraSecret: |
# key_1: value_1 |
Define this for extra secrets to be included in django-shared-secret secret |
|
tpl/list |
+ExpandextraVolume: |
# You may potentially mount a config map/secret
# - name: custom-config
# configMap:
# name: geonode-config |
Define this for extra volume (in pair with extraVolumeMounts) |
|
tpl/list |
+ExpandextraVolumeMounts: |
# You may potentially mount a config map/secret
# - name: custom-config
# mountPath: /docker-entrypoint.sh
# subPath: docker-entrypoint.sh
# readOnly: true |
Define this for extra volume mounts in the pod |
|
string/email |
|
Default admin email sender |
|
object/common.secret |
+Expand# -- (string) Specify this password value. If not, it will be autogenerated everytime chart upgraded
value:
valueFrom:
secretKeyRef:
name:
key: admin-password |
Secret structure for Admin Password |
|
string |
null |
Specify this password value. If not, it will be autogenerated everytime chart upgraded |
|
string |
"admin" |
Default super user admin username |
|
string |
null |
Django database host location. By default this chart can generate standard postgres chart. So you can leave it as default. If you use external backend, you must provide the value |
|
string |
"django" |
Django database name |
|
object/common.secret |
+Expand# -- (string) Specify this password value. If not, it will be autogenerated everytime chart upgraded. If you use external backend, you must provide the value
value:
valueFrom:
secretKeyRef:
name:
key: database-password |
Secret structure for Database Password |
|
string |
null |
Specify this password value. If not, it will be autogenerated everytime chart upgraded. If you use external backend, you must provide the value |
|
int |
5432 |
Django database port. By default this chart can generate standard postgres chart. So you can leave it as default. If you use external backend, you must provide the value |
|
string |
+Expandvalue:
valueFrom:
secretKeyRef:
name:
key: database-url |
Use this if you want to specify the full Database URL connection |
|
string |
"django_db_user" |
Database username backend to connect to. If you use external backend, provide the value |
|
string/bool |
"False" |
Python boolean literal, this will correspond to |
|
tpl/list |
+Expandglobal.djangoArgs: |
["uwsgi","--chdir=${REPO_ROOT}","--module=${MAIN_APP_NAME}.wsgi","--socket=:8000","--http=0.0.0.0:8080","--processes=5","--buffer-size=8192"] |
The django command args to be passed to entrypoint command |
|
tpl/list |
global.djangoCommand: |
["/opt/django/scripts/docker-entrypoint.sh"] |
The django entrypoint command to execute |
|
object/common.secret |
+Expand# -- (string) Specify this Django Secret string value. If not, it will be autogenerated everytime chart upgraded
value:
valueFrom:
secretKeyRef:
name:
key: django-secret |
Secret structure for Django Secret Key |
|
string |
null |
Specify this Django Secret string value. If not, it will be autogenerated everytime chart upgraded |
|
string |
"django.settings" |
Django settings module to be used |
|
tpl/string |
global.existingConfig: | |
Name of existing config |
|
tpl/string |
global.existingSecret: | |
Name of existing secret |
|
string |
null |
You can override full release name |
|
string |
"django" |
The main app name to execute. Affects which settings, wsgi, and rootURL to use. |
|
path |
"/opt/django/media" |
Location to the media directory |
|
string |
null |
You can override release suffix |
|
string |
"django.urls" |
Django root URL conf to be used |
|
string |
"django-shared-config" |
Name of shared config store that will be generated |
|
string |
"django-shared-secret" |
Name of shared secret store that will be generated |
|
string |
"django" |
||
path |
"/opt/django/static" |
Location to the static directory |
|
string |
null |
Storage class name used to provision PV |
|
object/container-image |
+Expand# -- Image registry
registry: docker.io
# -- Image repository
repository: lucernae/django-sample
# -- Image tag
tag: "3.1"
# -- (k8s/containers/image/imagePullPolicy) Image pullPolicy
pullPolicy: IfNotPresent |
Image map |
|
k8s/containers/image/imagePullPolicy |
"IfNotPresent" |
Image pullPolicy |
|
string |
"docker.io" |
Image registry |
|
string |
"lucernae/django-sample" |
Image repository |
|
string |
"3.1" |
Image tag |
|
dict |
{} |
Custom Ingress annotations |
|
bool |
false |
Set to true to generate Ingress resource |
|
tpl/string |
ingress.host: | |
Set custom host name. (DNS name convention) |
|
dict |
{} |
Custom Ingress labels |
|
bool |
false |
Set to true to enable HTTPS |
|
string |
"django-tls" |
You must provide a secret name where the TLS cert is stored |
|
string |
"ReadWriteOnce" |
||
object |
{} |
||
bool |
true |
Allow persistence |
|
string |
false |
Set to an existing claim if you have it |
|
path |
"/opt/django/media" |
This has to be the same with global.mediaRoot |
|
string |
"8Gi" |
||
string |
"media" |
||
string |
"ReadWriteOnce" |
||
object |
{} |
||
bool |
false |
Allow persistence |
|
string |
false |
Set to an existing claim if you have it |
|
path |
"/opt/django/static" |
This has to be the same with global.staticRoot |
|
string |
"8Gi" |
||
string |
"static" |
||
bool |
true |
Enable postgis as database backend by default. Set to false if using different external backend. |
|
tpl/string |
postgis.existingSecret: | |
Existing secret to be used |
|
tpl/object |
+Expandpostgis.extraConfigMap: |
django-db.sh: |
#!/usr/bin/env bash
DATABASE="{{ .Values.global.databaseName }}"
# password comes from environment variables, so it can be retrieved from secret
DATABASE_USER="{{ .Values.global.databaseUsername }}"
# create database
su postgres -c "createdb ${DATABASE}"
# create role
cat << EOF | su postgres -c "psql"
CREATE ROLE ${DATABASE_USER};
EOF
# modify permissions
cat << EOF | su postgres -c "psql -d ${DATABASE}"
-- Create role
ALTER ROLE ${DATABASE_USER} LOGIN PASSWORD '${DATABASE_PASSWORD}';
ALTER DATABASE ${DATABASE} OWNER TO ${DATABASE_USER};
EOF |
Extra config map for postgis to be included Can be used to pregenerate Django database for first setup |
|
tpl/array |
+Expandpostgis.extraPodEnv: |
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "common.sharedSecretName" . | quote }}
key: {{ .Values.global.databasePassword.valueFrom.secretKeyRef.key }} |
Extra pod env for postgis We expose Django database password in case we need to pregenerate it |
|
tpl/array |
+Expandpostgis.extraVolume: |
- name: config-volume
configMap:
name: {{ template "common.fullname" . }}
defaultMode: 0755 |
Extra volume declaration for postgis We use extra volume to mount postgis configmap to pregenerate database |
|
tpl/array |
+Expandpostgis.extraVolumeMounts: |
- mountPath: /docker-entrypoint-initdb.d/django-db.sh
subPath: django-db.sh
name: config-volume |
Extra volume mounts for postgis We use extra volume mounts postgis configmap to pregenerate database |
|
string |
"postgis" |
||
object/common.secret |
value: |
Postgres super user password. It can be different than global.databasePassword |
|
string |
"superuser" |
Postgres super user account. It can be different than global.databaseUsername |
|
tpl/object |
probe: | |
Probe can be overridden |
|
dict |
{} |
Extra service annotations |
|
string |
"" |
Specify |
|
tpl/array |
service.externalIPs: | |
Specify for LoadBalancer service type |
|
int |
null |
Specify node port, for NodePort service type |
|
int |
80 |
Specify service port |
|
string |
"ClusterIP" |
Define k8s service for Django. |
|
tpl/array |
|
List of containers override for testing |
common-v1.0.1