Add jupyter notebook

This commit is contained in:
Benedith Mulongo 2025-01-28 14:32:02 +01:00
parent 2dfa37ec5f
commit c14e2adb27
Signed by: benedith
GPG key ID: 62D68B584B4B3EB3
9 changed files with 113 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- jupyter-persistent-volume.yaml
- jupyter-deployment.yaml
- jupyter-service.yaml

View file

View file

@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kafka
commonLabels:
env: dev
resources:
- ../../base/

View file

@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kafka
commonLabels:
env: prod
resources:
- ../../base/

View file

@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kafka
commonLabels:
env: test
resources:
- ../../base/

17
jupyter/readme.md Normal file
View file

@ -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