Skip to content

Commit

Permalink
Use secret param in JH DB for postgres pass (opendatahub-io#362)
Browse files Browse the repository at this point in the history
Co-authored-by: V谩clav Pavl铆n <vaclav.pavlin@gmail.com>
  • Loading branch information
Chad Roberts and vpavlin committed Apr 1, 2021
1 parent e05a7ad commit d8b8b94
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions jupyterhub/README.md
Expand Up @@ -25,6 +25,10 @@ Name of the storage class to be used for PVCs created by JupyterHub component. T

A ConfigMap containing comma separated lists of groups which would be used as Admin and User groups for JupyterHub. The default ConfgiMap can be found [here](jupyterhub/base/jupyterhub-groups-configmap.yaml).

#### jupyterhub_secret

A Secret containing configuration values like JupyterHub DB password or COOKIE_SECRET. The default Secret can be found [here](jupyterhub/base/jupyterhub-secret.yaml).

##### Examples

```
Expand Down
7 changes: 2 additions & 5 deletions jupyterhub/jupyterhub/base/jupyterhub-db-dc.yaml
Expand Up @@ -25,14 +25,11 @@ spec:
- image: registry.redhat.io/rhel8/postgresql-96
env:
- name: POSTGRESQL_USER
valueFrom:
secretKeyRef:
name: jupyterhub
key: POSTGRESQL_USER
value: jupyterhub
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
name: jupyterhub
name: $(jupyterhub_secret)
key: POSTGRESQL_PASSWORD
- name: POSTGRESQL_DATABASE
value: jupyterhub
Expand Down
4 changes: 2 additions & 2 deletions jupyterhub/jupyterhub/base/jupyterhub-dc.yaml
Expand Up @@ -32,7 +32,7 @@ spec:
- name: JUPYTERHUB_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: jupyterhub
name: $(jupyterhub_secret)
key: POSTGRESQL_PASSWORD
- name: JUPYTERHUB_DATABASE_HOST
value: jupyterhub-db
Expand Down Expand Up @@ -101,7 +101,7 @@ spec:
- name: JUPYTERHUB_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: jupyterhub
name: $(jupyterhub_secret)
key: POSTGRESQL_PASSWORD
- name: JUPYTERHUB_DATABASE_HOST
value: jupyterhub-db
Expand Down
1 change: 0 additions & 1 deletion jupyterhub/jupyterhub/base/jupyterhub-secret.yaml
Expand Up @@ -6,7 +6,6 @@ metadata:
label:
app: jupyterhub
data:
POSTGRESQL_USER: anVweXRlcmh1Yg== # "jupyterhub"
POSTGRESQL_PASSWORD: c2VjcmV0cGFzc3dvcmQ= # "secretpassword"
PROMETHEUS_API_TOKEN: ZDE2ZGMwZDFhY2YyMTMxMzY3ZmZmM2E3MjQzNmZhOTFlZTEzYjcxODgwY2JhZjZlMjMxMWZlNmZkZDU2NTM4NA== # "openssl rand -hex 32 | base64"
CONFIGPROXY_AUTH_TOKEN: M2MxNTVjZTczNDQ1NzNhOTRiMjA5YmM4NzVjMmE3NDliN2ZhZGVhMDdlOTQyMGFhYzQyZGJjZjYyYWIwODMxZQ== # "openssl rand -hex 32 | base64"
Expand Down
2 changes: 2 additions & 0 deletions jupyterhub/jupyterhub/base/params.yaml
Expand Up @@ -10,3 +10,5 @@ varReference:
kind: DeploymentConfig
- path: spec/template/spec/containers/env/valueFrom/secretKeyRef/name
kind: DeploymentConfig
- path: spec/template/spec/initContainers/env/valueFrom/secretKeyRef/name
kind: DeploymentConfig

0 comments on commit d8b8b94

Please sign in to comment.