Backport "fixup! added script for dynamically registering a minion"

heat-coe-templates: I504ce3e49acbcc469a47501d0bd90e3eceb9647e

Change-Id: Id1b0a8bbe0bcbfdc9ada5c13930ea7e0181d5687
changes/77/185277/2
Tom Cammann 7 years ago
parent a40a4088ef
commit 63c1b6f4fc
  1. 8
      magnum/templates/heat-kubernetes/fragments/configure-kubernetes-minion.sh

@ -32,11 +32,5 @@ cat >> /etc/environment <<EOF
KUBERNETES_MASTER=http://$KUBE_MASTER_IP:8080
EOF
cpu=$(expr $(nproc) \* 1000)
memory_kb=$(cat /proc/meminfo | awk '/MemTotal: /{print $2}')
memory=$(expr $memory_kb \* 1024)
curl -sf -X POST -H 'Content-Type: application/json' \
--data-binary "{\"kind\":\"Minion\",\"id\":\"$myip\",\"apiVersion\":\"v1beta1\",
\"resources\":{\"capacity\":{\"cpu\":$cpu,\"memory\":$memory}}}" \
http://$KUBE_MASTER_IP:8080/api/v1beta1/minions
/usr/local/bin/kube-register

Loading…
Cancel
Save