diff --git a/charts/bigdata-notebook-workspace/templates/deployment.yaml b/charts/bigdata-notebook-workspace/templates/deployment.yaml index b8d9cfe..c4f06a4 100644 --- a/charts/bigdata-notebook-workspace/templates/deployment.yaml +++ b/charts/bigdata-notebook-workspace/templates/deployment.yaml @@ -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 }} diff --git a/charts/bigdata-notebook-workspace/templates/role.yaml b/charts/bigdata-notebook-workspace/templates/role.yaml new file mode 100644 index 0000000..106a6c9 --- /dev/null +++ b/charts/bigdata-notebook-workspace/templates/role.yaml @@ -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' diff --git a/charts/bigdata-notebook-workspace/templates/role_binding.yaml b/charts/bigdata-notebook-workspace/templates/role_binding.yaml new file mode 100644 index 0000000..b7efefa --- /dev/null +++ b/charts/bigdata-notebook-workspace/templates/role_binding.yaml @@ -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 }} diff --git a/charts/bigdata-notebook-workspace/templates/service.yaml b/charts/bigdata-notebook-workspace/templates/service.yaml index cfceb84..a405c7f 100644 --- a/charts/bigdata-notebook-workspace/templates/service.yaml +++ b/charts/bigdata-notebook-workspace/templates/service.yaml @@ -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 }} diff --git a/charts/bigdata-notebook-workspace/templates/serviceaccount.yaml b/charts/bigdata-notebook-workspace/templates/serviceaccount.yaml new file mode 100644 index 0000000..cbfb082 --- /dev/null +++ b/charts/bigdata-notebook-workspace/templates/serviceaccount.yaml @@ -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 }} diff --git a/charts/bigdata-notebook-workspace/values.yaml b/charts/bigdata-notebook-workspace/values.yaml index 124b26c..be9c2a0 100644 --- a/charts/bigdata-notebook-workspace/values.yaml +++ b/charts/bigdata-notebook-workspace/values.yaml @@ -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