Newer
Older
---
- name: Enterprise Gateway Deployment
hosts: master
become: true
vars:
namespace: gateway
version: 3.2.2
tasks:
- name: Get Secrets from Vault for gateway
vars:
name: cesnet-mcc
set_fact:
secrets: "{{ lookup('community.hashi_vault.hashi_vault', vault_mount_point + '/gateway-' + name, token_validate=false) }}"
- name: Enterprise Gateway Configuration
copy:
dest: /tmp/gateway.yaml
mode: 0640
content: |
global:
rbac: true
deployment:
replicas: 1
# serviceAccountName: 'enterprise-gateway-sa'
terminationGracePeriodSeconds: 60
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
hostName: "{{ gateway_hostname }}"
tls:
- hosts:
- "{{ gateway_hostname }}"
secretName: acme-tls-gateway
# disabled: Spark, not installing Spark on gatewy clusters
allowedKernels:
- r_kubernetes
- python_kubernetes
# missing version 3.2.2
# - python_tf_kubernetes
# missing version 3.2.2
# - python_tf_gpu_kubernetes
kernelspecs:
image: valtri/eosc-notebooks-kernelspecs:latest
imagePullPolicy: Always
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
kip:
enabled: true
# serviceAccountName: 'kernel-image-puller-sa'
# podSecurityPolicy:
# create: true
service:
type: "ClusterIP"
ports:
# Enterprise Gateway reqursts
- name: http
port: 8888
targetPort: 8888
# Kernel connection info responses
- name: http-reponse
port: 8887
targetPort: 8887
- name: Enterprise Gateway Download
get_url:
url: "https://github.com/jupyter-server/enterprise_gateway/releases/download/v{{ version }}/jupyter_enterprise_gateway_helm-{{ version }}.tar.gz"
dest: "/tmp/jupyter_enterprise_gateway_helm-{{ version }}.tar.gz"
mode: 0644
- name: Enterprise Gateway Helm
vars:
config: >-
--namespace {{ namespace }}
--kube-context kubernetes-admin@kubernetes
-f /tmp/gateway.yaml
enterprise-gateway
/tmp/jupyter_enterprise_gateway_helm-{{ version }}.tar.gz
shell: |-
helm status --namespace {{ namespace }} enterprise-gateway
if [ $? -ne 0 ]; then
kubectl create namespace {{ namespace }} || :
helm install {{ config }}
else
helm upgrade {{ config }}
fi
environment:
KUBECONFIG: /etc/kubernetes/admin.conf
PATH: /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
when: true