Skip to content

Commit

Permalink
Merge pull request #530 from mumoshu/node-instance-id-label
Browse files Browse the repository at this point in the history
feat: Instance ID Node Label
  • Loading branch information
errordeveloper authored Feb 12, 2019
2 parents d61f737 + 305e8ff commit bbac8d6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
12 changes: 6 additions & 6 deletions pkg/nodebootstrap/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/nodebootstrap/assets/10-eksclt.al2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
EnvironmentFile=/etc/eksctl/metadata.env
# Global and static parameters: MAX_PODS, CLUSTER_DNS, NODE_LABELS
EnvironmentFile=/etc/eksctl/kubelet.env
# Local non-static parameters: NODE_IP
# Local non-static parameters: NODE_IP, INSTANCE_ID
EnvironmentFile=/etc/eksctl/kubelet.local.env

ExecStart=
ExecStart=/usr/bin/kubelet \
--node-ip=${NODE_IP} \
--cluster-dns=${CLUSTER_DNS} \
--max-pods=${MAX_PODS} \
--node-labels=${NODE_LABELS} \
--node-labels=${NODE_LABELS},alpha.eksctl.io/instance-id=${INSTANCE_ID} \
--allow-privileged=true \
--pod-infra-container-image=602401143452.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/eks/pause-amd64:3.1 \
--cloud-provider=aws \
Expand Down
1 change: 1 addition & 0 deletions pkg/nodebootstrap/assets/bootstrap.al2.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh -eu

echo "NODE_IP=$(curl --silent http://169.254.169.254/latest/meta-data/local-ipv4)" > /etc/eksctl/kubelet.local.env
echo "INSTANCE_ID=$(curl --silent http://169.254.169.254/latest/meta-data/instance-id)" >> /etc/eksctl/kubelet.local.env

systemctl daemon-reload
systemctl enable kubelet
Expand Down
3 changes: 2 additions & 1 deletion pkg/nodebootstrap/assets/bootstrap.ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash -eu

echo "NODE_IP=$(curl --silent http://169.254.169.254/latest/meta-data/local-ipv4)" > /etc/eksctl/kubelet.local.env
echo "INSTANCE_ID=$(curl --silent http://169.254.169.254/latest/meta-data/instance-id)" >> /etc/eksctl/kubelet.local.env

snap alias kubelet-eks.kubelet kubelet
snap alias kubectl-eks.kubectl kubectl
Expand All @@ -22,7 +23,7 @@ systemctl reset-failed
"node-ip=${NODE_IP}"
"cluster-dns=${CLUSTER_DNS}"
"max-pods=${MAX_PODS}"
"node-labels=${NODE_LABELS}"
"node-labels=${NODE_LABELS},alpha.eksctl.io/instance-id=${INSTANCE_ID}"
"authentication-token-webhook=true"
"authorization-mode=Webhook"
"allow-privileged=true"
Expand Down

0 comments on commit bbac8d6

Please sign in to comment.