Skip to content

Commit

Permalink
rough poc
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Pignot committed Nov 25, 2024
1 parent 2029506 commit 80583dd
Showing 6 changed files with 110 additions and 21 deletions.
22 changes: 7 additions & 15 deletions charts/bigdata-notebook-workspace/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -51,14 +51,8 @@ spec:
ports:
- containerPort: {{ .Values.containerPort.port }}
name: {{ .Values.containerPort.name }}
command:
- start-notebook.py
args:
{{- range $key, $value := .Values.server }}
- --ServerApp.{{ $key | snakecase }}={{$value}}
{{- end}}
- --GatewayWebSocketConnection.kernel_ws_protocol=''
- --GatewayClient.gateway_token_renewer_class=jupyter_server.gateway.spottokenrenewer.SpotTokenRenewer
- containerPort: 8877
name: http-response
env:
{{- if .Values.pvc.create }}
- name: "CHOWN_HOME"
@@ -67,19 +61,17 @@ spec:
value: "-R"
{{- end }}
{{- if .Values.gatewayClient.enabled }}
- name: "JUPYTER_GATEWAY_URL"
value: {{ .Values.gatewayClient.url }}
- name: "JUPYTER_GATEWAY_AUTH_TOKEN"
- name: "SPOTINST_AUTH_TOKEN"
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}
key: {{ .Values.gatewayClient.secretKeyToken }}
- name: "JUPYTER_GATEWAY_REQUEST_TIMEOUT"
value: {{ .Values.gatewayClient.requestTimeout | quote }}
- name: "JUPYTER_GATEWAY_HEADERS"
value: {{ .Values.gatewayClient.headers | quote }}
{{- end }}
{{- if .Values.pvc.create }}
- name: GP_OFAS_WKSP_ID
value: {{ .Release.Name }}
- name: GP_OFAS_CLUSTER_ID
value: "osc-cec441dc"
volumeMounts:
- name: {{ .Values.volume.name }}
mountPath: {{ .Values.volume.mountPath }}
40 changes: 40 additions & 0 deletions charts/bigdata-notebook-workspace/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "bigdata-notebook-workspace.fullname" . }}
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
resources:
- 'configmaps'
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "bigdata-notebook-workspace.fullname" . }}-pod-watcher
rules:
- apiGroups:
- ""
resources:
- 'pods'
- 'services'
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "bigdata-notebook-workspace.fullname" . }}-killer
rules:
- apiGroups:
- sparkoperator.k8s.io
resources:
- '*'
verbs:
- 'list'
- 'patch'
40 changes: 40 additions & 0 deletions charts/bigdata-notebook-workspace/templates/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "bigdata-notebook-workspace.fullname" . }}
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "bigdata-notebook-workspace.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "bigdata-notebook-workspace.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "bigdata-notebook-workspace.fullname" . }}-pod-watcher
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "bigdata-notebook-workspace.fullname" . }}-pod-watcher
subjects:
- kind: ServiceAccount
name: {{ include "bigdata-notebook-workspace.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "bigdata-notebook-workspace.fullname" . }}-killer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "bigdata-notebook-workspace.fullname" . }}-killer
subjects:
- kind: ServiceAccount
name: {{ include "bigdata-notebook-workspace.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
5 changes: 5 additions & 0 deletions charts/bigdata-notebook-workspace/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -20,5 +20,10 @@ spec:
targetPort: {{ .Values.containerPort.name }}
protocol: TCP
name: {{ .Values.containerPort.name }}
# The port on which Gateway Provisioners will receive kernel connection info responses.
- name: http-response
port: 8877
targetPort: 8877
protocol: TCP
selector:
{{- include "bigdata-notebook-workspace.selectorLabels" . | nindent 4 }}
12 changes: 12 additions & 0 deletions charts/bigdata-notebook-workspace/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "bigdata-notebook-workspace.serviceAccountName" . }}
labels:
{{- include "bigdata-notebook-workspace.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
12 changes: 6 additions & 6 deletions charts/bigdata-notebook-workspace/values.yaml
Original file line number Diff line number Diff line change
@@ -12,13 +12,13 @@ server:
allowOrigin: '*'

image:
repository: public.ecr.aws/ocean-spark/bigdata-notebook
pullPolicy: IfNotPresent
repository: 598800841386.dkr.ecr.us-east-2.amazonaws.com/dev/test-images
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: lab-4.1.8-ofas-31799c9
tag: bigdata-notebook-workspace-bigdata-notebook-workspace-gateway-provisioner

imagePullSecrets:
- name: spot-bigdata-image-pull
- name: spot-bigdata-image-pull-dev

nameOverride: ""
fullnameOverride: ""
@@ -44,9 +44,9 @@ sharedLabels: {}
sharedAnnotations: {}

serviceAccount:
create: false
create: true
annotations: {}
name: ""
name: bigdata-notebook-workspace

pvc:
create: true

0 comments on commit 80583dd

Please sign in to comment.