GithubHelp home page GithubHelp logo

isabella232 / k8s-cluster Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atenart/k8s-cluster

0.0 0.0 0.0 26 KB

Fabric script to bootstrap a Kubernetes cluster from scratch on CoreOS

Nginx 100.00%

k8s-cluster's Introduction

k8s cluster

Bootstraps a CoreOS cluster from scratch, on top of which Kubernetes will run to manage our pods.

The installation should be as automated as possible. We also need to generate a few certificate authorities, to secure our cluster communications and authentications.

Overview

Once CoreOS is installed, three services are setup: Etcd (Distributed reliable key-value store), Fleet (low-level distributed init) and Flannel (network fabric for containers). Etcd and Flannel are needed to run Kubernetes, Fleet is enabled to allow starting core services outside the Kubernetes management.

We then setup Kubernetes, with currently a single master node. The DNS add-on is added, to easily lookup the Kubernetes services.

Finally a private Docker registry is started inside the cluster, to host our Docker images.

Usage

Requirements. We need some binaries to be available: cfssl, cfssljson, etcdctl, fleetctl and kubectl. Retrieve or build them and create a bin/ directory to store the binaries. You also need to install Fabric.

  1. Create a directory to host our cluster-specific files:

    $ mkdir cluster-<name>
    $ cd cluster-<name>
    
  2. Generate the trusted certificates:

    $ fab -f ../fabfile.py gen_certificates
    
  3. Sign your SSH key:

    $ fab -f ../fabfile.py sign_ssh_key:path=~/.ssh/id_rsa.pub
    
  4. For each node, run:

    $ fab -f ../fabfile.py -H <node> \
    	bootstrap_replica:hostname=<node_hn>,address=<node_addr>/<cidr>,gateway=<node_gw>
    

Local wrappers will be created in the current directory, to communicate with the cluster: docker, etcdctl, fleetctl and kubectl.

Use the private Docker registry

docker tag <image> <k8s master ip>:5000/<name>
docker push <k8s master ip>:5000/<name>

TODO

  • Etcd proxy support.
  • More than one Kubernetes master.
  • A Kubernetes upgrade mechanism.

k8s-cluster's People

Contributors

atenart 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.