Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
rimusz committed Mar 17, 2015
2 parents a0ce514 + 0ec730e commit 5ac8495
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ How to install
----------

Required software:
* [VirtualBox for Mac OS X hosts](https://www.virtualbox.org/wiki/Downloads), [Vagrant for Mac OS X](http://www.vagrantup.com/downloads.html) and [iTerm 2](http://www.iterm2.com/#/section/downloads)
* [VirtualBox](https://www.virtualbox.org/wiki/Downloads), [Vagrant](http://www.vagrantup.com/downloads.html) and [iTerm 2](http://www.iterm2.com/#/section/downloads)
* Unzip downloaded file and copy e.g. the App to Desktop.
* Start the `CoreOS k8s Cluster` App and from menu `Setup` and choose: `Initial setup of CoreOS-Vagrant k8s Cluster`

Expand Down
8 changes: 8 additions & 0 deletions src/CoreOS k8s Cluster.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
01741B67190DB82100BB1F91 /* update.command in Resources */ = {isa = PBXBuildFile; fileRef = 01741B66190DB82100BB1F91 /* update.command */; };
01AD94B81A277708009A400B /* gsed in Resources */ = {isa = PBXBuildFile; fileRef = 01AD94B71A277708009A400B /* gsed */; };
01AD94BF1A278C94009A400B /* force_coreos_update.command in Resources */ = {isa = PBXBuildFile; fileRef = 01AD94BE1A278C94009A400B /* force_coreos_update.command */; };
01BB60D11AB74A680069BF30 /* update_k8s.command in Resources */ = {isa = PBXBuildFile; fileRef = 01BB60D01AB74A680069BF30 /* update_k8s.command */; };
01BB60D31AB74AE60069BF30 /* k8s in Resources */ = {isa = PBXBuildFile; fileRef = 01BB60D21AB74AE60069BF30 /* k8s */; };
01D3685918E5C184006510B5 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 01D3685818E5C184006510B5 /* icon.icns */; };
01D415791AB6EDD000738471 /* update_vbox.command in Resources */ = {isa = PBXBuildFile; fileRef = 01D415781AB6EDD000738471 /* update_vbox.command */; };
01E2853E18A6C4E300BC630D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01E2853D18A6C4E300BC630D /* Cocoa.framework */; };
Expand Down Expand Up @@ -61,6 +63,8 @@
01741B66190DB82100BB1F91 /* update.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update.command; sourceTree = SOURCE_ROOT; };
01AD94B71A277708009A400B /* gsed */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = gsed; sourceTree = SOURCE_ROOT; };
01AD94BE1A278C94009A400B /* force_coreos_update.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = force_coreos_update.command; sourceTree = "<group>"; };
01BB60D01AB74A680069BF30 /* update_k8s.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update_k8s.command; sourceTree = "<group>"; };
01BB60D21AB74AE60069BF30 /* k8s */ = {isa = PBXFileReference; lastKnownFileType = folder; path = k8s; sourceTree = SOURCE_ROOT; };
01D3685818E5C184006510B5 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = "<group>"; };
01D415781AB6EDD000738471 /* update_vbox.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = update_vbox.command; sourceTree = "<group>"; };
01E2853A18A6C4E300BC630D /* CoreOS k8s Cluster.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CoreOS k8s Cluster.app"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -98,6 +102,7 @@
014E6F8B18B63AF700E697C0 /* Installation Files */ = {
isa = PBXGroup;
children = (
01BB60D21AB74AE60069BF30 /* k8s */,
01689B761A2D1CA80099CB78 /* Vagrantfiles */,
01689B721A2D1A260099CB78 /* fleet */,
01AD94B71A277708009A400B /* gsed */,
Expand Down Expand Up @@ -188,6 +193,7 @@
01AD94BE1A278C94009A400B /* force_coreos_update.command */,
01E55E0F1A8B8EE60080CED1 /* set_env.command */,
01D415781AB6EDD000738471 /* update_vbox.command */,
01BB60D01AB74A680069BF30 /* update_k8s.command */,
01741B66190DB82100BB1F91 /* update.command */,
);
name = Scripts;
Expand Down Expand Up @@ -278,6 +284,7 @@
01741B65190DB81400BB1F91 /* vagrant_up.command in Resources */,
011146561A7D9AF7008E0FB2 /* wget in Resources */,
011BBA391A2A829F00AAB35B /* vagrant_destroy.command in Resources */,
01BB60D11AB74A680069BF30 /* update_k8s.command in Resources */,
01E2855618A6C4E300BC630D /* Images.xcassets in Resources */,
011BBA341A2A7B0600AAB35B /* vagrant_node1.command in Resources */,
011BBA3F1A2A94A100AAB35B /* vagrant_reload.command in Resources */,
Expand All @@ -287,6 +294,7 @@
01741B57190DB7B800BB1F91 /* coreos-vagrant-install.command in Resources */,
011BBA3B1A2A842A00AAB35B /* change_release_channel.command in Resources */,
01689B731A2D1A260099CB78 /* fleet in Resources */,
01BB60D31AB74AE60069BF30 /* k8s in Resources */,
011BBA311A2A6E2500AAB35B /* coreos-wordmark-vert-color.png in Resources */,
01E55E101A8B8EE60080CED1 /* set_env.command in Resources */,
01E2854E18A6C4E300BC630D /* Credits.rtf in Resources */,
Expand Down
5 changes: 4 additions & 1 deletion src/CoreOS k8s Cluster/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1510" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6751" systemVersion="14D87p" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6751"/>
Expand Down Expand Up @@ -727,18 +727,21 @@
<action selector="update_k8s:" target="494" id="sO4-8I-toa"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="Q48-Nq-5bm"/>
<menuItem title="Update OS X fleetctl, etcdctl and fleet units" id="KSz-fW-Vbe">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="updates:" target="494" id="Zus-fv-0H4"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="vyH-FE-ksB"/>
<menuItem title="Force CoreOS VM Update" id="KYE-xq-LpJ" userLabel="Force CoreOS update">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="force_coreos_update:" target="494" id="0IT-Vl-bUB"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="cQ6-UI-uan"/>
<menuItem title="Check updates for CoreOS vbox" id="GeE-pc-UXF">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
Expand Down
4 changes: 2 additions & 2 deletions src/CoreOS k8s Cluster/CoreOS k8s Cluster-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.2.7</string>
<string>0.2.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>52</string>
<string>56</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion src/coreos-vagrant-install.command
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
cp "$1"/Vagrantfiles/user-data.node ~/coreos-k8s-cluster/workers/user-data

# copy k8s files
cp "$1"/k8s/kubectl
cp "$1"/k8s/kubectl ~/coreos-k8s-cluster/bin
chmod 755 ~/coreos-k8s-cluster/bin/kubectl
# linux binaries
cp "$1"/k8s/master.tgz ~/coreos-k8s-cluster/control
Expand Down
46 changes: 30 additions & 16 deletions src/first-init.command
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
# Created by Rimantas on 01/04/2014.
# Copyright (c) 2014 Rimantas Mocevicius. All rights reserved.

echo " "
echo Installing Kubernetes cluster...
echo " "
# install vagrant scp plugin
vagrant plugin install vagrant-scp


### getting files from github and setting them up
echo ""
echo "Downloading latest coreos-vagrant files from github to tmp folder: "
Expand Down Expand Up @@ -47,12 +49,10 @@ LOOP=1
while [ $LOOP -gt 0 ]
do
VALID_MAIN=0
echo " "
echo "Set CoreOS Release Channel:"
echo " 1) Alpha "
echo " 2) Beta "
echo " 3) Stable "
echo " "
echo "Select an option:"

read RESPONSE
Expand Down Expand Up @@ -113,9 +113,9 @@ read -p "$*"
}

# first up to initialise VMs
echo " "
echo "Setting up Vagrant VMs for CoreOS Kubernetes Cluster on OS X"
cd ~/coreos-k8s-cluster/control
vagrant box update
vagrant up --provider virtualbox
#
cd ~/coreos-k8s-cluster/workers
Expand All @@ -124,22 +124,23 @@ vagrant up --provider virtualbox
# Add vagrant ssh key to ssh-agent
ssh-add ~/.vagrant.d/insecure_private_key

# install k8s files on master
echo Installing k8s files to master
cd ~/coreos-k8s-cluster/control
vagrant scp master.tgz /home/core/
vagrant ssh k8smaster-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/master.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* && ls -alh /opt/bin "
vagrant ssh k8smaster-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/master.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* "
echo "Done with k8smaster-01 "
echo " "

# install k8s files on nodes
echo Installing k8s files to nodes
cd ~/coreos-k8s-cluster/workers
vagrant scp nodes.tgz /home/core/
#
vagrant ssh k8snode-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* && ls -alh /opt/bin "
vagrant ssh k8snode-01 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* "
echo "Done with k8snode-01 "
echo " "
vagrant ssh k8snode-02 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* && ls -alh /opt/bin "
vagrant ssh k8snode-02 -c "sudo /usr/bin/mkdir -p /opt/bin && sudo tar xzf /home/core/nodes.tgz -C /opt/bin && sudo chmod 755 /opt/bin/* "
echo "Done with k8snode-02 "
echo " "

# download etcdctl and fleetctl
#
Expand All @@ -150,11 +151,8 @@ echo "Downloading etcdctl $LATEST_RELEASE for OS X"
curl -L -o etcd.zip "https://github.com/coreos/etcd/releases/download/v$LATEST_RELEASE/etcd-v$LATEST_RELEASE-darwin-amd64.zip"
unzip -j -o "etcd.zip" "etcd-v$LATEST_RELEASE-darwin-amd64/etcdctl"
rm -f etcd.zip
# set etcd endpoint
export ETCDCTL_PEERS=http://172.17.15.101:4001
echo "etcd cluster:"
~/coreos-k8s-cluster/bin/etcdctl ls /
echo " "

#
cd ~/coreos-k8s-cluster/control
LATEST_RELEASE=$(vagrant ssh k8smaster-01 -c 'fleetctl version' | cut -d " " -f 3- | tr -d '\r')
Expand All @@ -163,6 +161,14 @@ echo "Downloading fleetctl v$LATEST_RELEASE for OS X"
curl -L -o fleet.zip "https://github.com/coreos/fleet/releases/download/v$LATEST_RELEASE/fleet-v$LATEST_RELEASE-darwin-amd64.zip"
unzip -j -o "fleet.zip" "fleet-v$LATEST_RELEASE-darwin-amd64/fleetctl"
rm -f fleet.zip
echo " "

# set etcd endpoint
export ETCDCTL_PEERS=http://172.17.15.101:4001
echo "etcd cluster:"
~/coreos-k8s-cluster/bin/etcdctl ls /
echo " "

# set fleetctl tunnel
export FLEETCTL_ENDPOINT=http://172.17.15.101:4001
export FLEETCTL_STRICT_HOST_KEY_CHECKING=false
Expand All @@ -178,12 +184,20 @@ echo "Finished installing fleet units"
~/coreos-k8s-cluster/bin/fleetctl list-units
echo " "

sleep 5

# set kubernetes master
export KUBERNETES_MASTER=http://172.17.15.101:8080
echo Waiting for Kubernetes cluster to be ready. This can take a few minutes...
spin='-\|/'
i=1
until ~/coreos-k8s-cluster/bin/kubectl version | grep 'Server Version' >/dev/null 2>&1; do printf "\b${spin:i++%${#sp}:1}"; sleep .1; done
i=0
until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.102 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
i=0
until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.103 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
#
echo " "
echo "k8s nodes list:"
kubectl get nodes
~/coreos-k8s-cluster/bin/kubectl get nodes
echo " "

#
Expand Down
16 changes: 16 additions & 0 deletions src/update.command
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ echo "Finished updating fleet units"
~/coreos-k8s-cluster/bin/fleetctl list-units
echo " "

# set kubernetes master
export KUBERNETES_MASTER=http://172.17.15.101:8080
echo Waiting for Kubernetes cluster to be ready. This can take a few minutes...
spin='-\|/'
i=1
until ~/coreos-k8s-cluster/bin/kubectl version | grep 'Server Version' >/dev/null 2>&1; do printf "\b${spin:i++%${#sp}:1}"; sleep .1; done
i=0
until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.102 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
i=0
until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.103 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
#
echo " "
echo "k8s nodes list:"
~/coreos-k8s-cluster/bin/kubectl get nodes
echo " "


#
echo "Update has finished !!!"
Expand Down
25 changes: 20 additions & 5 deletions src/update_k8s.command
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,31 @@ export FLEETCTL_ENDPOINT=http://172.17.15.101:4001
export FLEETCTL_STRICT_HOST_KEY_CHECKING=false
cd ~/coreos-k8s-cluster/fleet
~/coreos-k8s-cluster/bin/fleetctl stop *.service
sleep 10
sleep 5
~/coreos-k8s-cluster/bin/fleetctl start *.service
#
sleep 10
sleep 8
echo " "
cd ~/coreos-k8s-cluster/fleet
fleetctl start *.service
echo "fleetctl list-units:"
fleetctl list-units
~/coreos-k8s-cluster/bin/fleetctl list-units
echo " "

# set kubernetes master
export KUBERNETES_MASTER=http://172.17.15.101:8080
echo Waiting for Kubernetes cluster to be ready. This can take a few minutes...
spin='-\|/'
i=1
until ~/coreos-k8s-cluster/bin/kubectl version | grep 'Server Version' >/dev/null 2>&1; do printf "\b${spin:i++%${#sp}:1}"; sleep .1; done
i=0
until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.102 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
i=0
until ~/coreos-k8s-cluster/bin/kubectl get nodes | grep 172.17.15.103 >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
#
echo " "
echo "k8s nodes list:"
~/coreos-k8s-cluster/bin/kubectl get nodes
echo " "


echo "k8s update has finished !!!"
pause 'Press [Enter] key to continue...'

0 comments on commit 5ac8495

Please sign in to comment.