From cec2f9bf02a42b7df0dfaa58e2927ca181cdacb9 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sun, 15 May 2022 20:30:42 +0200 Subject: [PATCH] Fix nginx routing setup --- nginx/ingress.yaml | 25 +++++++++++-------------- nginx/service.yaml | 3 +++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/nginx/ingress.yaml b/nginx/ingress.yaml index 2dee392..e41cc09 100644 --- a/nginx/ingress.yaml +++ b/nginx/ingress.yaml @@ -8,22 +8,19 @@ spec: - /nginx --- -apiVersion: networking.k8s.io/v1 -kind: Ingress +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute metadata: name: nginx-ingress annotations: - kubernetes.io/ingress.class: "traefik" "traefik.ingress.kubernetes.io/router.middlewares": default-stripprefix@kubernetescrd + spec: - rules: - - host: nginx.localhost - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: nginx-svc - port: - number: 80 + entryPoints: + - web + routes: + - match: Host(`nginx.diogenes.halia`) + kind: Rule + services: + - name: nginx-svc + port: 80 diff --git a/nginx/service.yaml b/nginx/service.yaml index 1d973e2..1274b5a 100644 --- a/nginx/service.yaml +++ b/nginx/service.yaml @@ -2,7 +2,10 @@ apiVersion: v1 kind: Service metadata: name: nginx-svc + labels: + app: nginx spec: + type: ClusterIP ports: - name: http port: 80