Created
September 1, 2017 13:09
-
-
Save gmaliar/a73f45b2fc2b029e7791f9a255ee953b to your computer and use it in GitHub Desktop.
label kubernetes nodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| INSTANCE_A=$(aws autoscaling describe-auto-scaling-instances | jq '.AutoScalingInstances[] | select(.AutoScalingGroupName == "nodes.production.persistent.us-east-1a.tailor-brands-k8s.com") | .InstanceId') | |
| INSTANCE_B=$(aws autoscaling describe-auto-scaling-instances | jq '.AutoScalingInstances[] | select(.AutoScalingGroupName == "nodes.production.persistent.us-east-1b.tailor-brands-k8s.com") | .InstanceId') | |
| INSTANCE_C=$(aws autoscaling describe-auto-scaling-instances | jq '.AutoScalingInstances[] | select(.AutoScalingGroupName == "nodes.production.persistent.us-east-1c.tailor-brands-k8s.com") | .InstanceId') | |
| NODES=$(aws ec2 describe-instances --filters Name=instance-id,Values=$INSTANCE_A,$INSTANCE_B,$INSTANCE_C | jq --raw-output '.Reservations[].Instances[].NetworkInterfaces[].PrivateDnsName') | |
| kubectl label nodes $NODES persistentNode=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment