Fargate using alb ingress controller getting error ValidationError: 1 validation error detected: Value 'app**'

0

Configured the ingress controller using the following configuration:

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: user
  namespace: frontend
  annotations:
    alb.ingress.kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
spec:
  # ingressClassName: alb
  rules:
    - host: "app-dev.marcelo.ai"
      http:
        paths:
          - path: /
            pathType: Exact
            backend:
              service:
                name: user-app
                port:
                  number: 80

When checking the logs, I am getting the following error:

{"level":"error","ts":1680300069.0612311,"logger":"controller.ingress","msg":"Reconciler error","name":"user","namespace":"frontend","error":"ValidationError: 1 validation error detected: Value 'app**' at 'tags.2.member.value' failed to satisfy constraint: Member must satisfy regular expression pattern: ^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$\n\tstatus code: 400, request id: 8c37758c-ba2d-4fea-825b-62f60df0a426"}
已提問 1 年前檢視次數 474 次
2 個答案
0

Hello,

Hope you are well.

From the question I gathered that using ALB Ingress with Fargate launch type resulted in some validation error and some guidance is required on resolving this.

The ingress YAML file looks good and host does allow "-" according to the Application Load Balancer (ALB) documentation [1]. Error from the AWS Load Balancer Controller log does highlight regex error where value starts with "app*" at "tags.2.member.value" is the root cause. However the only reference to "app*" as a value is the host and there are no "tags.2.member.value" anywhere...

In order to confirm if the error relates to the host, replication was carried out using the below YAML file on Fargate (including the snippet from the ingress provided):

---
apiVersion: v1
kind: Namespace
metadata:
  name: frontend
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: frontend
  name: deployment-frontend
spec:
  selector:
    matchLabels:
      app: my-nginx
  replicas: 1
  template:
    metadata:
      labels:
        app: my-nginx
    spec:
      containers:
      - image: public.ecr.aws/nginx/nginx:1-alpine-perl
        imagePullPolicy: Always
        name: frontend-app
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  namespace: frontend
  name: frontend-service
spec:
  ports:
    - port: 80
      targetPort: 80
      protocol: TCP
  type: NodePort
  selector:
    app: my-nginx
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: frontend
  name: frontend-ingress
  annotations:
    alb.ingress.kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
spec:
  ingressClassName: alb
  rules:
    - host: "app-dev.marcelo.ai"
      http:
        paths:
        - path: /
          pathType: Exact
          backend:
            service:
              name: frontend-service
              port:
                number: 80

The replication illustrated that there are no errors with the Ingress syntax/config as the ALB was created successfully with no errors as shown in the the AWS Load Balancer Controller logs.

For next steps:

  1. Please try use the same YAML spec above and see if it succeeds?
  2. Please kindly confirm the AWS Load Balancer Controller version used?
kubectl describe deployment -n kube-system aws-load-balancer-controller | grep Image
  1. Please kindly confirm if any mutatingwebhookconfiguration is present that could be adding tags?
kubectl get mutatingwebhookconfiguration

Looking forward to the response.

References:

[1] Listeners for your Application Load Balancers - Host conditions - https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#host-conditions

AWS
已回答 1 年前
0

Perfect, thanks, it seems that I finally got it working.

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南