Skip to content

Commit

Permalink
cheap and quick hack to get around 0.15 breaking changes.
Browse files Browse the repository at this point in the history
cf. kelseyhightower/kube-register#15 (from kubernetes/kubernetes#6380)

Signed-off-by: António Meireles <antonio.meireles@reformi.st>
  • Loading branch information
AntonioMeireles committed Apr 14, 2015
1 parent 3e9bff0 commit d45687c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
29 changes: 20 additions & 9 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,26 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# then to run as many times as the total number of VMs we only call them
# in the master (re: emyl/vagrant-triggers#13)...
if vmName == "master"
kHost.trigger.before [:up, :provision] do
info "regenerating kubLocalSetup"
system <<-EOT.prepend("\n\n") + "\n"
cat kubLocalSetup.tmpl | \
sed -e "s|__KUBERNETES_VERSION__|#{KUBERNETES_VERSION}|g" \
-e "s|__MASTER_IP__|#{MASTER_IP}|g" > kubLocalSetup
chmod +x kubLocalSetup
EOT
info "making sure localhosts' 'kubectl' matches what we just booted..."
system "./kubLocalSetup install"
end
# GoogleCloudPlatform/kubernetes#6380
# blob bellow coming from stock + https://github.com/kelseyhightower/kube-register#15
kHost.vm.provision :file, :source => "kube-register", :destination => "/tmp/kube-register"
kHost.vm.provision :shell, :privileged => true,
inline: <<-EOF
echo "using customized kube-register to get post 0.15.x"
chmod +x /tmp/kube-register
EOF

kHost.trigger.before [:up, :provision] do
info "checking host platform..."
system <<-EOT.prepend("\n\n") + "\n"
Expand All @@ -174,15 +194,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
system "rm -rf ~/.fleetctl/known_hosts"
end
kHost.trigger.after [:up] do
info "regenerating kubLocalSetup"
system <<-EOT.prepend("\n\n") + "\n"
cat kubLocalSetup.tmpl | \
sed -e "s|__KUBERNETES_VERSION__|#{KUBERNETES_VERSION}|g" \
-e "s|__MASTER_IP__|#{MASTER_IP}|g" > kubLocalSetup
chmod +x kubLocalSetup
EOT
info "making sure localhosts' 'kubectl' matches what we just booted..."
system "./kubLocalSetup install"
info "waiting for the cluster to be fully up..."
system <<-EOT.prepend("\n\n") + "\n"
until curl -o /dev/null -sIf http://#{MASTER_IP}:8080; do \
Expand Down
Binary file added kube-register
Binary file not shown.
7 changes: 4 additions & 3 deletions master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ coreos:
After=kube-apiserver.service
[Service]
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/kube-register
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-register
ExecStart=/opt/bin/kube-register \
# ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/kube-register
# ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-register
# ExecStart=/opt/bin/kube-register
ExecStart=/tmp/kube-register \
--metadata=role=minion \
--fleet-endpoint=unix:///var/run/fleet.sock \
--api-endpoint=http://127.0.0.1:8080
Expand Down

0 comments on commit d45687c

Please sign in to comment.