diff --git a/depolyment-sagemath.yaml b/depolyment-sagemath.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ef3095c0ce412468e9b3e868a3d97803813f7da3 --- /dev/null +++ b/depolyment-sagemath.yaml @@ -0,0 +1,58 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sagemath + labels: + k8s-app: sagemath + # Change below to your namespace; bypasses -n namesapce + # namespace: csusb-ykim +spec: + replicas: 1 + selector: + matchLabels: + k8s-app: sagemath + template: + metadata: + labels: + k8s-app: sagemath + spec: + containers: + - name: sagemath + image: gitlab-registry.nrp-nautilus.io/youngsu_kim/csusb-meyer-sagemath/sagemath/sagemath:latest + # Above image is from + # sagemath/sagemath:9.1 + resources: + limits: + memory: "2G" + cpu: "2" + # nvidia.com/gpu: "1" + requests: + memory: "1G" + cpu: "1" + # nvidia.com/gpu: "0" + command: ["sh", "-c", "ln -s /mnt/examplevol/ ~/pvc-sage-meyer && cd pvc-sage-meyer ; sage -n jupyter --no-browser --ip='0.0.0.0' && sleep infinity"] + # command: ["sh", "-c", "ln -s /mnt/examplevol/ ~/pvc-sage-meyer && cd pvc-sage-meyer && sage -n jupyter --no-browser --ip='0.0.0.0' && sleep infinity"] + # Below requires having a PVC running + volumeMounts: + - mountPath: /mnt/examplevol + name: examplevol + volumes: + - name: examplevol + persistentVolumeClaim: + claimName: sagemath-meyer +# --- +# apiVersion: v1 +# kind: Service +# metadata: +# labels: +# k8s-app: sagemath +# name: sagemath-svc +# spec: +# ports: +# - port: 8888 +# protocol: TCP +# targetPort: 8888 +# # The name of the selecter needs to match with metadata.labels.k8s-app +# selector: +# k8s-app: sagemath +# type: ClusterIP \ No newline at end of file diff --git a/ingress-sagemath.yaml b/ingress-sagemath.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7fef45eeefe76619b4751bf70457a1ba7fde5adb --- /dev/null +++ b/ingress-sagemath.yaml @@ -0,0 +1,22 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: haproxy + name: sagemath-ingress +spec: + rules: + - host: sagemath.nrp-nautilus.io + http: + paths: + - path: / + pathType: Prefix + # Maybe the following name needs to match with the one in service.metadata.labels.k8s-app + backend: + service: + name: sagemath-svc + port: + number: 8888 + tls: + - hosts: + - sagemath.nrp-nautilus.io \ No newline at end of file diff --git a/pvc-sagemath.yaml b/pvc-sagemath.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b3062a380611872b9460529826a1a54ba04ce49a --- /dev/null +++ b/pvc-sagemath.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: sagemath-meyer + # namespace: csusb-ykim +spec: + storageClassName: rook-ceph-block + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + # Chage the size above if necessary \ No newline at end of file diff --git a/service-clusterip.yml b/service-clusterip.yml new file mode 100644 index 0000000000000000000000000000000000000000..1cc86216acfd64a14abaad4d23d00de102050a32 --- /dev/null +++ b/service-clusterip.yml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + k8s-app: sagemath + name: sagemath-svc +spec: + ports: + - port: 8888 + protocol: TCP + targetPort: 8888 + # The name of the selecter needs to match with metadata.labels.k8s-app + selector: + k8s-app: sagemath + type: ClusterIP \ No newline at end of file