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

Commit

Permalink
v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rimusz committed Apr 12, 2015
1 parent d2f9b97 commit ef056f2
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/CoreOS k8s Cluster/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ - (IBAction)fleetUI:(id)sender {


- (IBAction)KubernetesUI:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://172.17.15.101:8001/#/dashboard/groups/type/selector/"]];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://172.17.15.101:8001/#/dashboard/minions"]];
}

- (void)runScript:(NSString*)scriptName arguments:(NSString*)arguments
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.3.1</string>
<string>0.3.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>65</string>
<string>67</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
29 changes: 14 additions & 15 deletions src/first-init.command
Original file line number Diff line number Diff line change
Expand Up @@ -122,24 +122,20 @@ cd ~/coreos-k8s-cluster/workers
vagrant up --provider virtualbox

# Add vagrant ssh key to ssh-agent
ssh-add ~/.vagrant.d/insecure_private_key
ssh-add ~/.vagrant.d/insecure_private_key >/dev/null 2>&1

echo Installing k8s files to master
echo " "
echo " Installing k8s files to master and nodes:"
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/* "
echo "Done with k8smaster-01 "
echo " "

echo Installing k8s files to nodes
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/* " >/dev/null 2>&1
#
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/* "
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/* "
echo "Done with k8snode-02 "
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/* " >/dev/null 2>&1
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/* " >/dev/null 2>&1
echo "Done installing ... "
echo " "

# download etcdctl and fleetctl
Expand All @@ -149,7 +145,7 @@ LATEST_RELEASE=$(vagrant ssh k8smaster-01 -c "etcdctl --version" | cut -d " " -f
cd ~/coreos-k8s-cluster/bin
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"
unzip -j -o "etcd.zip" "etcd-v$LATEST_RELEASE-darwin-amd64/etcdctl" >/dev/null 2>&1
rm -f etcd.zip
echo " "

Expand All @@ -159,7 +155,7 @@ LATEST_RELEASE=$(vagrant ssh k8smaster-01 -c 'fleetctl version' | cut -d " " -f
cd ~/coreos-k8s-cluster/bin
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"
unzip -j -o "fleet.zip" "fleet-v$LATEST_RELEASE-darwin-amd64/fleetctl" >/dev/null 2>&1
rm -f fleet.zip
echo " "

Expand Down Expand Up @@ -194,9 +190,12 @@ 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
# attach label to the nodes
~/coreos-k8s-cluster/bin/kubectl label nodes 172.17.15.102 node=worker1
~/coreos-k8s-cluster/bin/kubectl label nodes 172.17.15.103 node=worker2
#
echo " "
echo "k8s nodes list:"
echo "kubectl get nodes:"
~/coreos-k8s-cluster/bin/kubectl get nodes
echo " "

Expand Down
2 changes: 2 additions & 0 deletions src/k8s/download_k8s.command
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ chmod 755 kubectl
../wget -N -P ./master https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kube-apiserver
../wget -N -P ./master https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kube-controller-manager
../wget -N -P ./master https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kube-scheduler
../wget -N -P ./master https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kubectl
../wget -N -P ./master http://storage.googleapis.com/k8s/kube-register
tar czvf master.tgz -C master .
rm -f ./master/*

# nodes
../wget -N -P ./nodes https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kubelet
../wget -N -P ./nodes https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kube-proxy
../wget -N -P ./master https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kubectl
tar czvf nodes.tgz -C nodes .
rm -f ./nodes/*

Expand Down
Binary file modified src/k8s/master.tgz
Binary file not shown.
Binary file added src/k8s/master/kubectl
Binary file not shown.
Binary file modified src/k8s/nodes.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion src/os_shell.command
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ echo " "

# set kubernetes master
export KUBERNETES_MASTER=http://172.17.15.101:8080
echo "k8s nodes list:"
echo "kubectl get nodes:"
kubectl get nodes
echo " "

Expand Down
2 changes: 2 additions & 0 deletions src/update_k8s.command
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ echo "Downloading latest version of k8s master services"
~/coreos-k8s-cluster/bin/wget -N -P ~/coreos-k8s-cluster/tmp https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kube-apiserver
~/coreos-k8s-cluster/bin/wget -N -P ~/coreos-k8s-cluster/tmp https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kube-controller-manager
~/coreos-k8s-cluster/bin/wget -N -P ~/coreos-k8s-cluster/tmp https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kube-scheduler
~/coreos-k8s-cluster/bin/wget -N -P ~/coreos-k8s-cluster/tmp https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kubectl
~/coreos-k8s-cluster/bin/wget -N -P ~/coreos-k8s-cluster/tmp http://storage.googleapis.com/k8s/kube-register
tar czvf master.tgz *
cp -f master.tgz ~/coreos-k8s-cluster/control/
Expand All @@ -53,6 +54,7 @@ echo " "
echo "Downloading latest version of k8s node services"
~/coreos-k8s-cluster/bin/wget -N -P ~/coreos-k8s-cluster/tmp https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kubelet
~/coreos-k8s-cluster/bin/wget -N -P ~/coreos-k8s-cluster/tmp https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kube-proxy
~/coreos-k8s-cluster/bin/wget -N -P ~/coreos-k8s-cluster/tmp https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kubectl
tar czvf nodes.tgz *
cp -f nodes.tgz ~/coreos-k8s-cluster/workers/
# clean up tmp folder
Expand Down
71 changes: 47 additions & 24 deletions src/vagrant_up.command
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
# Created by Rimantas on 01/12/2014.
# Copyright (c) 2014 Rimantas Mocevicius. All rights reserved.

# path to the bin folder where we store our binary files
export PATH=${HOME}/coreos-k8s-cluster/bin:$PATH

# set etcd endpoint
export ETCDCTL_PEERS=http://172.17.15.101:4001

# set fleetctl endpoint
export FLEETCTL_ENDPOINT=http://172.17.15.101:4001
export FLEETCTL_STRICT_HOST_KEY_CHECKING=false
#

# set kubernetes master
export KUBERNETES_MASTER=http://172.17.15.101:8080
#

cd ~/coreos-k8s-cluster/control
machine_status=$(vagrant status | grep -o -m 1 'not created')

Expand All @@ -17,57 +32,65 @@ then
vagrant up --provider virtualbox

# Add vagrant ssh key to ssh-agent
ssh-add ~/.vagrant.d/insecure_private_key
ssh-add ~/.vagrant.d/insecure_private_key >/dev/null 2>&1

# install k8s files on master
echo " "
echo " Installing k8s files to master and nodes:"
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 "
echo "Done with k8smaster-01 "
echo " "
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 " >/dev/null 2>&1

# install k8s files on 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 "
echo "Done with k8snode-01 "
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 " >/dev/null 2>&1
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 " >/dev/null 2>&1
echo "Done installing ... "

# install fleet units
echo " "
echo "Installing fleet units:"
cd ~/coreos-k8s-cluster/fleet
fleetctl start *.service
echo " "
#
echo Waiting for Kubernetes cluster to be ready. This can take a few minutes...
spin='-\|/'
i=0
until ~/coreos-k8s-cluster/bin/kubectl version | grep 'Server Version' >/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.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 " "
# attach label to the nodes
~/coreos-k8s-cluster/bin/kubectl label nodes 172.17.15.102 node=worker1
~/coreos-k8s-cluster/bin/kubectl label nodes 172.17.15.103 node=worker2
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 "
echo "Done with k8snode-02 "
else
vagrant up
#
cd ~/coreos-k8s-cluster/workers
vagrant up
fi

# path to the bin folder where we store our binary files
export PATH=${HOME}/coreos-k8s-cluster/bin:$PATH

# set etcd endpoint
export ETCDCTL_PEERS=http://172.17.15.101:4001
#
echo "etcd cluster:"
etcdctl --no-sync ls /
echo ""

# set fleetctl endpoint
export FLEETCTL_ENDPOINT=http://172.17.15.101:4001
export FLEETCTL_STRICT_HOST_KEY_CHECKING=false
#
echo "fleetctl list-machines:"
fleetctl list-machines
echo " "
cd ~/coreos-k8s-cluster/fleet
fleetctl start *.service
#
echo "fleetctl list-units:"
fleetctl list-units
echo " "

sleep 5

# set kubernetes master
export KUBERNETES_MASTER=http://172.17.15.101:8080
echo "k8s nodes list:"
#
echo "kubectl get nodes:"
kubectl get nodes
echo " "

Expand Down

0 comments on commit ef056f2

Please sign in to comment.