Skip to content
Snippets Groups Projects
Commit 700b0358 authored by František Dvořák's avatar František Dvořák
Browse files

Deploy JupyterHub API JWT wrapper automatically

parent 9f96aecd
No related branches found
No related tags found
No related merge requests found
...@@ -112,6 +112,7 @@ hub: ...@@ -112,6 +112,7 @@ hub:
jwt: jwt:
url: "http://jwt/" url: "http://jwt/"
display: false display: false
# recommended to keep in sync with common/playbooks/files/jupyterhub-jwt.yaml
image: image:
name: eginotebooks/hub name: eginotebooks/hub
tag: "sha-323c75e" tag: "sha-323c75e"
......
../../../common/playbooks/files/jupyterhub-jwt.yaml
\ No newline at end of file
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jwt
labels:
app: jwt
spec:
replicas: 1
selector:
matchLabels:
app: jwt
template:
metadata:
labels:
name: jwt
app: jwt
hub.jupyter.org/network-access-hub: "true"
spec:
containers:
- name: jwt
# recommended to keep it in sync with */deployments/*.yaml
image: eginotebooks/hub:sha-323c75e
args:
- fastapi
- run
- /egi-notebooks-hub/egi_notebooks_hub/services/api_wrapper.py
env:
- name: JUPYTERHUB_SERVICE_PREFIX
value: "/services/jwt"
- name: JUPYTERHUB_API_URL
value: http://hub:8081/hub/api
ports:
- name: http
containerPort: 8000
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: jwt
labels:
app: jwt
spec:
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: jwt
...@@ -100,6 +100,24 @@ ...@@ -100,6 +100,24 @@
when: true when: true
with_fileglob: with_fileglob:
- "../deployments/*.yaml" - "../deployments/*.yaml"
- name: Copy JWT wrapper for JupyterHub API
copy:
src: files/jupyterhub-jwt.yaml
dest: /tmp/jupyterhub-jwt.yaml
mode: 0644
- name: Configure JWT wrapper for JupyterHub API
vars:
name: "{{ item | basename | splitext | first }}"
command: |-
kubectl apply -n "{{ name }}" -f /tmp/jupyterhub-jwt.yaml
environment:
KUBECONFIG: /etc/kubernetes/admin.conf
PATH: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
when: true
with_fileglob:
- "../deployments/*.yaml"
# do the extra bits of configuration # do the extra bits of configuration
# here we should have all the namespaces, pre-requirements in place # here we should have all the namespaces, pre-requirements in place
# XXX: this won't remove things that are delete from the directory # XXX: this won't remove things that are delete from the directory
......
...@@ -130,6 +130,7 @@ hub: ...@@ -130,6 +130,7 @@ hub:
jwt: jwt:
url: "http://jwt/" url: "http://jwt/"
display: false display: false
# recommended to keep in sync with common/playbooks/files/jupyterhub-jwt.yaml
image: image:
name: eginotebooks/hub name: eginotebooks/hub
tag: "sha-323c75e" tag: "sha-323c75e"
......
../../../common/playbooks/files/jupyterhub-jwt.yaml
\ No newline at end of file
...@@ -131,6 +131,7 @@ hub: ...@@ -131,6 +131,7 @@ hub:
jwt: jwt:
url: "http://jwt/" url: "http://jwt/"
display: false display: false
# recommended to keep in sync with common/playbooks/files/jupyterhub-jwt.yaml
image: image:
name: eginotebooks/hub name: eginotebooks/hub
tag: "sha-323c75e" tag: "sha-323c75e"
......
../../../common/playbooks/files/jupyterhub-jwt.yaml
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment