From f02bb6b4575c2aed75d03df3095f359493cb7d96 Mon Sep 17 00:00:00 2001 From: Christopher Hase Date: Mon, 14 Apr 2025 11:50:35 +0200 Subject: [PATCH] add http-server part 8.3.2 --- backend-ingress.yaml | 22 ++++++++++++++++++++++ frontend-ingress.yaml | 24 ++++++++++++++++++++++++ frontend/event.ts | 2 +- ingress.yaml => old.2.ingress.yaml | 0 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 backend-ingress.yaml create mode 100644 frontend-ingress.yaml rename ingress.yaml => old.2.ingress.yaml (100%) diff --git a/backend-ingress.yaml b/backend-ingress.yaml new file mode 100644 index 0000000..e1d0239 --- /dev/null +++ b/backend-ingress.yaml @@ -0,0 +1,22 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: iching-backend-ingress + namespace: argocd +spec: + ingressClassName: nginx + rules: + - host: 192-168-197-2.c-one-infra.de + http: + paths: + - path: /iching/api(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: iching-service + port: + number: 81 + tls: + - hosts: + - 192-168-197-2.c-one-infra.de + secretName: argocd-net-tls \ No newline at end of file diff --git a/frontend-ingress.yaml b/frontend-ingress.yaml new file mode 100644 index 0000000..f18b0a4 --- /dev/null +++ b/frontend-ingress.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: iching-frontend-ingress + namespace: argocd + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + ingressClassName: nginx + rules: + - host: 192-168-197-2.c-one-infra.de + http: + paths: + - path: /iching(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: iching-service + port: + number: 80 + tls: + - hosts: + - 192-168-197-2.c-one-infra.de + secretName: argocd-net-tls \ No newline at end of file diff --git a/frontend/event.ts b/frontend/event.ts index 321c88b..3fa0de3 100644 --- a/frontend/event.ts +++ b/frontend/event.ts @@ -2,7 +2,7 @@ function handleClick(): void { console.log("Der Button wurde geklickt!"); //alert("Hallo von TypeScript!"); - fetch("/iching/api/command", { method: "POST" }) + fetch("/api/command", { method: "POST" }) .then(res => res.text()) .then(text => console.log("Server sagt:", text)) .catch(error => console.error("Fehler:", error)); diff --git a/ingress.yaml b/old.2.ingress.yaml similarity index 100% rename from ingress.yaml rename to old.2.ingress.yaml