one suggestion to get used to the process:
Don't change anything yet
-
add this to
settings/base.py
:TEST_ENV_VARIABLE = os.environ.get('TEST_ENV_VARIABLE', '(nothing set)')
-
update the homepage to display the variable
- file: content_pages/views.py
- add
from django.conf import settings
- to the dict sent to the template:
'TEST_ENV_VARIABLE': settings.TEST_ENV_VARIABLE
- add
- file: homepage.html
- add something to the bottom like
{% if TEST_ENV_VARIABLE %}<p>TEST_ENV_VARIABLE: {{ TEST_ENV_VARIABLE }}</p>{% endif %}
- add something to the bottom like
- file: content_pages/views.py
-
Test this locally.
- e.g. in the command line where you're running the server, try
echo TEST_ENV_VARIABLE=trying-it-out
- restart the server and see if
trying-it-out
appears on the homepage
- e.g. in the command line where you're running the server, try
-
If it works, check it into master
-
Try this post, especially part 4
-
You can modify the kubernetes deploy files on gce itself
After a new dockerhub image is built*, follow these deploy instructions:
-
connect via the cloud shell
-
cd raven-metadata-service
- update the
deploy/metadata-deploy.yml
file as needed via the google shell
- update the
-
Turn the service on/off to see if it's working:
-
Once you get
TEST_ENV_VARIABLE
via a secret, then you can move onto reading making a new settings file and reading the creds file via a secret... -
turn the service on/off via: https://github.com/TwoRavens/raven-metadata-service/blob/master/deploy/readme.md
-
try adding enviroment variables to kubernetes for
TEST_ENV_VARIABLE
and see if they work
- check for a recently built imate https://hub.docker.com/r/tworavens/raven-metadata-service/tags/