path Types (PathType:) in K8s Ingress

From wikieduonline
(Redirected from PathType)
Jump to navigation Jump to search

pathType: ImplementationSpecific
pathType: Prefix
pathType: Exact


https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#strict-validate-path-type


       paths:
         - path: /(.*)
           pathType: ImplementationSpecific


apiVersion: networking.k8s.io/v1
kind: Ingress 
metadata:
  name: test-ingress
  annotations:
    nginx.ingress.kubernetes.io/use-regex: "true"
spec:
  ingressClassName: nginx
  rules:
  - host: test.com
    http:
      paths:
      - path: /foo/.*
        pathType: ImplementationSpecific
        backend:
          service:
            name: test
            port:
              number: 80

Errors[edit]

Admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: ingress contains invalid paths: path /?(.*) cannot be used with pathType Prefix

Solution: disable in nginx strict-validate-path-type or change pathType: ImplementationSpecific in every ingress.

Related[edit]

See also[edit]

Advertising: