Giter Club home page Giter Club logo

coreos-multi-node-k8s-gce's Introduction

Easy Deploying CoreOS with Kubernetes 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 https://github.com/rimusz/coreos-multi-node-k8s-gce
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.

Bootstrap Kubernetes Cluster and install local clients

  • To bootstrap CoreOS cluster in GCE run:
1-bootstrap_cluster.sh
  • To install local etcdctl, fleetctl and kubectl clients run:
2-get_k8s_fleet_etcd.sh
  • Setup Kubernetes on CoreOS cluster run:
3-install_k8s_fleet_units.sh
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.

Usage

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

Script output will show the following:

/registry
/coreos.com

UNIT								MACHINE					ACTIVE		SUB
kube-apiserver.service			cc124065.../10.240.64.180	active	running
kube-controller-manager.service	cc124065.../10.240.64.180	active	running
kube-kubelet.service			21ed373b.../10.240.189.83	active	running
kube-kubelet.service			770ff9fd.../10.240.8.219	active	running
kube-kubelet.service			a9b4be28.../10.240.252.226	active	running
kube-proxy.service				21ed373b.../10.240.189.83	active	running
kube-proxy.service				770ff9fd.../10.240.8.219	active	running
kube-proxy.service				a9b4be28.../10.240.252.226	active	running
kube-scheduler.service			cc124065.../10.240.64.180	active	running

NAME             LABELS                                  STATUS
10.240.189.83    kubernetes.io/hostname=10.240.189.83    Ready
10.240.252.226   kubernetes.io/hostname=10.240.252.226   Ready
10.240.8.219     kubernetes.io/hostname=10.240.8.219     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 set_k8s_access.sh 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 2-get_k8s_fleet_etcd.sh 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 1-bootstrap_k8s_cluster.sh 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:

coreos-multi-node-k8s-gce's People

Contributors

rimusz avatar scout3r avatar a-robinson avatar gutweiler avatar

Watchers

Jacob Gadikian avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.