From d5f02f335d26f25af3241b73b42be06754ae2980 Mon Sep 17 00:00:00 2001 From: ImpSy <3097030+ImpSy@users.noreply.github.com> Date: Fri, 12 Apr 2024 15:25:56 +0200 Subject: [PATCH] use new bigdata-operator as notebook session backend --- charts/bigdata-notebook-service/Chart.yaml | 4 +- .../templates/deployment.yaml | 68 +++++++------------ charts/bigdata-notebook-service/values.yaml | 14 ++-- charts/bigdata-operator/Chart.yaml | 4 +- .../templates/api-service.yaml | 17 +++++ .../templates/deployment.yaml | 3 + .../{service.yaml => metric-service.yaml} | 1 + charts/bigdata-operator/values.yaml | 2 +- 8 files changed, 59 insertions(+), 54 deletions(-) create mode 100644 charts/bigdata-operator/templates/api-service.yaml rename charts/bigdata-operator/templates/{service.yaml => metric-service.yaml} (99%) diff --git a/charts/bigdata-notebook-service/Chart.yaml b/charts/bigdata-notebook-service/Chart.yaml index cd22734e..b36af642 100644 --- a/charts/bigdata-notebook-service/Chart.yaml +++ b/charts/bigdata-notebook-service/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: bigdata-notebook-service description: A Helm chart for the Spot Big Data Notebook Service type: application -version: 0.2.9 -appVersion: 0.82.1 +version: 0.3.0 +appVersion: 0.82.3 home: https://github.com/spotinst/charts icon: https://docs.spot.io/_media/images/spot_mark.png maintainers: diff --git a/charts/bigdata-notebook-service/templates/deployment.yaml b/charts/bigdata-notebook-service/templates/deployment.yaml index 3431feb7..4d9c2b25 100644 --- a/charts/bigdata-notebook-service/templates/deployment.yaml +++ b/charts/bigdata-notebook-service/templates/deployment.yaml @@ -28,43 +28,24 @@ spec: serviceAccountName: {{ include "bigdata-notebook-service.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - volumes: - - name: session-storage - persistentVolumeClaim: - claimName: {{ .Values.sessionStoragePvcName }} {{- if .Values.telemetry.enabled }} - - name: telementry-global-config - configMap: - name: bigdata-common-telemetry-fluentbit-cm - - name: telementry-custom-config - configMap: - name: {{ include "bigdata-notebook-service.fullname" . }}-telemetry-cm - - name: varlog - hostPath: - path: /var/log/ - - name: varlibdockercontainers - hostPath: - path: /var/lib/docker/containers - - name: telemetry-aws-credentials - secret: - secretName: spot-bigdata-telemetry-creds + volumes: + - name: telementry-global-config + configMap: + name: bigdata-common-telemetry-fluentbit-cm + - name: telementry-custom-config + configMap: + name: {{ include "bigdata-notebook-service.fullname" . }}-telemetry-cm + - name: varlog + hostPath: + path: /var/log/ + - name: varlibdockercontainers + hostPath: + path: /var/lib/docker/containers + - name: telemetry-aws-credentials + secret: + secretName: spot-bigdata-telemetry-creds {{- end }} - # 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: @@ -73,9 +54,6 @@ spec: protocol: TCP securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - volumeMounts: - - name: session-storage - mountPath: "/mnt" livenessProbe: exec: command: @@ -94,7 +72,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 @@ -113,12 +91,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: @@ -143,7 +125,7 @@ spec: optional: true resources: {{- toYaml .Values.resources | nindent 12 }} - {{- if .Values.telemetry.enabled }} + {{- if .Values.telemetry.enabled }} - name: fluentbit image: "{{ .Values.telemetry.fluentbit.image.repository }}:{{ .Values.telemetry.fluentbit.image.tag }}" ports: @@ -205,7 +187,7 @@ spec: mountPath: /var/lib/docker/containers - name: telemetry-aws-credentials mountPath: /root/.aws - {{- end }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/bigdata-notebook-service/values.yaml b/charts/bigdata-notebook-service/values.yaml index 98da05e3..c5ccc9a0 100644 --- a/charts/bigdata-notebook-service/values.yaml +++ b/charts/bigdata-notebook-service/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: 066597193667.dkr.ecr.us-east-1.amazonaws.com/private/bigdata-notebook-service pullPolicy: IfNotPresent - tag: 4d9d29b6 + tag: 01f57ad7 imagePullSecrets: - name: spot-bigdata-image-pull @@ -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" @@ -56,12 +57,13 @@ podLabels: podSecurityContext: fsGroup: 1000 + runAsNonRoot: true securityContext: {} livenessProbe: - initialDelaySeconds: 30 - periodSeconds: 10 + initialDelaySeconds: 10 + periodSeconds: 30 timeoutSeconds: 5 resources: diff --git a/charts/bigdata-operator/Chart.yaml b/charts/bigdata-operator/Chart.yaml index 41f4c2d1..181c5e89 100644 --- a/charts/bigdata-operator/Chart.yaml +++ b/charts/bigdata-operator/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: bigdata-operator description: Spot Ocean BigData Operator type: application -version: 0.4.13 -appVersion: 0.4.10 +version: 0.4.14 +appVersion: 0.4.11 home: https://github.com/spotinst/charts icon: https://docs.spot.io/_media/images/spot_mark.png sources: diff --git a/charts/bigdata-operator/templates/api-service.yaml b/charts/bigdata-operator/templates/api-service.yaml new file mode 100644 index 00000000..f4abf970 --- /dev/null +++ b/charts/bigdata-operator/templates/api-service.yaml @@ -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 diff --git a/charts/bigdata-operator/templates/deployment.yaml b/charts/bigdata-operator/templates/deployment.yaml index 2eb2debd..82d20173 100644 --- a/charts/bigdata-operator/templates/deployment.yaml +++ b/charts/bigdata-operator/templates/deployment.yaml @@ -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 }}" diff --git a/charts/bigdata-operator/templates/service.yaml b/charts/bigdata-operator/templates/metric-service.yaml similarity index 99% rename from charts/bigdata-operator/templates/service.yaml rename to charts/bigdata-operator/templates/metric-service.yaml index 54bed0a3..c25a3e90 100644 --- a/charts/bigdata-operator/templates/service.yaml +++ b/charts/bigdata-operator/templates/metric-service.yaml @@ -15,3 +15,4 @@ spec: {{- include "bigdata-operator.selectorLabels" . | nindent 4 }} sessionAffinity: None type: ClusterIP + diff --git a/charts/bigdata-operator/values.yaml b/charts/bigdata-operator/values.yaml index a78e52e5..535416f9 100644 --- a/charts/bigdata-operator/values.yaml +++ b/charts/bigdata-operator/values.yaml @@ -11,7 +11,7 @@ image: repository: public.ecr.aws/f4k1p1n4/bigdata-operator pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: 0.4.10-0c4f6b5d + tag: 0.4.11-429c6a8f imagePullSecrets: []