Skip to content
LucEast edited this page Feb 1, 2025 · 1 revision

RKEasy Wiki

Welcome to the official RKEasy Wiki! RKEasy is an Ansible-based tool designed to help you deploy, manage, and scale RKE2 Kubernetes clusters easily and efficiently.


🌍 Table of Contents

  1. πŸš€ Introduction
  2. πŸ“‚ Project Structure
  3. πŸ”§ Prerequisites
  4. πŸ“ Installation & Getting Started
  5. πŸ”„ Cluster Management
  6. πŸ”„ Updates & Scaling
  7. πŸ” Security Practices
  8. 🌐 Add-ons & Extensions
  9. 🌐 Semantic Release & Automation
  10. πŸŽ“ FAQ & Troubleshooting

πŸš€ Introduction

RKEasy is designed to simplify the process of deploying RKE2 Kubernetes clusters. It targets users looking for a reliable, automated, and extensible solution for managing Kubernetes clusters. With RKEasy, you can:

  • Automatically deploy Kubernetes clusters.
  • Update, scale, and remove clusters.
  • Integrate various add-ons like Longhorn, Rook/Ceph, or Ingress Controllers.

πŸ“‚ Project Structure

The directory structure of RKEasy is designed to be modular and easily extendable:

RKEasy/
β”œβ”€β”€ ansible.cfg
β”œβ”€β”€ galaxy.yml
β”œβ”€β”€ inventory/
β”‚   └── hosts.yml
β”œβ”€β”€ group_vars/
β”‚   β”œβ”€β”€ all.yml
β”‚   β”œβ”€β”€ control_planes.yml
β”‚   └── workers.yml
β”œβ”€β”€ roles/
β”‚   β”œβ”€β”€ rke2/
β”‚   β”‚   β”œβ”€β”€ tasks/
β”‚   β”‚   β”‚   β”œβ”€β”€ install.yml
β”‚   β”‚   β”‚   β”œβ”€β”€ update.yml
β”‚   β”‚   β”‚   β”œβ”€β”€ reset.yml
β”‚   β”‚   β”‚   └── scale.yml
β”‚   β”œβ”€β”€ networking/
β”‚   └── addons/
β”œβ”€β”€ playbooks/
β”‚   β”œβ”€β”€ install_cluster.yml
β”‚   β”œβ”€β”€ update_cluster.yml
β”‚   β”œβ”€β”€ scale_cluster.yml
β”‚   └── remove_cluster.yml
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── release.yml
β”œβ”€β”€ .releaserc.yml
β”œβ”€β”€ CHANGELOG.md
└── README.md

πŸ”§ Prerequisites

  1. Operating Systems:

    • Ubuntu 20.04+ / Debian 10+
    • CentOS 8+ / Rocky Linux / AlmaLinux
  2. Software Requirements:

    • Ansible β‰₯ 2.9
    • Python β‰₯ 3.6
    • OpenSSH
  3. Resource Requirements (Minimum):

    • 2 CPUs, 4GB RAM per node
    • 20GB free disk space
  4. Access Requirements:

    • SSH access with root privileges or β€˜sudo’ permissions

πŸ“ Installation & Getting Started

  1. Clone the Repository:

    git clone https://github.com/LucEast/RKEasy.git
    cd RKEasy
  2. Install Dependencies:

    ansible-galaxy collection install -r requirements.yml
  3. Configure Inventory: Edit the inventory/hosts.yml file:

    all:
      hosts:
        node1:
          ansible_host: 192.168.1.10
          ansible_user: root
          ansible_ssh_private_key_file: ~/.ssh/id_rsa
        node2:
          ansible_host: 192.168.1.11
          ansible_user: root
          ansible_ssh_private_key_file: ~/.ssh/id_rsa
      children:
        control_planes:
          hosts:
            node1:
        workers:
          hosts:
            node2:
  4. Install the Cluster:

    ansible-playbook playbooks/install_cluster.yml -i inventory/hosts.yml

πŸ”„ Cluster Management

  • Remove Cluster:

    ansible-playbook playbooks/remove_cluster.yml -i inventory/hosts.yml
  • Add New Nodes: Update the hosts.yml file and run:

    ansible-playbook playbooks/scale_cluster.yml -i inventory/hosts.yml

πŸ”„ Updates & Scaling

  1. Update the Cluster:

    ansible-playbook playbooks/update_cluster.yml -i inventory/hosts.yml
  2. Automated Rolling Updates: The playbooks support zero-downtime updates by updating nodes one at a time.


πŸ” Security Practices

  • RBAC is configured by default to control access.
  • TLS for all cluster communication.
  • Support for PodSecurityPolicies (PSP) or PodSecurityAdmission (PSA) from Kubernetes v1.25.

🌐 Add-ons & Extensions

RKEasy offers predefined roles to integrate popular add-ons:

  1. Longhorn (Distributed Storage):

    ansible-playbook playbooks/addons.yml -e "addon=longhorn"
  2. Rook/Ceph (Storage Solution):

    ansible-playbook playbooks/addons.yml -e "addon=rook"
  3. Ingress Controller (NGINX):

    ansible-playbook playbooks/addons.yml -e "addon=nginx"

🌐 Semantic Release & Automation

RKEasy uses Semantic Release for automated versioning and GitHub releases.

  1. Release Workflow (via GitHub Actions):

    .github/workflows/release.yml:

    name: Semantic Release
    
    on:
      push:
        branches:
          - main
    
    jobs:
      release:
        runs-on: ubuntu-latest
    
        steps:
          - name: Checkout Repository
            uses: actions/checkout@v4
    
          - name: Setup Node.js
            uses: actions/setup-node@v4
            with:
              node-version: '20'
    
          - name: Install Dependencies
            run: npm install
    
          - name: Run Semantic Release
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
            run: npx semantic-release
  2. Conventional Commit Examples:

    • feat: add dynamic node scaling
    • fix: correct token retrieval
    • chore: update dependencies

πŸŽ“ FAQ & Troubleshooting

  1. Error: No set of running pods found to reclaim resources

    • Solution: Check memory requirements and adjust pod resource limits.
  2. SSH Issues with Ansible

    • Solution: Ensure the correct SSH key is specified in inventory/hosts.yml.
  3. Cluster Stuck in Pending State

    • Solution: Verify network configuration and ensure CNI plugins are correctly installed.

Thank you for using RKEasy! πŸš€ If you have questions or encounter issues, feel free to create an issue on GitHub or contribute to the documentation.

Happy Clustering! πŸš€πŸŒ