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

Commit

Permalink
Merge pull request #136 from TheNewNormal/v0.9.6
Browse files Browse the repository at this point in the history
v0.9.6
  • Loading branch information
rimusz authored Sep 28, 2016
2 parents e8a551b + 982fd5b commit 6971ffd
Show file tree
Hide file tree
Showing 18 changed files with 110 additions and 163 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/k8s/kube.tgz filter=lfs diff=lfs merge=lfs -text
src/k8s/kubectl filter=lfs diff=lfs merge=lfs -text
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ How to install Kube-Solo
- **macOS 10.10.3** Yosemite or later
- Mac 2010 or later for this to work.
- **Note: [Corectl App](https://github.com/TheNewNormal/corectl.app) must be installed, which will serve as `corectld` server daemon control.**
- [iTerm2](https://www.iterm2.com/) is required, if not found the app it will install it by itself.
- [iTerm2](https://www.iterm2.com/) is required, if not found the app will install it by itself.


###Install:
Expand All @@ -43,15 +43,15 @@ How to install Kube-Solo
- App will bootstrap `master+worker` Kubernetes cluster on the single VM
- Mac user home folder is automaticly mounted via NFS (it has to work on Mac end of course) to `/Users/my_user`:`/Users/my_user` on each VM boot, check the [PV example](https://github.com/TheNewNormal/kube-solo-osx/blob/master/examples/pv/nfs-pv-mount-on-pod.md) how to use Persistent Volumes.
- macOS `docker` client is installed to `~/kube-solo/bin` and preset in `OS shell` to be used from there, so you can build `docker` images on the VM and use with Kubernetes
- After successful install you can control `kube-solo` VM via `ksolo` cli as well. Cli resides in `~/kube-solo/bin` and `~/bin`folders and has simple commands: `ksolo start|stop|status|ip|ssh`, just add `~/bin` to your pre-set path.
- After successful install you can control `kube-solo` VM via `ksolo` cli as well. Cli resides in `~/kube-solo/bin` and `~/bin`folders and has simple commands: `ksolo start|stop|status|ip|ssh|shell`, just add `~/bin` to your pre-set path.

**The install will do the following:**

* All dependent files/folders will be put under `~/kube-solo` folder in the user's home folder e.g `/Users/someuser/kube-solo`.
* Will download latest CoreOS ISO image (if there is no such one) and run `corectl` to initialise VM
* When you first time do install or `Up` after destroying Kube-Solo setup, k8s binary files (with the version which was available when the App was built) get copied to VM, this allows to speed up Kubernetes setup.
* It will install `docker, helmc, helm, deis and kubectl` clients to `~/kube-solo/bin/`
* [Kubernetes Dashboard](http://kubernetes.io/docs/user-guide/ui/), [DNS](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns) and [Kubedash](https://github.com/kubernetes/kubedash) will be instlled as add-ons
* [Kubernetes Dashboard](http://kubernetes.io/docs/user-guide/ui/) and [DNS](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns) will be instlled as add-ons
* Via assigned static IP (it will be shown in first boot and will survive VM's reboots) you can access any port on CoreOS VM
* Persistent sparse disk (QCow2) `data.img` will be created and mounted to `/data` for these mount binds and other folders:

Expand Down Expand Up @@ -89,12 +89,11 @@ Path to `~/kube-solo/bin` where macOS clients and shell scripts are stored
* `ksolo stop` will stop VM
* `ksolo status`will show VM's status
* `ksolo ip` will show VM's IP
* `ksolo ssh` will open VM shell

* `ksolo ssh` will ssh to VM
* `ksolo shell` will open pre-set shell

###Other menu options:
* [Kubernetes Dashboard](http://kubernetes.io/docs/user-guide/ui/) will show nice Kubernetes Dashboard, where you can check Nodes, Pods, Replication, Deployments, Service Controllers, deploy Apps and etc.
* [Kubedash](https://github.com/kubernetes/kubedash) is a performance analytics UI for Kubernetes Clusters
* `Check for App updates` will check for a new app version
* `Updates/Update Kubernetes to the latest version` will update to latest version of Kubernetes.
* `Updates/Change Kubernetes version` will download and install specified Kubernetes version from GitHub.
Expand All @@ -117,8 +116,8 @@ KubeDNS is running at http://192.168.64.3:8080/api/v1/proxy/namespaces/kube-syst
kubernetes-dashboard is running at http://192.168.64.3:8080/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
Cluster version:
Client version: v1.3.2
Server version: v1.3.2
Client version: v1.4.0
Server version: v1.4.0
kubectl get nodes:
NAME STATUS AGE
Expand Down
Binary file modified kube-solo-osx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
16 changes: 0 additions & 16 deletions src/Kube-Solo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -326,22 +326,6 @@ - (IBAction)KubernetesUI:(id)sender {
}
}

- (IBAction)Kubedash:(id)sender {
VMStatus vmStatus = [self.vmManager checkVMStatus];

switch (vmStatus) {
case VMStatusDown:
[self notifyUserWithText:NSLocalizedString(@"VMStateOff", nil)];
break;

case VMStatusUp: {
NSString *vmIP = [NSString stringWithContentsOfURL:[NSURL ks_ipAddressURL] encoding:NSUTF8StringEncoding error:nil];
NSString *url = [NSString stringWithFormat:@"http://%@:8080/api/v1/proxy/namespaces/kube-system/services/kubedash", vmIP];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
break;
}
}
}

- (IBAction)quit:(id)sender {
VMStatus vmStatus = [self.vmManager checkVMStatus];
Expand Down
12 changes: 3 additions & 9 deletions src/Kube-Solo/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="16B2327e" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
Expand Down Expand Up @@ -684,12 +684,6 @@
<action selector="KubernetesUI:" target="494" id="5Xc-5r-fwB"/>
</connections>
</menuItem>
<menuItem title="Kubedash" id="bXS-8Q-f6a">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="Kubedash:" target="494" id="21F-qt-gCu"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="JNE-kH-7PZ"/>
<menuItem title="Check for App updates" id="Suo-Zv-Vbz">
<modifierMask key="keyEquivalentModifierMask"/>
Expand Down
4 changes: 2 additions & 2 deletions src/Kube-Solo/Kube-Solo-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.9.5</string>
<string>0.9.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>299</string>
<string>303</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
3 changes: 0 additions & 3 deletions src/bin/install_deis
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ vm_ip=$(~/bin/corectl q -i k8solo-01)

#
echo " "
echo "If you have installed previous versions of Deis Workflow PaaS, please uninstall it first"
echo "with '$ helmc uninstall workflow-VERSION -n deis' ..."
echo " "
echo "If you want to upgrade already installed version, check out how to do upgrade at https://deis.com/docs/workflow/managing-workflow/upgrading-workflow/ "
echo " "
pause 'Press [Enter] key to continue...'
Expand Down
16 changes: 8 additions & 8 deletions src/bin/ksolo
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@ start() {
"${app_path}"/up.command
}


stop() {
"${app_path}"/halt.command
}


status() {
echo "$(~/bin/corectl q -a k8solo-01)"
}


ip() {
echo "$(~/bin/corectl q -i k8solo-01)"
}
Expand All @@ -28,8 +21,12 @@ ssh() {
~/bin/corectl ssh k8solo-01
}

shell() {
"${app_path}"/os_shell.command
}

usage() {
echo "Usage: ksolo start|stop|status|ip|ssh"
echo "Usage: ksolo start|stop|status|ip|ssh|shell"
}


Expand All @@ -49,6 +46,9 @@ case "$1" in
ssh)
ssh
;;
shell)
shell
;;
*)
usage
;;
Expand Down
44 changes: 22 additions & 22 deletions src/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ rm -rf ~/kube-solo/tmp/*

# downloading latest version of k8s for CoreOS
echo "Downloading Kubernetes $K8S_VERSION"
bins=( kubectl kubelet kube-proxy kube-apiserver kube-scheduler kube-controller-manager )
bins=( kubelet kube-proxy kube-apiserver kube-scheduler kube-controller-manager )
for b in "${bins[@]}"; do
curl -k -L https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/$b > ~/kube-solo/tmp/$b
done
Expand Down Expand Up @@ -441,7 +441,7 @@ mv -f kubectl ~/kube-solo/kube
chmod 755 ~/kube-solo/bin/kubectl
#
tar xvf kubernetes.tar.gz --strip=2 kubernetes/server/kubernetes-server-linux-amd64.tar.gz
bins=( kubectl kubelet kube-proxy kube-apiserver kube-scheduler kube-controller-manager )
bins=( kubelet kube-proxy kube-apiserver kube-scheduler kube-controller-manager )
for b in "${bins[@]}"; do
tar xvf kubernetes-server-linux-amd64.tar.gz -C ~/kube-solo/tmp --strip=3 kubernetes/server/bin/$b
done
Expand Down Expand Up @@ -472,13 +472,19 @@ vm_ip=$(~/bin/corectl q -i k8solo-01)
# check if file ~/kube-solo/kube/kube.tgz exists
if [ ! -f ~/kube-solo/kube/kube.tgz ]
then
# copy k8s files
cp -f "${res_folder}"/k8s/kubectl ~/kube-solo/kube
chmod +x ~/kube-solo/bin/kubectl
# linux binaries tar file
cp -f "${res_folder}"/k8s/kube.tgz ~/kube-solo/kube
fi

# check if file ~/kube-solo/bin/kubectl exists
if [ ! -f ~/kube-solo/bin/kubectl ]
then
# copy k8s files
cp -f "${res_folder}"/k8s/kubectl ~/kube-solo/bin
chmod +x ~/kube-solo/bin/kubectl

fi

# install k8s files on to VM
echo "Installing Kubernetes files on to VM..."
cd ~/kube-solo/kube
Expand All @@ -492,6 +498,16 @@ echo "Done..."


function install_k8s_add_ons() {

# check if file ~/kube-solo/bin/kubectl exists
if [ ! -f ~/kube-solo/bin/kubectl ]
then
# copy k8s files
cp -f "${res_folder}"/k8s/kubectl ~/kube-solo/bin
chmod +x ~/kube-solo/bin/kubectl

fi

echo " "
echo "Creating kube-system namespace ..."
~/kube-solo/bin/kubectl create -f ~/kube-solo/kubernetes/kube-system-ns.yaml > /dev/null 2>&1
Expand All @@ -503,12 +519,8 @@ echo "Installing SkyDNS ..."
#
echo " "
echo "Installing Kubernetes Dashboard ..."
~/kube-solo/bin/kubectl create -f ~/kube-solo/kubernetes/dashboard-controller.yaml
~/kube-solo/bin/kubectl create -f ~/kube-solo/kubernetes/dashboard-service.yaml
#
echo " "
echo "Installing Kubedash ..."
~/kube-solo/bin/kubectl create -f ~/kube-solo/kubernetes/kubedash.yaml
~/kube-solo/bin/kubectl create -f ~/kube-solo/kubernetes/dashboard-controller.yaml
#
echo " "
echo "Installing Helm Tiller service ..."
Expand All @@ -522,18 +534,6 @@ rm -f ~/kube-solo/kubernetes/skydns-rc.yaml
rm -f ~/kube-solo/kubernetes/skydns-svc.yaml
rm -f ~/kube-solo/kubernetes/dashboard-controller.yaml
rm -f ~/kube-solo/kubernetes/dashboard-service.yaml
rm -f ~/kube-solo/kubernetes/kubedash.yaml
}


function install_k8s_add_ons_kubelet() {
# get App's Resources folder
res_folder=$(cat ~/kube-solo/.env/resouces_path)
#
echo " "
echo "Installing add-ons: SkyDNS, Kubernetes Dashboard and Kubedash ..."
~/bin/corectl scp "${res_folder}"/k8s/add-ons.tgz k8solo-01:/home/core/
~/bin/corectl ssh k8solo-01 'sudo tar xzf /home/core/add-ons.tgz -C /data/kubernetes/manifests'
}


Expand Down
11 changes: 7 additions & 4 deletions src/k8s/add-ons/dashboard-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: kubernetes-dashboard-v1.1.1
name: kubernetes-dashboard-v1.4.0
namespace: kube-system
labels:
k8s-app: kubernetes-dashboard
version: v1.1.1
version: v1.4.0
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
Expand All @@ -16,12 +16,15 @@ spec:
metadata:
labels:
k8s-app: kubernetes-dashboard
version: v1.1.1
version: v1.4.0
kubernetes.io/cluster-service: "true"
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec:
containers:
- name: kubernetes-dashboard
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.1.1
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.4.0
resources:
# keep request = limit to keep this container in guaranteed class
limits:
Expand Down
70 changes: 0 additions & 70 deletions src/k8s/add-ons/kubedash.yaml

This file was deleted.

Loading

0 comments on commit 6971ffd

Please sign in to comment.