zhong (钟鹏群) 14ab80c6f4 k3s dashboard 1 tháng trước cách đây
..
README.md 1af45ae038 fix 1 tháng trước cách đây
ansible.cfg e89c096cd8 fix 1 tháng trước cách đây
dashboard-main.yml 14ab80c6f4 k3s dashboard 1 tháng trước cách đây
deploy-dashboard.yml 14ab80c6f4 k3s dashboard 1 tháng trước cách đây
install-k3s-master.yml 3b9b4962a3 x 1 tháng trước cách đây
install-k3s-workers.yml dbfd13dd1b x 1 tháng trước cách đây
inventory.ini e89c096cd8 fix 1 tháng trước cách đây
k3s-agent.service.j2 e89c096cd8 fix 1 tháng trước cách đây
k3s.service.j2 37cf9a4279 fix 1 tháng trước cách đây
main-playbook.yml e89c096cd8 fix 1 tháng trước cách đây
verify-cluster.yml e89c096cd8 fix 1 tháng trước cách đây

README.md

Ansible Playbooks for k3s Cluster Installation

This directory contains Ansible playbooks to install a k3s cluster with one master node and multiple worker nodes.

Files Overview

  • inventory.ini: Contains the inventory of master and worker nodes
  • main-playbook.yml: Main playbook that orchestrates the entire installation
  • install-k3s-master.yml: Installs k3s on the master node
  • install-k3s-workers.yml: Installs k3s agents on worker nodes and joins them to the master
  • verify-cluster.yml: Verifies the cluster status after installation
  • k3s.service.j2: Template for the k3s master systemd service
  • k3s-agent.service.j2: Template for the k3s agent systemd service
  • ansible.cfg: Ansible configuration file.

Prerequisites

  • Ansible installed on the control machine
  • SSH access to all target machines with sudo privileges
  • Target machines running a supported Linux distribution

Variables

The playbooks use the following variables:

  • master_ip: IP address of the master node
  • k3s_download_url: URL to download the k3s binary
  • k3s_token: Token for joining worker nodes to the cluster

Usage

To run the complete installation:

ansible-playbook -i inventory.ini main-playbook.yml

To run only the master installation:

ansible-playbook -i inventory.ini install-k3s-master.yml

To run only the worker installation:

ansible-playbook -i inventory.ini install-k3s-workers.yml

To verify the cluster status:

ansible-playbook -i inventory.ini verify-cluster.yml

Configuration

Edit the inventory.ini file to match your environment:

  • Update IP addresses of master and worker nodes
  • Update SSH credentials as needed