Easy Kubernetes Cluster for macOS
This project is not maintained anymore, please use minikube instead
Kube-Cluster for macOS is a
status bar app which allows in an easy way to bootstrap and control multi-node (master+ two nodes) Kubernetes cluster on three CoreOS VMs.
It leverages macOS native Hypervisor virtualisation framework of using corectl command line tool, so there are no needs to use VirtualBox or any other virtualisation software anymore.
App's menu looks as per image below:
Head over to the Releases Page to grab the latest release.
How to install Kube-Cluster
- macOS 10.10.3 Yosemite or later
- Mac 2010 or later for this to work
- Note: Corectl App must be installed, which will serve as
corectldserver daemon control.
- iTerm2 is required, if not found the app it will install it by itself.
- Download Corectl App
latest dmgfrom the Releases Page and install it to
/Applicationsfolder, it allows to start/stop/update corectl tools needed to run CoreOS VMs on macOS
- Open downloaded
dmgfile and drag the App e.g. to your Desktop. Start the
Initial setup of Kube-Cluster VMswill run, then follow the instructions there.
- App's files are installed to
- App will bootstrap
master + two nodesKubernetes cluster on three VMs.
- Mac user home folder is automaticly mounted via NFS (it has to work on Mac end of course) to to Node VMs
/Users/my_useron each boot, check the PV example how to use Persistent Volumes.
- After successful install you can control kube-cluster VMs via
kclustercli as well. Cli resides in
~/kube-cluster/binfolder and has simple commands:
kcluster start|stop|status|ip. Just copy the
kclusterto your shell pre-set path.
The install will do the following:
- All dependent files/folders will be put under
kube-clusterfolder in the user's home folder e.g
- user-data file will have fleet, etcd and flannel set
- Will download latest CoreOS ISO image (if there is no such) and run
corectlto initialise VM
- When you first time do install or 'Up' after destroying Kube-Cluster setup, k8s binary files (with the version which was available when the App was built) get copied to CoreOS VMs, this speeds up Kubernetes cluster setup.
- It will install
fleetctl, kubectl, helm and deisclients to
- Kubernetes services will be installed with fleet units which are placed in
~/kube-cluster/fleet, this allows very easy updates to fleet units if needed.
- Fleet-UI via unit file will be installed to check running fleet units
- Kubernetes Dashboard and DNS will be instlled as add-ons
- Via assigned static IPs (which will be shown on first boot and will survive VMs reboots) you can access any port on any CoreOS VM
- Persistent sparse disks (QCow2)
xxx-data.imgwill be created and mounted to VMs as
/datafor these mount binds and other folders:
/data/var/lib/docker -> /var/lib/docker /data/var/lib/rkt -> /var/lib/rkt /var/lib/kubelet sym linked to /data/kubelet /data/opt/bin /data/var/lib/etcd2 /data/kubernetes
How it works
Kube-Cluster application and you will find a small icon with the Kubernetes logo in the Status Bar.
- There you can
OS ShellOS Shell (terminal) will have such environment set:
1) kubernetes master - export KUBERNETES_MASTER=http://192.168.64.xxx:8080 2) etcd endpoint - export ETCDCTL_PEERS=http://192.168.64.xxx:2379 3) fleetctl endpoint - export FLEETCTL_ENDPOINT=http://192.168.64.xxx:2379 4) fleetctl driver - export FLEETCTL_DRIVER=etcd 5) Path to ~/kube-cluster/bin where fleetctl, helmc, deis and kubectl are stored
Updates/Update Kubernetes to latest stable versionwill update to latest stable version of Kubernetes.
Updates\Change Kubernetes versionallows you to insatll any Kubernetes version available on github.com.
Updates/Update macOS fleetctl, helmc and deis clientswill update fleetctl to the same versions as Kube-Cluster Master runs and helmc and deis to the latest versions.
SSH to k8smaster01 and k8snode-01/02menu options will open VMs shell
- Fleet-UI dashboard will show running fleet units and etc
- Kubernetes Dashboard will show nice Kubernetes Dashboard, where you can check Nodes, Pods, Replication, Deployments, Service Controllers, deploy Apps and etc.
Example ouput of succesfull CoreOS + Kubernetes cluster install:
fleetctl list-units: UNIT MACHINE ACTIVE SUB fleet-ui.service 78ea6428.../192.168.64.5 active running kube-apiserver.service 78ea6428.../192.168.64.5 active running kube-controller-manager.service 78ea6428.../192.168.64.5 active running kube-scheduler.service 78ea6428.../192.168.64.5 active running kube-kubelet.service 1d00e269.../192.168.64.6 active running kube-kubelet.service de9127a5.../192.168.64.7 active running kube-proxy.service 1d00e269.../192.168.64.6 active running kube-proxy.service de9127a5.../192.168.64.7 active running Waiting for Kubernetes cluster to be ready. This can take a few minutes... \... Waiting for Kubernetes nodes to be ready. This can take a bit... -... node "k8snode-01" labeled node "k8snode-02" labeled Creating kube-system namespace ... Installing SkyDNS ... replicationcontroller "kube-dns-v17" created service "kube-dns" created Installing Kubernetes Dashboard ... Deployment "kubernetes-dashboard-v1.4.0" created service "kubernetes-dashboard" created kubectl get nodes: NAME STATUS AGE k8snode-01 Ready 6s k8snode-02 Ready 6s
You're now ready to use Kubernetes cluster.
Some examples to start with Kubernetes examples.
Other CoreOS VM based Apps for macOS
Kubernetes Solo Cluster VM App can be found here Kube-Solo for macOS.
Standalone CoreOS VM App (good for docker images building and testing) can be found here CoreOS VM for macOS.
CoreOS Cluster App without Kubernetes can be found here CoreOS Cluster for macOS.