GithubHelp home page GithubHelp logo

seletskiy / kubernetes-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 3.0 11 KB

Makefile for bootstrapping kubernetes cluster with Calico CNI & private Docker Image Registry

Makefile 100.00%
kubernetes kubernetes-setup calico docker-image-registry

kubernetes-bootstrap's Introduction

Kubernetes Bootstrap

Kubernetes installation on Ubuntu 16+ with Calico CNI (with hostPort enabled) and private Docker Image registry DaemonSet on each node.

Bootstrap provides:

  • Kubernetes installation via kubeadm,
  • Kubernetes initialization via kubeadm with pods CIDR 192.168.0.0/16 (Calico CNI),
  • Calico CNI configuration with chained portmap plugin (requirement for hostPort);
  • Docker Image Registry via DaemonSet on each node (localhost:5000), restricted to localhost for security (by Calico Policy Rules).

Main difference from other guides and tutorials is that provided installation supports hostPort option in ports mapping for containers (using portmap plugin), so it's possible to expose container's port to host system. Also, Docker Image Registry is protected by Calico Network Policy rule to exclude external access.

Requirements

  • Ubuntu 16+,
  • 2 CPU, 2Gb RAM.

Usage

Commands starting with @@ requires root login (or sudo) at target host.

All required parameters should be specified as variables assignment in form of make <var>=<value>... <command>

make @@install

Installs kubeadm to target host.

Parameters:

  • host — target host.

make @@init

Initializes kubernetes master, Calico CNI and Docker Image Registry.

Copy join token from command output to join additional nodes.

Label one of your nodes with role: image-registry in order to allocate Docker Image Register node.

Parameters:

  • host — target host.

NOTE: to allocate image registry you need to label one of your nodes with node: image-registry:

kubectl label nodes <your-registry-node> role=image-registry

make @@join

Joins target host to kubernetes master.

Parameters:

  • host — target host,
  • token — token to join host to master,
  • master — master server address (<host>:<port>).

make @@create-user

Create user certificate and key, signs user certificate using server key and downloads them back.

Parameters:

  • host — target host,
  • username — user name (CN= section in certtificate),
  • organization — org name (O= section in certificate),
  • days — certificate expiration time.

make @connect-registry

Connects Docker Image Registry to local machine. Imaage Registry will be available at address localhost:5000.

kubernetes-bootstrap's People

Contributors

seletskiy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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