From 4c4a81c1a10714096e0e9d36a78e2440425c51e4 Mon Sep 17 00:00:00 2001 From: Ivan Filipovic Date: Mon, 4 May 2026 16:47:58 +0200 Subject: [PATCH] add: Traefik ingress with custom host --- k8s/moj-servis/ingress.yaml | 24 ++++++++++++++++++++++++ k8s/moj-servis/service.yaml | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 k8s/moj-servis/ingress.yaml diff --git a/k8s/moj-servis/ingress.yaml b/k8s/moj-servis/ingress.yaml new file mode 100644 index 0000000..b545038 --- /dev/null +++ b/k8s/moj-servis/ingress.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: moj-servis-ingress + namespace: student-ivanivso7 + annotations: + # ── Traefik specifične opcije ── + traefik.ingress.kubernetes.io/router.entrypoints: web,websecure + traefik.ingress.kubernetes.io/router.tls: "true" +spec: + ingressClassName: traefik + rules: + - host: moj-servis-ivanivso7.argocd.fpmoz.sum.ba + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: moj-servis-svc + port: + number: 80 + + diff --git a/k8s/moj-servis/service.yaml b/k8s/moj-servis/service.yaml index b793c18..c60cda2 100644 --- a/k8s/moj-servis/service.yaml +++ b/k8s/moj-servis/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: moj-servis-svc - namespace: student-ivanivso7 + namespace: student-VAS_KORISNIK spec: selector: app: moj-servis @@ -10,4 +10,4 @@ spec: - port: 80 targetPort: 8000 protocol: TCP - type: NodePort + type: ClusterIP # PROMIJENJENO iz NodePort