From 9a24502ee75102e714372eb53425fc33ff4d305a Mon Sep 17 00:00:00 2001 From: Abhishek Rana Date: Fri, 10 Nov 2023 15:16:57 +0100 Subject: [PATCH] Update routes --- .../features/routing-by-path-rewrite.yaml | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/k8s/charts/tech-stack/ingress/controller/nginx/features/routing-by-path-rewrite.yaml b/k8s/charts/tech-stack/ingress/controller/nginx/features/routing-by-path-rewrite.yaml index 910b9be..0499360 100644 --- a/k8s/charts/tech-stack/ingress/controller/nginx/features/routing-by-path-rewrite.yaml +++ b/k8s/charts/tech-stack/ingress/controller/nginx/features/routing-by-path-rewrite.yaml @@ -10,13 +10,14 @@ spec: - host: localhost http: paths: - - path: /users(/|$)(.*) + - path: /api/users(/|$)(.*) pathType: ImplementationSpecific backend: service: name: tech-stack-service-1 port: number: 5000 + --- apiVersion: networking.k8s.io/v1 kind: Ingress @@ -30,7 +31,7 @@ spec: - host: localhost http: paths: - - path: /v1/users(/|$)(.*) + - path: /api/v1/users(/|$)(.*) pathType: ImplementationSpecific backend: service: @@ -50,7 +51,7 @@ spec: - host: localhost http: paths: - - path: /products(/|$)(.*) + - path: /api/products(/|$)(.*) pathType: ImplementationSpecific backend: service: @@ -70,7 +71,7 @@ spec: - host: localhost http: paths: - - path: /v1/products(/|$)(.*) + - path: /api/v1/products(/|$)(.*) pathType: ImplementationSpecific backend: service: @@ -78,4 +79,24 @@ spec: port: number: 5000 --- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: service-3 + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$1 +spec: + ingressClassName: nginx + rules: + - host: localhost + http: + paths: + - path: /(.*) + pathType: ImplementationSpecific + backend: + service: + name: tech-stack-service-3 + port: + number: 8080 +---