https://github.com/bee-san/ansible_scripts
This is for my personal K3s cluster
https://github.com/bee-san/ansible_scripts
Last synced: 18 days ago
JSON representation
This is for my personal K3s cluster
- Host: GitHub
- URL: https://github.com/bee-san/ansible_scripts
- Owner: bee-san
- License: apache-2.0
- Created: 2022-11-23T14:46:08.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T18:45:52.000Z (about 3 years ago)
- Last Synced: 2025-01-19T23:47:52.652Z (12 months ago)
- Language: Dockerfile
- Size: 5.38 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Build a Kubernetes cluster using k3s via Ansible
Author:
## K3s Ansible Playbook
Build a Kubernetes cluster using Ansible with k3s. The goal is easily install a Kubernetes cluster on machines running:
- [X] Debian
- [X] Ubuntu
- [X] CentOS
on processor architecture:
- [X] x64
- [X] arm64
- [X] armhf
## 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:
```bash
cp -R inventory/sample inventory/my-cluster
```
Second, edit `inventory/my-cluster/hosts.ini` to match the system information gathered above. For example:
```bash
[master]
192.16.35.12
[node]
192.16.35.[10:11]
[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:
```bash
ansible-playbook site.yml -i inventory/my-cluster/hosts.ini
```
## Kubeconfig
To get access to your **Kubernetes** cluster just
```bash
scp debian@master_ip:~/.kube/config ~/.kube/config
```