0

I'm migrating an architecture to kubernetes and I'd like to use the Haproxy ingress controller that I'm installling with helm, according the documentation (version 1.3).

Thing is, when I'm defining path rules through an ingress file, I can't define Regex or Beging path types as seen on documentation here : https://haproxy-ingress.github.io/docs/configuration/keys/#path-type. My configuration file :

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
    name: bo-ingress
    annotations:
        haproxy.org/path-rewrite: "/"
        kubernetes.io/ingress.class: haproxy
spec:
    rules:
    - host: foo.com
      http:
        paths:
        - path: /
          pathType: Beging
          backend:
            service:
              name: foo-service
              port:
                number: 80

When I install my ingress helm chart with this configuration, I have that error message :

Error: UPGRADE FAILED: cannot patch "bo-ingress" with kind Ingress: Ingress.extensions "bo-ingress" is invalid: spec.rules[2].http.paths[12].pathType: Unsupported value: "Begin": supported values: "Exact", "ImplementationSpecific", "Prefix"

Am I missing something ? Is this feature only available for Enterprise plan ?

Thanks, Greg

GregOs
  • 403
  • 3
  • 13
  • You are seeing a validation error from the kubernetes api, it doesn't support `Begin` path type, so you should use `ImplementationSpecific` instead. `Begin` would be the default so you don't need to annotate. Other than that you are pointing to an implementation doc and probably using another one, double check the correct image url and annotation prefix in the getting started and config key docs. – Joao Morais Apr 05 '22 at 09:59

1 Answers1

1

HAProxy Ingress follows “Ingress v1 spec”, so any Ingress spec configuration should work as stated by the Kubernetes documentation.

As per the kubernetes documentation, the supported path types are ImplementationSpecific, Exact and Prefix. Paths that do not include an explicit pathType will fail validation. Here the path type Begin is not supported as per kubernetes documentation. So use either of those 3 types.

For more information on kubernetes supported path types refer to the documentation.