diff --git a/README.md b/README.md index bc3a9ac..dfcd6fc 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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: @@ -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: ``` @@ -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 diff --git a/src/Kube-Solo/Kube-Solo-Info.plist b/src/Kube-Solo/Kube-Solo-Info.plist index fe82400..27d2390 100644 --- a/src/Kube-Solo/Kube-Solo-Info.plist +++ b/src/Kube-Solo/Kube-Solo-Info.plist @@ -19,11 +19,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.1 + 1.0.2 CFBundleSignature ???? CFBundleVersion - 317 + 321 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/src/bin/install_deis b/src/bin/install_deis index 9a74399..5f931f3 100755 --- a/src/bin/install_deis +++ b/src/bin/install_deis @@ -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 # @@ -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 " " diff --git a/src/first-init.command b/src/first-init.command index 2cd66d8..a9902b2 100755 --- a/src/first-init.command +++ b/src/first-init.command @@ -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 diff --git a/src/functions.sh b/src/functions.sh index 8fcce64..e56a4d9 100755 --- a/src/functions.sh +++ b/src/functions.sh @@ -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 ..." # } diff --git a/src/k8s/add-ons.tgz b/src/k8s/add-ons.tgz index 5fe4637..99cf2f1 100644 Binary files a/src/k8s/add-ons.tgz and b/src/k8s/add-ons.tgz differ diff --git a/src/k8s/add-ons/dashboard-controller.yaml b/src/k8s/add-ons/dashboard-controller.yaml index 65ec641..78f942f 100644 --- a/src/k8s/add-ons/dashboard-controller.yaml +++ b/src/k8s/add-ons/dashboard-controller.yaml @@ -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: @@ -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: diff --git a/src/k8s/add-ons/dashboard-service.yaml b/src/k8s/add-ons/dashboard-service.yaml index 2c1c02f..195b503 100644 --- a/src/k8s/add-ons/dashboard-service.yaml +++ b/src/k8s/add-ons/dashboard-service.yaml @@ -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: diff --git a/src/k8s/add-ons/skydns-rc.yaml b/src/k8s/add-ons/skydns-rc.yaml index ec7af8c..36410b1 100644 --- a/src/k8s/add-ons/skydns-rc.yaml +++ b/src/k8s/add-ons/skydns-rc.yaml @@ -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 @@ -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 diff --git a/src/k8s/kube.tgz b/src/k8s/kube.tgz index e4a2c6d..99f63c7 100644 --- a/src/k8s/kube.tgz +++ b/src/k8s/kube.tgz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:20cd5eb6b4cfe2f3e27837983415d704ddd2f4ff3c1b19605e44789d900bed91 -size 106026337 +oid sha256:0c21cadf91ad4fd19425e0213b44ae60a31538edeb11bf4f6e01b0ebc4a94786 +size 87004248 diff --git a/src/k8s/kubectl b/src/k8s/kubectl index c80bdc0..f6fab7c 100755 --- a/src/k8s/kubectl +++ b/src/k8s/kubectl @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d620250527e5f419f09e4d73af040842d4fe8655ffa9bf771a8ee41da899c79b -size 63388912 +oid sha256:354487bb25442c6623c6cdd35bb9e4bc6cb7cb6e18d75c7efa1ede51d5f6a141 +size 50015968 diff --git a/src/up.command b/src/up.command index a5fcf5a..ae1f06c 100755 --- a/src/up.command +++ b/src/up.command @@ -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 diff --git a/src/update_osx_clients_files.command b/src/update_osx_clients_files.command index f6a31f7..2426125 100755 --- a/src/update_osx_clients_files.command +++ b/src/update_osx_clients_files.command @@ -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 #