EC2インスタンスのユーザデータに持っている isMaster
を利用する。
#!/bin/bash -ex
if [ $(curl -s http://169.254.169.254/latest/user-data/ | jq .isMaster) == "true" ]; then
echo Masterノードのみ実行する処理...
fi
More than 5 years have passed since last update.
EC2インスタンスのユーザデータに持っている isMaster
を利用する。
#!/bin/bash -ex
if [ $(curl -s http://169.254.169.254/latest/user-data/ | jq .isMaster) == "true" ]; then
echo Masterノードのみ実行する処理...
fi
Register as a new user and use Qiita more conveniently