Skip to content

Instantly share code, notes, and snippets.

@nithu0115
Last active December 26, 2019 17:29
Show Gist options
  • Save nithu0115/5b0e800822d3e70fda4efc46bb09d763 to your computer and use it in GitHub Desktop.
Save nithu0115/5b0e800822d3e70fda4efc46bb09d763 to your computer and use it in GitHub Desktop.
#!/bin/bash -x
export C=extravagant-outfit-1571795722
PAYLOAD=$(aws eks describe-cluster --name $C --query 'cluster.{CA: certificateAuthority.data,Endpoint: endpoint}' --region us-east-2)
echo $PAYLOAD | jq -rc .CA | base64 -d > /tmp/public_cert
ENDPOINT=$(echo $PAYLOAD | jq -rc .Endpoint)
curl -iv --cacert /tmp/public_cert -H "Authorization: Bearer "$(aws eks get-token --cluster-name $C | jq -rc .status.token) $ENDPOINT/api/v1/namespaces/default/pods/
while [ $? -ne 0 ]; do
"command error"
sleep 10s
done
echo "Node Check Passed"
systemctl restart kubelet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment