GithubHelp home page GithubHelp logo

doytsujin / k3s-homeops-ansible Goto Github PK

View Code? Open in Web Editor NEW

This project forked from onedr0p/k3s-homeops-ansible

0.0 1.0 0.0 643 KB

Bootstrap a k3s cluster on top of Ubuntu 20.04

Shell 0.73% HTML 99.27%

k3s-homeops-ansible's Introduction

k3s-homeops-ansible

This is an opinionated way to provision Ubuntu 20.04 and install k3s on top.

Prerequisites

There's a couple things that will need to be done before you get starting running with Ansible.

  1. Install Ansible >= 2.10.0 on your local machine
  2. Install a supported OS on each of your nodes
  3. Set static IP for each node on the OS or in your router (you can use the IP assigned via DHCP, but it's not recommended)
  4. Copy your local public ssh key with ssh-copy-id to each node
  5. Optional review playbooks and roles to understand what these Ansible script will do

After that we're ready to continue with Ansible...

Ansible

Get started by cloning this repository and copying the hosts and config into a new directory.

# clone this repo
git clone https://github.com/onedr0p/k3s-homeops-ansible
# change into the directory
cd k3s-homeops-ansible
# copy the hosts and config to a new folder
cp -r ./inventory/local ./inventory/custom

Update the Ansible config files

Note: This project uses PyratLabs/ansible-role-k3s for installing k3s. Configuration options can be viewed in their README.

After you have copied over the configuration files you will need to update the configuration in the files:

  • ./inventory/custom/hosts.yml: Host definitions
  • ./inventory/custom/host_vars/*.yml: Host IP and host level variables
  • ./inventory/custom/group_vars/*.yml: Global variables for all hosts

Each file it carefully documented.

Get Ansible dependencies

ansible-galaxy install -r requirements.yml

Run the playbooks

# This playbook will prepare your nodes for Kubernetes
ansible-playbook -i ./inventory/custom/hosts.yml ./playbooks/os-build.yml
# This playbook will install k3s
ansible-playbook -i ./inventory/custom/hosts.yml ./playbooks/cluster-build.yml

Verify the cluster is up and running

kubectl --kubeconfig ./kubeconfig get nodes -o wide

k3s-homeops-ansible's People

Contributors

carpenike avatar onedr0p avatar

Watchers

 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.