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

ALB Ingress Weighted Target Group Support #421

Closed
jessesuen opened this issue Feb 29, 2020 · 2 comments · Fixed by #444
Closed

ALB Ingress Weighted Target Group Support #421

jessesuen opened this issue Feb 29, 2020 · 2 comments · Fixed by #444

Comments

@jessesuen
Copy link
Member

ALB Ingress Controller recently added support for AWS Weighted Target Groups as of their most recent v1.1.5 release.

kubernetes-sigs/aws-load-balancer-controller#1088

The ingress annotation for using weighted target groups look like:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: simple-ingress-example
  annotations:
    alb.ingress.kubernetes.io/actions.weighted-routing: '{"Type":"forward","ForwardConfig":{"TargetGroupStickinessConfig":{"Enabled":"True","DurationSeconds":100},"TargetGroups":[{"Weight":20,"ServiceName":"Service1","ServicePort":"80"},{"Weight":80,"TargetGroupArn":"arn:aws:******/external-legecy-tg"}]}}'
spec:
  rules:
  - host: m00nf1sh.example.com
    http:
      paths:
      - path: /foo
        backend:
          serviceName: weighted-routing
          servicePort: use-annotation

The one-line json for 'weighted-routing' above expands to:

{ 
   "Type":"forward",
   "ForwardConfig":{ 
      "TargetGroupStickinessConfig":{ 
         "Enabled":"True",
         "DurationSeconds":100
      },
      "TargetGroups":[ 
         { 
            "Weight":20,
            "ServiceName":"service1",
            "ServicePort":"80"
         },
         { 
            "Weight":80,
            "TargetGroupArn":"arn:aws:******/external-legecy-tg"
         }
      ]
   }
}

The above splits traffic between a Kubernetes Service, and an external-provisioned target group, arn:aws:******/external-legecy-tg.

I'm unsure if it would be possible to split between two Kubernetes services. If I interpret the following message correctly, it may not be possible:

The TargetGroups within ForwardConfig have been extended to allow use both Kubernetes Service and TargetGroupArn. Customers can configure backend with Kubernetes Service only / TargetGroupArn only / mix of two(for migration use case)

@jessesuen
Copy link
Member Author

Confirmed from implementor that it can target 2+ services:

jessesuen:argo: Today at 11:28 AM
@M00nF1sh - does the alb.ingress.kubernetes.io/actions.weighted-routing annotation support the ability to split traffic between two kubernetes services? Or is it only Kubernetes + External ARN?
4 replies

M00nF1sh 15 minutes ago
it supports two kubernetes service(or more) 😄

M00nF1sh 14 minutes ago
basically u can use either ServiceName+ServicePort or ExternalArn in the targetGroups array

@moensch
Copy link
Contributor

moensch commented Mar 12, 2020

Since Rollouts only modifies kubernetes Service objects during canary and doesn't touch AWS Target Groups, would we only support the ServiceName/ServicePort style of TargetGroup definition and not handle TargetGroupArn?

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

Successfully merging a pull request may close this issue.

3 participants