Skip to content

Commit

Permalink
use new bigdata-operator as notebook session backend
Browse files Browse the repository at this point in the history
  • Loading branch information
ImpSy committed Apr 19, 2024
1 parent 0715a4c commit 80cdaa8
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 31 deletions.
33 changes: 7 additions & 26 deletions charts/bigdata-notebook-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,6 @@ spec:
serviceAccountName: {{ include "bigdata-notebook-service.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: session-storage
persistentVolumeClaim:
claimName: {{ .Values.sessionStoragePvcName }}
# This initContainers section should not be needed if the
# securityContext.fsGroup entry above wasn't ignored, but unfortunately
# it is ignored for NFS volumes:
# https://github.com/kubernetes/examples/issues/260
initContainers:
- name: nfs-fixer
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
securityContext:
runAsUser: 0
volumeMounts:
- name: session-storage
mountPath: "/mnt"
command:
- sh
- -c
- (chmod 0775 /mnt; chgrp 1000 /mnt)
containers:
- name: bigdata-notebook-service
ports:
Expand All @@ -56,9 +36,6 @@ spec:
protocol: TCP
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
volumeMounts:
- name: session-storage
mountPath: "/mnt"
livenessProbe:
exec:
command:
Expand All @@ -77,7 +54,7 @@ spec:
- name: EG_NAMESPACE
value: {{ .Release.Namespace }}
- name: EG_LIST_KERNELS
value: {{ .Values.eglistKernels }}
value: {{ .Values.egListKernels | quote }}
- name: EG_CULL_IDLE_TIMEOUT
value: {{ .Values.kernel.cullIdleTimeout | quote }}
- name: EG_LOG_LEVEL
Expand All @@ -96,12 +73,16 @@ spec:
value: "{{ sub .Values.kernel.portMax .Values.kernel.portMin }}"
- name: EG_KERNEL_SESSION_PERSISTENCE
value: "True"
- name: EG_AVAILABILITY_MODE
value: "replication"
- name: EG_KERNEL_SESSION_MANAGER
value: enterprise_gateway.services.sessions.kernelsessionmanager.WebhookKernelSessionManager
- name: EG_WEBHOOK_URL
value: "http://{{ .Values.sessionStorageServiceName }}.{{ .Release.Namespace }}.svc.cluster.local/kernelSession"
- name: EG_RESPONSE_ADDR_ANY
value: "True"
- name: EG_RESPONSE_PORT
value: {{ .Values.kernel.egResponsePort | quote }}
- name: EG_PERSISTENCE_ROOT
value: "/mnt"
- name: SPOTINST_CLUSTER_ID
valueFrom:
configMapKeyRef:
Expand Down
11 changes: 6 additions & 5 deletions charts/bigdata-notebook-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ ingress:

egBaseUrl: "/"
egLogLevel: "DEBUG"
egListKernels: "true"
egListKernels: "True"

# Has to be in sync with bigdata-operator chart
sessionStorageServiceName: bigdata-operator-api

# Has to be in sync with bigdata-notebook-service-storage chart
sessionStoragePvcName: bigdata-notebook-service-storage

spotBaseUrl: "https://api.spotinst.io"

Expand All @@ -60,8 +61,8 @@ podSecurityContext:
securityContext: {}

livenessProbe:
initialDelaySeconds: 30
periodSeconds: 10
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 5

resources:
Expand Down
17 changes: 17 additions & 0 deletions charts/bigdata-operator/templates/api-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "bigdata-operator.fullname" . }}-api
labels:
{{- include "bigdata-operator.labels" . | nindent 4 }}
spec:
ports:
- name: api
port: 80
protocol: TCP
targetPort: api
selector:
{{- include "bigdata-operator.selectorLabels" . | nindent 4 }}
sessionAffinity: None
type: ClusterIP
3 changes: 3 additions & 0 deletions charts/bigdata-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
- name: metrics
containerPort: 8080
protocol: TCP
- name: api
containerPort: 18080
protocol: TCP
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ spec:
{{- include "bigdata-operator.selectorLabels" . | nindent 4 }}
sessionAffinity: None
type: ClusterIP

0 comments on commit 80cdaa8

Please sign in to comment.