Ingress path issue

100 Views Asked by At

I have deployed my application in aks environment and I'm using ingress-nginx

my ingress rule file

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: allure-ingress
  namespace: allure-report
  annotations:
    nginx.ingress.kubernetes.io/auth-type: basic
    nginx.ingress.kubernetes.io/auth-secret: basic-auth
    cert-manager.io/cluster-issuer: letsencrypt-issuer
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    nginx.ingress.kubernetes.io/use-regex: "true"
spec:
  ingressClassName: nginx
  rules:
  - host: allure-report.com
    http:
      paths:
      - backend:
          service:
            name: allure-service
            port:
              number: 80
        path: /200/?(.*)
        pathType: Prefix
  tls:
  - hosts:
    - allure-report.com
    secretName: allure-ingress-secret

Thank you in advance

tried :

  • /200(/|$)(.*)
  • /200(/|/?.*)

above both are not even working for /200/ path

1

There are 1 best solutions below

1
Saifeddine Rajhi On

You use pathType: Prefix in your ingress.

While Ingress API allows users to specify different pathType on Ingress object.

pathType Exact and Prefix should allow only a small set of characters, pathType ImplementationSpecific allows any characters, as it may contain regexes, variables and other features that may be specific of the Ingress Controller being used.

You may use pathType ImplementationSpecific and try also /200(/|$)(.*)