Git Product home page Git Product logo

multipass-rke's Introduction

RKE cluster on multipass instances

This script will create a configurable amount of instances using multipass, create or use specified SSH keys, install a configurable version of Docker on it, create the RKE configuration file (cluster.yml) and run RKE (rke up) to create the Kubernetes cluster.

Requirements

Running it

Clone this repo, and run the script:

bash multipass-rke.sh

This will (defaults):

  • Generate random name for your cluster (configurable using NAME)
  • Generate SSH key for RKE to access the nodes (configurable using SSH_PRIVKEYFILE, SSH_PUBKEYFILE and SSH_PASSPHRASE)
  • Create cloud-init to add SSH public key to the machines and install Docker (19.03 by default, configurable using DOCKER_VERSION)
  • Create one machine (configurable using COUNT_MACHINE) with 2 CPU (CPU_MACHINE), 10G disk (DISK_MACHINE) and 4000M of memory (MEMORY_MACHINE) using Ubuntu focal (IMAGE)
  • Create cluster.yml file for RKE
  • Run rke up to create the cluster

Quickstart Ubuntu 20.04 droplet

sudo snap install multipass
wget -O /usr/local/bin/rke https://github.com/$(wget https://github.com/rancher/rke/releases/latest -O - | egrep '/.*/.*/rke_linux-amd64' -o)
chmod +x /usr/local/bin/rke
wget https://raw.githubusercontent.com/superseb/multipass-rke/master/multipass-rke.sh
bash multipass-rke.sh
curl -Lo /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x /usr/local/bin/kubectl
kubectl --kubeconfig kube_config_* get nodes

Clean up

The files that are created are:

  • $NAME-cloud-init.yaml
  • $NAME-cluster.yml
  • $NAME-id_rsa (if SSH_PRIVKEYFILE is empty)
  • $NAME-id_rsa.pub (if SSH_PRIVKEYFILE is empty)

You can clean up the instances by running multipass delete rke-$NAME-{1,2,3} --purge or (WARNING this deletes and purges all instances): multipass delete --all --purge

multipass-rke's People

Contributors

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