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

Commit

Permalink
V1.0.2 (#165)
Browse files Browse the repository at this point in the history
* v1.0.2

* v1.0.2
  • Loading branch information
rimusz authored Dec 26, 2016
1 parent 31660e6 commit 252b46b
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 97 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ Kubernetes Solo cluster for macOS
Zero to Kubernetes development environment setup under two minutes
---------------

**Kube-Solo for macOS** is a `status bar App` which allows in an easy way to bootstrap and control Kubernetes cluster on a standalone [CoreOS](https://coreos.com) VM machine. VM can also be controlled via `ksolo` cli. Also VM's `docker` API is exposed to macOS, so you can build your docker images with the same app and use them with Kubernetes.
**Kube-Solo for macOS** is a `status bar App` which allows in an easy way to bootstrap and control Kubernetes cluster on a standalone [CoreOS](https://coreos.com) VM machine. VM can also be controlled via `ksolo` cli. Also VM's `docker` API is exposed to macOS, so you can build your docker images with the same app and use them with Kubernetes.

**Kube-Solo for macOS** is a similar app to [minikube](https://github.com/kubernetes/minikube), just has more functionality and is an older project. You can run both Apps on your Mac even in parallel.

![k8s-solo](k8s-singlenode.png)

It leverages **macOS native Hypervisor virtualisation framework** of using [corectl](https://github.com/TheNewNormal/corectl) command line tool, so there are no needs to use VirtualBox or any other virtualisation software anymore.

**Includes:** [Helm Classic](https://helm.sh) / [Helm v2](https://github.com/kubernetes/helm) - The Kubernetes Package Manager and an option from shell to install [Deis Workflow PaaS](https://deis.com) on top of Kubernetes with a simple: `$ install_deis`
**Includes:** [Helm v2](https://github.com/kubernetes/helm) - The Kubernetes Package Manager and an option from shell to install [Deis Workflow PaaS](https://deis.com/workflow) on top of Kubernetes with a simple: `$ install_deis` command.

**App's menu** looks as per image below:

Expand Down Expand Up @@ -50,7 +52,7 @@ How to install Kube-Solo
* 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/`
* It will install `docker, helm, deis and kubectl` clients to `~/kube-solo/bin/`
* [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 @@ -97,7 +99,7 @@ Path to `~/kube-solo/bin` where macOS clients and shell scripts are stored
* `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.
* `Updates/Update macOS helmc, helm, and deis clients` will update `helmc`, `helm` and `deis` to the latest version.
* `Updates/Update macOS helm and deis clients` will update `helm` and `deis` to the latest version.
* `Setup/` will allow you to do:

```
Expand All @@ -116,8 +118,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.4.0
Server version: v1.4.0
Client version: v1.5.1
Server version: v1.5.1
kubectl get nodes:
NAME STATUS AGE
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>1.0.1</string>
<string>1.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>317</string>
<string>321</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
87 changes: 30 additions & 57 deletions src/bin/install_deis
Original file line number Diff line number Diff line change
Expand Up @@ -3,88 +3,61 @@
# get App's Resources folder
res_folder=$(cat ~/kube-solo/.env/resouces_path)

#
source "${res_folder}"/functions.sh

function pause(){
read -p "$*"
}


# get VM's IP
vm_ip=$(~/bin/corectl q -i k8solo-01)

#
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...'
echo " "

# get lastest macOS helmc cli version
current_folder=$(pwd)
cd ~/kube-solo/bin
echo "Downloading latest version of helmc cli for macOS"
curl -o helmc https://storage.googleapis.com/helm-classic/helmc-latest-darwin-amd64
chmod +x helmc
echo " "
echo "Installed latest helmc cli to ~/kube-solo/bin ..."

# run helmc for the first time
helmc up
# add Deis Chart repo
helmc repo add deis https://github.com/deis/charts
# get the latest version of all Charts from all repos
helmc up
# get lastest macOS helm and deis cli version
download_osx_clients

# get latest Workflow version
WORKFLOW_RELEASE=$(ls ~/.helmc/cache/deis | grep workflow-v2. | grep -v -e2e | sort -rn | head -1 | cut -d'-' -f2)
# add Deis Workflow Chart repo
helm repo add deis https://charts.deis.com/workflow

# delete the old folder if such exists
rm -rf ~/.helmc/workspace/charts/workflow-${WORKFLOW_RELEASE}-kube-solo > /dev/null 2>&1
# updare repos charts list
helm repo update
echo " "

# fetch Deis Workflow Chart to your helmc's working directory
helmc fetch deis/workflow-${WORKFLOW_RELEASE} workflow-${WORKFLOW_RELEASE}-kube-solo
# copy files to ~/kube-solo/tmp folder
cp "${res_folder}"/deis/* ~/kube-solo/tmp

# delete monitoring components to save VM's resources
rm -rf ~/.helmc/workspace/charts/workflow-${WORKFLOW_RELEASE}-kube-solo/manifests/deis-monitor-* > /dev/null 2>&1
rm -rf ~/.helmc/workspace/charts/workflow-${WORKFLOW_RELEASE}-kube-solo/tpl/deis-monitor-* > /dev/null 2>&1
#
cd ~/kube-solo/tmp

# delete workflow-manager components to save VM's resources
rm -rf ~/.helmc/workspace/charts/workflow-${WORKFLOW_RELEASE}-kube-solo/manifests/deis-workflow-manager-* > /dev/null 2>&1
rm -rf ~/.helmc/workspace/charts/workflow-${WORKFLOW_RELEASE}-kube-solo/tpl/deis-workflow-manager-* > /dev/null 2>&1
# cleanup previuos install
rm -rf workflow

# run helmc generate
helmc generate -x manifests workflow-${WORKFLOW_RELEASE}-kube-solo
# fetch latest Workflow version and untar into the folder
helm fetch deis/workflow --untar

# update minio deployment with persistent volume
cp "${res_folder}"/deis/* ~/.helmc/workspace/charts/workflow-${WORKFLOW_RELEASE}-kube-solo/manifests
"${res_folder}"/bin/gsed -i '/readOnly: true/ r deis-minio-ds-1.txt' ~/kube-solo/tmp/workflow/charts/minio/templates/minio-deployment.yaml
"${res_folder}"/bin/gsed -i '/secretName: minio-user/ r deis-minio-ds-2.txt' ~/kube-solo/tmp/workflow/charts/minio/templates/minio-deployment.yaml

# update deis router
"${res_folder}"/bin/gsed -i 's/type: LoadBalancer/#type: LoadBalancer/' ~/kube-solo/tmp/workflow/charts/router/templates/router-service.yaml

cd ~/.helmc/workspace/charts/workflow-${WORKFLOW_RELEASE}-kube-solo/manifests
"${res_folder}"/bin/gsed -i '/readOnly: true/ r deis-minio-ds-1.txt' deis-minio-deployment.yaml
cat deis-minio-ds-2.txt >> deis-minio-deployment.yaml
rm -f *.txt

# Install Deis
helmc install workflow-${WORKFLOW_RELEASE}-kube-solo
# Install/upgrade Deis Workflow
echo "Installing/upgrading Workflow to latest available version ..."
helm upgrade workflow ./workflow --namespace=deis -i

sleep 3

# get lastest macOS deis cli version
cd ~/kube-solo/bin
echo " "
echo "Downloading latest version of Workflow deis cli for macOS"
curl -o deis https://storage.googleapis.com/workflow-cli/deis-latest-darwin-amd64
chmod +x deis
echo " "
echo "Installed latest deis cli to ~/kube-solo/bin ..."
echo " "
echo "To learn more about deis client, execute:"
echo "deis -h"
echo " "
#
echo "Waiting for Deis Workflow to be ready... but first, coffee! "
spin='-\|/'
i=1
until kubectl --namespace=deis get po | grep [d]eis-minio- | grep "1/1" >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
until kubectl --namespace=deis get po | grep [d]eis-builder- | grep "1/1" >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
until kubectl --namespace=deis get po | grep [d]eis-registry- | grep "1/1" >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
until kubectl --namespace=deis get po | grep [d]eis-database- | grep "1/1" >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
until kubectl --namespace=deis get po | grep [d]eis-minio- | grep "1/1" >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
until kubectl --namespace=deis get po | grep [d]eis-router- | grep "1/1" >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
until kubectl --namespace=deis get po | grep [d]eis-controller- | grep "1/1" >/dev/null 2>&1; do i=$(( (i+1) %4 )); printf "\r${spin:$i:1}"; sleep .1; done
#
Expand All @@ -94,7 +67,7 @@ sleep 10
# run deis register user
echo " "
echo "Registering admin user ..."
deis register deis.$vm_ip.nip.io
deis register http://deis.$vm_ip.nip.io

# add ssh key to Deis PaaS
echo " "
Expand Down
2 changes: 1 addition & 1 deletion src/first-init.command
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ echo " "
#
install_k8s_add_ons

# download latest version of docker, deis, helmc and helm clients
# download latest version of docker, deis, and helm clients
# install Helm Tiller
download_osx_clients

Expand Down
20 changes: 4 additions & 16 deletions src/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -303,25 +303,13 @@ else
echo "Helm is ready to sail ..."
fi
#

# get lastest macOS helmc cli version
cd ~/kube-solo/bin
echo " "
echo "Downloading latest version of 'helmc' cli for macOS"
curl -o helmc https://storage.googleapis.com/helm-classic/helmc-latest-darwin-amd64
chmod +x helmc
echo " "
echo "Installed latest 'helmc' cli to ~/kube-solo/bin ..."
#

# get lastest macOS deis cli version
cd ~/kube-solo/bin
echo " "
echo "Downloading latest version of Deis Workflow 'deis' cli for macOS"
curl -o deis https://storage.googleapis.com/workflow-cli/deis-latest-darwin-amd64
echo "Downloading latest version of Workflow deis cli for macOS"
curl -sSL http://deis.io/deis-cli/install-v2.sh | bash
chmod +x deis
mv -f deis ~/kube-solo/bin/deis
echo "Installed latest deis cli to ~/kube-solo/bin ..."
echo " "
echo "Installed latest 'deis cli' to ~/kube-solo/bin ..."
#
}

Expand Down
Binary file modified src/k8s/add-ons.tgz
Binary file not shown.
3 changes: 1 addition & 2 deletions src/k8s/add-ons/dashboard-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# This file should be kept in sync with cluster/gce/coreos/kube-manifests/addons/dashboard/dashboard-controller.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
Expand All @@ -21,7 +20,7 @@ spec:
spec:
containers:
- name: kubernetes-dashboard
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.4.2
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.0
resources:
# keep request = limit to keep this container in guaranteed class
limits:
Expand Down
1 change: 0 additions & 1 deletion src/k8s/add-ons/dashboard-service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# This file should be kept in sync with cluster/gce/coreos/kube-manifests/addons/dashboard/dashboard-service.yaml
apiVersion: v1
kind: Service
metadata:
Expand Down
12 changes: 6 additions & 6 deletions src/k8s/add-ons/skydns-rc.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-dns-v19
name: kube-dns-v20
namespace: kube-system
labels:
k8s-app: kube-dns
version: v19
version: v20
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
k8s-app: kube-dns
version: v19
version: v20
template:
metadata:
labels:
k8s-app: kube-dns
version: v19
version: v20
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec:
containers:
- name: kubedns
image: gcr.io/google_containers/kubedns-amd64:1.7
image: gcr.io/google_containers/kubedns-amd64:1.8
resources:
# TODO: Set memory limits when we've profiled the container for large
# clusters, then set request = limit to keep this container in
Expand Down Expand Up @@ -64,7 +64,7 @@ spec:
name: dns-tcp-local
protocol: TCP
- name: dnsmasq
image: gcr.io/google_containers/kube-dnsmasq-amd64:1.3
image: gcr.io/google_containers/kube-dnsmasq-amd64:1.4
livenessProbe:
httpGet:
path: /healthz-dnsmasq
Expand Down
4 changes: 2 additions & 2 deletions src/k8s/kube.tgz
Git LFS file not shown
4 changes: 2 additions & 2 deletions src/k8s/kubectl
Git LFS file not shown
2 changes: 1 addition & 1 deletion src/up.command
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi
mkdir ~/kube-solo/logs > /dev/null 2>&1

# copy bin files to ~/kube-solo/bin
rsync -r --verbose --exclude 'helmc' --exclude 'helm' --exclude 'gen_kubeconfig' "${res_folder}"/bin/* ~/kube-solo/bin/ > /dev/null 2>&1
rsync -r --verbose --exclude 'helm' --exclude 'gen_kubeconfig' "${res_folder}"/bin/* ~/kube-solo/bin/ > /dev/null 2>&1
chmod 755 ~/kube-solo/bin/*

# copy ksolo file to ~/bin
Expand Down
2 changes: 1 addition & 1 deletion src/update_osx_clients_files.command
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ chmod 755 ~/kube-solo/bin/*
# download docker latest version
download_docker_client

# download latest version of deis and helmc clients
# download latest version of deis and helm clients
download_osx_clients
#

Expand Down

0 comments on commit 252b46b

Please sign in to comment.