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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则