Git Product home page Git Product logo

k3s-ha-tutorial's Introduction

K3S-HA Create Commands Generator Tutorial

This is a simple solution that gets you started quickly and easily with K3S High Availability clusters

This project provides you with a choice of two shell scripts that generates a text file with all the commands you need to run on the First 3 Master servers as well as on your worker node servers

Edit one of two shell scripts provided you want to use with the parameters your your servers and use it to generate all the commands you need to run on your servers in a single text file

Setup Required

  • You need 4/5 Linux Servers with Ubuntu 22.04 server installed
  • I used two PC's with Mint Linux Workstation and installed Virtual Box on each and added one Ubuntu 22.04 server VM
  • You need to setup Static IP addresses for each server
  • You need DNS entries for your servers if you don't have facilities to do that DynuDNS will give you 4 DNS entries for free
  • You need to setup a free account with DynuDNS : https://www.dynu.com/en-US/ControlPanel/Login
  • With DynuDNS you create 4 free Dynamic DNS entries for your servers: https://www.dynu.com/en-US/ControlPanel/DDNS
  • Enter the Host name you want "elephant" (I used animals) and Choose a suitable Toplevel name "kozow.com"

Two create scripts provided

CreateDeploymentCommands4Ubuntu.sh (this script has been tested with both Ubuntu and Mint Linux) get it here:

https://github.com/nic0michael/K3S-HA-tutorial/blob/master/CreateHA-ClusterDeploymentCommands4Ubuntu.sh

How to use the shell scripts

You need to choose which of the above scripts you want to use.

1) Edit this shell script with your server and user details.

nano CreateDeploymentCommands4Ubuntu.sh

Now paste the content of this file:

https://github.com/nic0michael/K3S-HA-tutorial/blob/master/CreateHA-ClusterDeploymentCommands4Ubuntu.sh

Then got to the top of the file and update your server IP addresses you user Id and DNS names for those servers

Then press Ctrl X and then press the Y key and press the enter key

2) Make the shell script executable

chmod 775 CreateDeploymentCommands4Ubuntu.sh

3) When you run the script pass the output to a text file

./CreateDeploymentCommands4Ubuntu.sh > ubuntuServerDeploymentList.txt

4) You now can use the file to create all your Node Servers

ubuntuServerDeploymentList.txt

Now run this command to display this file

cat ubuntuServerDeploymentList.txt

5) After creating the First Master Server Node get the MASTER_TOKEN

run on the server to get token

cat /var/lib/rancher/k3s/server/node-token

6) Now Edit the script and update the Master Token in it

nano CreateDeploymentCommands4Ubuntu.sh

7) Now run the script again

./CreateDeploymentCommands4Ubuntu.sh > ubuntuServerDeploymentList.txt

8) You now can use the file to create all your Node Servers

ubuntuServerDeploymentList.txt

Now run this command to display this file

cat ubuntuServerDeploymentList.txt

New Python Script

We now have a Python Script that works with a YAML file allowing you to configure what is generated

This can produce 3 kinds of Clusters in your K3S server:

  1. K3S-HA Cluster with multiple Master Nodes and Multiple worker Nodes
  2. K3S Cluster with one Master Nodes and Multiple worker Nodes
  3. K3S Minimal Cluster with only a master Node and no Worker Nodes

If you want to clone this please clone it from this project: https://github.com/nic0michael/K3S_Cluster_Maker

k3s-ha-tutorial's People

Contributors

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