Skip to content
This repository has been archived by the owner. It is now read-only.
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
114 lines (75 sloc) 4.13 KB

Easily Deploy CoreOS + Kubernetes Cluster to GCE

With a few simple scripts on your Mac OS X or Linux computer, you can deploy an elastic Kubernetes cluster on top of CoreOS using fleet to GCE. By default it is set to one master + three nodes.

Install dependencies if you do not have them on your OS X/Linux:

  • You need Google Cloud account and GC SDK installed
  • git

Clone this project and set settings:

git clone
cd coreos-multi-node-k8s-gce
  • edit settings and set project and zone, the rest of settings you can adjust by your requirements if you need to.

Start ssh-agent as it is used extensively by this script

Confirm your ssh-agent is running. Run the following command. If you see the error message then it is not running.

$ ssh-add -l
Could not open a connection to your authentication agent.

Start it up. Run the command ssh-agent. You should see somthing simlar to the following.

$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-ztSdihLxClVL/agent.24475; export SSH_AUTH_SOCK;
echo Agent pid 24476;

Cut and paste the three lines the command output and paste back into the terminal you're using to run the kubernetes commnands. We can then do a quick test to confirm that we're running ssh-agent as we expect.

$ ssh-add -l
The agent has no identities.

ssh-agent is a whole other category of software. You can look more into it here.

Bootstrap Kubernetes Cluster and install local clients

  • To bootstrap CoreOS cluster in GCE run:
  • To install local etcdctl, fleetctl and kubectl clients run:
  • Setup Kubernetes on CoreOS cluster run:
And that's it, you now have Kubernetes cluster with one master + 3 nodes running in GCE and required OS X/Linux clients etcdctl, fleetctl and kubectl installed on your computer.


When you are done the bootstraping Kubernetes cluster, from the same folder run to get shell preset to work with etcd, fleet and Kubernetes master.

Script output will show the following:


kube-apiserver.service			cc124065.../	active	running
kube-controller-manager.service	cc124065.../	active	running
kube-kubelet.service			21ed373b.../	active	running
kube-kubelet.service			770ff9fd.../	active	running
kube-kubelet.service			a9b4be28.../	active	running
kube-proxy.service				21ed373b.../	active	running
kube-proxy.service				770ff9fd.../	active	running
kube-proxy.service				a9b4be28.../	active	running
kube-scheduler.service			cc124065.../	active	running

NAME             LABELS                                  STATUS    Ready   Ready     Ready

Type exit when you are finished ...

At this point you are ready to start playing with Kubernetes using the kubectl command tool.

  • When you are done with just type exit or ctrl+d and on exit script will close all ssh connections to remote etcd control and Kubernetes master.
You can manually run script to update OS X/Linux etcdctl, fleetctl and kubectl clients.

Adding and removing machines

To add more nodes, just update settings node_count and run again. For removing nodes, simply destroy them via GCE developer console and fleet will reschedule the kube-kubelet and kube-proxy units.

If you are OS X user:

You can’t perform that action at this time.