Kubernetes Django Starter
Example Kubernetes manifests to create a Django project. For a walkthrough on how to get this up and running on Google Container Engine (GKE) please see https://wildfish.com/blog/2017/03/14/django-google-container-engine-gke/.
This is created to work with our Django starter project at https://github.com/wildfish/wildfish-django-starter/ so projects based on that should work out of the box, otherwise there are a few environment variables and secrets to configure as described below. It's presumed that the Django container runs on port 8000.
Presuming you have
kubectl configured and pointing at a Kubernetes cluster you can create the objects using:
kubectl create -f k8s/
Some sensitive values are stored in secrets and passed to the containers as environment variables.
Secrets are defined in the
secrets.yaml manifest and encoded using
To encode a secret:
echo "mysecretvalue" | base64 -w 0
echo "bXlzZWNyZXR2YWx1ZQo=" | base64 --decode
|Secret||Environment Variable||Passed To||Default Value|