diff --git a/jupyter/base/jupyter-deployment.yaml b/jupyter/base/jupyter-deployment.yaml new file mode 100644 index 0000000..1752b59 --- /dev/null +++ b/jupyter/base/jupyter-deployment.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: jupyter-notebook + namespace: jupyter +spec: + replicas: 1 + selector: + matchLabels: + app: jupyter-notebook + template: + metadata: + labels: + app: jupyter-notebook + spec: + containers: + - name: jupyter-notebook + image: quay.io/jupyter/datascience-notebook:python-3.12.8 + env: + - name: MINIO_ACCESS_KEY + valueFrom: + secretKeyRef: + name: minio-credentials + key: MINIO_ACCESS_KEY + - name: MINIO_SECRET_KEY + valueFrom: + secretKeyRef: + name: minio-credentials + key: MINIO_SECRET_KEY + - name: MINIO_ENDPOINT_URL + valueFrom: + secretKeyRef: + name: minio-credentials + key: MINIO_ENDPOINT_URL + ports: + - containerPort: 8888 + # env: + # - name: JUPYTER_TOKEN + # value: "your-secure-token" + volumeMounts: + - mountPath: /home/jovyan/work + name: notebook-data + volumes: + - name: notebook-data + persistentVolumeClaim: + claimName: jupyter-notebook-pvc diff --git a/jupyter/base/jupyter-persistent-volume.yaml b/jupyter/base/jupyter-persistent-volume.yaml new file mode 100644 index 0000000..75faf0d --- /dev/null +++ b/jupyter/base/jupyter-persistent-volume.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jupyter-notebook-pvc + namespace: jupyter +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 50Gi + storageClassName: csi-sc-cinderplugin diff --git a/jupyter/base/jupyter-service.yaml b/jupyter/base/jupyter-service.yaml new file mode 100644 index 0000000..31b2d02 --- /dev/null +++ b/jupyter/base/jupyter-service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: jupyter-notebook-service + namespace: jupyter +spec: + ports: + - port: 8888 + targetPort: 8888 + selector: + app: jupyter-notebook diff --git a/jupyter/base/kustomization.yaml b/jupyter/base/kustomization.yaml new file mode 100644 index 0000000..4daf1e1 --- /dev/null +++ b/jupyter/base/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- jupyter-persistent-volume.yaml +- jupyter-deployment.yaml +- jupyter-service.yaml diff --git a/jupyter/jupyter-application.yaml b/jupyter/jupyter-application.yaml new file mode 100644 index 0000000..e69de29 diff --git a/jupyter/overlays/dev/kustomization.yaml b/jupyter/overlays/dev/kustomization.yaml new file mode 100644 index 0000000..c043276 --- /dev/null +++ b/jupyter/overlays/dev/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: kafka +commonLabels: + env: dev +resources: +- ../../base/ diff --git a/jupyter/overlays/prod/kustomization.yaml b/jupyter/overlays/prod/kustomization.yaml new file mode 100644 index 0000000..364fcd4 --- /dev/null +++ b/jupyter/overlays/prod/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: kafka +commonLabels: + env: prod +resources: +- ../../base/ diff --git a/jupyter/overlays/test/kustomization.yaml b/jupyter/overlays/test/kustomization.yaml new file mode 100644 index 0000000..7398293 --- /dev/null +++ b/jupyter/overlays/test/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: kafka +commonLabels: + env: test +resources: +- ../../base/ diff --git a/jupyter/readme.md b/jupyter/readme.md new file mode 100644 index 0000000..98541cc --- /dev/null +++ b/jupyter/readme.md @@ -0,0 +1,17 @@ +kubectl create ns jupyter +kubectl -n jupyter apply -f jupyter-persistent-volume.yaml +kubectl -n jupyter apply -f jupyter-deployment.yaml +kubectl -n jupyter apply -f jupyter-service.yaml +kubectl -n jupyter apply -f s3-secrets-trino.yaml + +kubectl get pvc -n jupyter +kubectl get pvc -n jupyter + +kubectl -n jupyter port-forward svc/jupyter-notebook-service 8888:8888 + +kubectl -n jupyter logs jupyter-notebook-676fb4f85b-sb2h8 +kubectl -n jupyter describe jupyter-notebook-676fb4f85b-sb2h8 + +kubectl get no -o=wide + +!pip install \ No newline at end of file