Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Modify NLB Draining manually.
#!/bin/bash
name=your_lb_svc
draining=30
lb=$(kubectl get service $name -o jsonpath="{.status.loadBalancer.ingress[*].hostname}")
arn=$(aws elbv2 describe-load-balancers --query "LoadBalancers[?DNSName=='$lb'].[LoadBalancerArn]" | jq -r '.[][]')
aws elbv2 describe-target-groups --load-balancer-arn $arn | jq -r ".TargetGroups[].TargetGroupArn" | \
xargs -I {} aws elbv2 modify-target-group-attributes --target-group-arn "{}" --attributes Key=deregistration_delay.timeout_seconds,Value=$draining
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.