Skip to content

The Ansible Playbook I use to deploy and config my k3s cluster on my local network

License

Notifications You must be signed in to change notification settings

Chris-Greaves/k3s-cluster-playbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K3s Cluster Playbook

This is the playbook I created to setup my k3s cluster.

Resources

This playbook is built using some community projects as well as some created by myself.

System requirements

Deployment environment must have Ansible 2.4.0+ Master and nodes must have passwordless SSH access

Usage

First create a new directory based on the sample directory within the inventory directory:

cp -R inventory/sample inventory/my-cluster

Second, edit inventory/my-cluster/hosts.ini to match the system information gathered above. For example:

[master]
192.168.1.26

[node]
192.168.1.34
192.168.1.39
192.168.1.16
192.168.1.32

# Group of 1 machine that will run the kubectl commands for helm deployments, etc.
[k3s_exec]
192.168.1.26

[k3s_cluster:children]
master
node

If needed, you can also edit inventory/my-cluster/group_vars/all.yml to match your environment.

Start provisioning of the cluster using the following command:

ansible-playbook site.yml -i inventory/my-cluster/hosts.ini

Kubeconfig

To get access to your Kubernetes cluster just

scp username@master_ip:~/.kube/config ~/.kube/config

About

The Ansible Playbook I use to deploy and config my k3s cluster on my local network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages