Code Monkey home page Code Monkey logo

multipass-rke-rancher's Introduction

Rancher Kubernetes Engine and Rancher Server on Multipass VMs on your local machine

Who should use this?

Those Ops or sometimes Devs who'd like to get familiar with a full-fledged Rancher Kubernetes Engine and Rancher Server on their local machine using Multipass VMs to reduce their cloud costs. This implementation is not an alternative to k3d, k3s, k3sup, etc..

Prerequisites

You need Multipass running on your local machine, to learn more about Multipass, please visit:

https://github.com/CanonicalLtd/multipass

https://multipass.run/

This setup was tested on MacOS, but should work on Linux or Windows too.

You need to have about 6GB RAM and 24GB storage on your local machine.

You need kubectl in your path, if not, you can download the v1.15.0 version and put it in your path:

MacOS users:

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/darwin/amd64/kubectl

Linux users:

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv kubectl /usr/local/bin/

Installation

Install multipass (on MacOS Catalina or Linux)

Update 17/12/2019

Multipass v0.10.0 has been updated for MacOS Catalina, please download this release:

https://github.com/CanonicalLtd/multipass/releases

wget https://github.com/CanonicalLtd/multipass/releases/download/v0.10.0/multipass-0.10.0+mac-Darwin.pkg
sudo installer -target / -verbose -pkg multipass-0.10.0+mac-Darwin.pkg
snap install multipass --beta --classic

Install on MacOS Mojave

Please checkout the mojave branch:

git clone https://github.com/arashkaffamanesh/multipass-rke-rancher.git -b mojave-multipass-0.8

Important hint for linux users

Linux users should adapt the create-hosts.sh and adapt the network interface name. You can find the nic name with:

multipass launch --name test
multipass exec test -- bash -c 'echo `ls /sys/class/net | grep en`'

Delete and purge the test VM:

multipass delete test
multipass purge

If the above doesn't work somehow, shell into the node and get the nic name:

multipass shell test
ifconfig

Clone this repo and run the scripts as follow:

git clone https://github.com/arashkaffamanesh/multipass-rke-rancher.git
cd multipass-rke-rancher
./1-deploy-multipass-vms.sh
./2-deploy-rke.sh
./3-deploy-rancher-on-rke.sh
# or with mkcert to get a vaild certificate (on macos), you need to install mkcert, pls. have a look in the script
./ 3-deploy-rancher-on-rke-mkcert-macos.sh

or with a single command:

./deploy.sh

What you get

You should get a running RKE Cluster on 3 Multipass VMs with Rancher Server on top in about 12 minutes (depends on your CPU / internet speed and docker hub performance).

You should get something like this at the End:

############################################################################
This should take about 4 minutes, wait for the browser to pop up and enjoy :-)
############################################################################
Waiting for deployment "rancher" rollout to finish: 0 of 3 updated replicas are available...
Waiting for deployment "rancher" rollout to finish: 1 of 3 updated replicas are available...
Waiting for deployment "rancher" rollout to finish: 2 of 3 updated replicas are available...
deployment "rancher" successfully rolled out
Total runtime in minutes: 11:58
############################################################################

Access the Rancher Server on RKE

A tab will open in your browser and point to:

https://rke1

Install Metal-LB

Install Metal-LB to have support for service type LoadBalancer:

./install-metal-lb.sh
# Test the metal lb install with the custom built nginx server with self signed certificate and port 443 enabled:
k create -f nginx-local-ssl.yaml

Clean Up

./cleanup-rkes.sh

Blog post

Blog post will be published on medium:

https://blog.kubernauts.io/

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.