From 086ba443d20e636a859fcd47616636b9bfc97da4 Mon Sep 17 00:00:00 2001 From: Ilija Kovacevic Date: Mon, 25 Dec 2023 15:00:20 +0100 Subject: [PATCH] add yaml definition of Kubernetes ressources --- .../modernizer/modernizer-backend-pod.yml | 14 +++++++++++ Kubernetes/modernizer/modernizer-ingress.yml | 25 +++++++++++++++++++ Kubernetes/modernizer/modernizer-service.yml | 17 +++++++++++++ .../ollama/ollama-chatbot-deployment.yml | 19 ++++++++++++++ Kubernetes/ollama/ollama-deployment.yml | 24 ++++++++++++++++++ Kubernetes/ollama/ollama-service.yaml | 16 ++++++++++++ Kubernetes/ubuntu.yml | 15 +++++++++++ 7 files changed, 130 insertions(+) create mode 100644 Kubernetes/modernizer/modernizer-backend-pod.yml create mode 100644 Kubernetes/modernizer/modernizer-ingress.yml create mode 100644 Kubernetes/modernizer/modernizer-service.yml create mode 100644 Kubernetes/ollama/ollama-chatbot-deployment.yml create mode 100644 Kubernetes/ollama/ollama-deployment.yml create mode 100644 Kubernetes/ollama/ollama-service.yaml create mode 100644 Kubernetes/ubuntu.yml diff --git a/Kubernetes/modernizer/modernizer-backend-pod.yml b/Kubernetes/modernizer/modernizer-backend-pod.yml new file mode 100644 index 0000000..fd577f7 --- /dev/null +++ b/Kubernetes/modernizer/modernizer-backend-pod.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Pod +metadata: + name: modernizer-backend + labels: + app: modernizer-backend +spec: + containers: + - image: registry.tech4comp.dbis.rwth-aachen.de/rwthacis/modernizer:latest + command: + - "./main" + imagePullPolicy: Always + name: modernizer-backend + restartPolicy: Always diff --git a/Kubernetes/modernizer/modernizer-ingress.yml b/Kubernetes/modernizer/modernizer-ingress.yml new file mode 100644 index 0000000..46a9025 --- /dev/null +++ b/Kubernetes/modernizer/modernizer-ingress.yml @@ -0,0 +1,25 @@ +kind: Ingress +apiVersion: networking.k8s.io/v1 +metadata: + name: modernizer-ingress2 + namespace: ba-kovacevic +spec: + tls: + - hosts: + - modernizer.milki-psy.dbis.rwth-aachen.de + secretName: nginx-tls + rules: + - host: modernizer.milki-psy.dbis.rwth-aachen.de + http: + paths: + - path: /(.*) + pathType: Prefix + backend: + service: + name: modernizer-service + port: + number: 443 +status: + loadBalancer: + ingress: + - ip: 137.226.232.176 diff --git a/Kubernetes/modernizer/modernizer-service.yml b/Kubernetes/modernizer/modernizer-service.yml new file mode 100644 index 0000000..44ff533 --- /dev/null +++ b/Kubernetes/modernizer/modernizer-service.yml @@ -0,0 +1,17 @@ +--- + +# nginx-service.yaml + +apiVersion: v1 +kind: Service +metadata: + name: modernizer-service +spec: + selector: + app: nginx + ports: + - name: https + protocol: TCP + port: 443 + targetPort: 80 # Expose port 443 + type: ClusterIP \ No newline at end of file diff --git a/Kubernetes/ollama/ollama-chatbot-deployment.yml b/Kubernetes/ollama/ollama-chatbot-deployment.yml new file mode 100644 index 0000000..eb10069 --- /dev/null +++ b/Kubernetes/ollama/ollama-chatbot-deployment.yml @@ -0,0 +1,19 @@ +# ollama-chatbot-deployment.yaml + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ollama-chatbot-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: ollama-chatbot + template: + metadata: + labels: + app: ollama-chatbot + spec: + containers: + - name: ollama-chatbot + image: ghcr.io/ivanfioravanti/chatbot-ollama:main \ No newline at end of file diff --git a/Kubernetes/ollama/ollama-deployment.yml b/Kubernetes/ollama/ollama-deployment.yml new file mode 100644 index 0000000..2d5de35 --- /dev/null +++ b/Kubernetes/ollama/ollama-deployment.yml @@ -0,0 +1,24 @@ +# ollama-deployment.yaml + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ollama-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: ollama + template: + metadata: + labels: + app: ollama + spec: + containers: + - name: ollama + image: ollama/ollama + resources: + limits: + nvidia.com/gpu: "1" + ports: + - containerPort: 11434 \ No newline at end of file diff --git a/Kubernetes/ollama/ollama-service.yaml b/Kubernetes/ollama/ollama-service.yaml new file mode 100644 index 0000000..e950473 --- /dev/null +++ b/Kubernetes/ollama/ollama-service.yaml @@ -0,0 +1,16 @@ +--- + +# ollama-service.yaml + +apiVersion: v1 +kind: Service +metadata: + name: ollama-service +spec: + selector: + app: ollama + ports: + - protocol: TCP + port: 443 + targetPort: 11434 + type: ClusterIP diff --git a/Kubernetes/ubuntu.yml b/Kubernetes/ubuntu.yml new file mode 100644 index 0000000..69403ea --- /dev/null +++ b/Kubernetes/ubuntu.yml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: ubuntu + labels: + app: ubuntu +spec: + containers: + - image: ubuntu + command: + - "sleep" + - "604800" + imagePullPolicy: IfNotPresent + name: ubuntu + restartPolicy: Always \ No newline at end of file