Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with weighted routing #2974

Closed
Fouz opened this issue Jan 13, 2023 · 3 comments
Closed

issue with weighted routing #2974

Fouz opened this issue Jan 13, 2023 · 3 comments

Comments

@Fouz
Copy link

Fouz commented Jan 13, 2023

I am trying to achieve weighted routing for two different deployments we have
i followed the example here I did a similar config looks like:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig":
      { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/healthcheck-interval-seconds: "5"
    alb.ingress.kubernetes.io/healthcheck-path: /healthz
    alb.ingress.kubernetes.io/healthcheck-timeout-seconds: "3"
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip 
    alb.ingress.kubernetes.io/actions.weighted-routing: |
      {
        "type":"forward",
        "forwardConfig":{
          "targetGroups":[
            {
              "serviceName":"service-a",
              "servicePort": "http" ,
              "weight":50
            },
            {
              "serviceName":"service-b",
              "servicePort": "http" ,
              "weight":50
            }
          ]
        }
      }
  name: ingres-xxx
  namespace: default
spec:
  ingressClassName: alb
  defaultBackend:
    service:
      name: service-a
      port:
        name: http
  rules:
  - host: xxx.abc.co
    http:
      paths:
      - backend:
          service:
            name: weighted-routing
            port:
              name: use-annotation
        path: /
        pathType: Prefix

The produced alb on aws looks good, except when I describe the ingress it shows this error, what is the explanation for the error?


Name:             ingres-xxx
Labels:           <none>
Namespace:        default
Address:          xxxx.xxx.amazonaws.com
Ingress Class:    alb
Default backend:  service-a:http (...)
Rules:
  Host                    Path  Backends
  ----                    ----  --------
  xxx.abc.co           
                          /   weighted-routing:use-annotation (<error: endpoints "weighted-routing" not found>)

Annotations:              alb.ingress.kubernetes.io/actions.ssl-redirect:
                            {"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}
                          alb.ingress.kubernetes.io/actions.weighted-routing:
                            {
                              "type":"forward",
                              "forwardConfig":{
                                "targetGroups":[
                                  {
                                    "serviceName":"service-a",
                                    "servicePort": 80 ,
                                    "weight":50
                                  },
                                  {
                                    "serviceName":"service-b",
                                    "servicePort": 80 ,
                                    "weight":50
                                  }
                                ]
                              }
                            }
                          alb.ingress.kubernetes.io/healthcheck-interval-seconds: 5
                          alb.ingress.kubernetes.io/healthcheck-path: /healthz
                          alb.ingress.kubernetes.io/healthcheck-timeout-seconds: 3
                          alb.ingress.kubernetes.io/listen-ports: [{"HTTP": 80}, {"HTTPS":443}]
                          alb.ingress.kubernetes.io/scheme: internet-facing
                          alb.ingress.kubernetes.io/target-type: ip
Events:
  Type    Reason                  Age   From     Message
  ----    ------                  ----  ----     -------
  Normal  SuccessfullyReconciled  8m7s  ingress  Successfully reconciled

Environment

  • Kubernetes version: v1.22
@kishorj
Copy link
Collaborator

kishorj commented Jan 17, 2023

@Fouz, there is no error from the controller, the ingress got deployed successfully. The (<error: endpoints "weighted-routing" not found>) is from kubectl describe since backend service resource weighted-routing doesn't exist in your cluster - the action annotation is specific to this controller.

@kishorj
Copy link
Collaborator

kishorj commented Jan 25, 2023

@Fouz, I'm closing the issue. If you have further concerns, feel free to reach out to us.

@kishorj kishorj closed this as completed Jan 25, 2023
@akitok
Copy link

akitok commented Jul 31, 2023

Hi, @kishorj .
I also set up weighted routing for two different deployments and got the same error message.
ALB configuration was propagated correctly by the controller, and the weighted routing was set as expected.

In this case, can I ignore this error message " (<error: endpoints "weighted-routing" not found>)"?
Or do I need to do something about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants