3

I am trying to configure an aws alb ingress for an existing cluster which already has nginx ingress configured. This is the resource file I'm using in nginx ingress which works fine.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: "stage-ingress-1"
  namespace: "teststage"
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/backend-protocol: HTTP
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
    alb.ingress.kubernetes.io/certificate-arn:  <cert_arn>
    alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/scheme: internet-facing
  labels:
    app: test-ingress
spec:
  rules:
    - http:
        paths:
          - path: /(.*)
            backend:
              serviceName: ssl-redirect
              servicePort: use-annotation
          - path: /(.*)
            backend:
              serviceName: "test-service"
              servicePort: 80
      host: test.abc.com

However, I get an error saying

"msg"="Reconciler error" "error"="failed to reconcile listeners due to failed to reconcile rules due to failed modifying rule 2 on aws alb due to ValidationError: Condition value '/(.*)' contains a character that is not valid

I understand it is something to do with the path specified, but I do not get on how this has to be configured. This is the path which contains all my data.

Bhargav Mg
  • 337
  • 4
  • 12

1 Answers1

1

It is not regex. Its much more simple matching than that you want.

spec:
  rules:
    - http:
        paths:
          - path: /*
            backend:
              serviceName: ssl-redirect
              servicePort: use-annotation
          - path: /*
            backend:
              serviceName: "test-service"
              servicePort: 80
      host: test.abc.com
Josh Beauregard
  • 2,498
  • 2
  • 20
  • 37