Skip to content

Instantly share code, notes, and snippets.

@tekh
Last active July 28, 2024 23:02
Show Gist options
  • Save tekh/b8a9f9d3a107e7bd7d98bb1a433ddf2f to your computer and use it in GitHub Desktop.
Save tekh/b8a9f9d3a107e7bd7d98bb1a433ddf2f to your computer and use it in GitHub Desktop.

Revisions

  1. tekh revised this gist Jul 28, 2024. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions rke2_agent_install
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,9 @@

    ## Tested on Ubuntu Server 22.04LTS, minimal install. Seems to have no issues, a little less ram used (30meg) and saving about 2gb of HD space

    ### If running on QEMU:
    apt install qemu-guest-agent -y && systemctl enable --now qemu-guest-agent

    ### On the server
    # Retrieve the server token located in /var/lib/rancher/rke2/server/node-token

  2. tekh renamed this gist Jul 28, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. tekh renamed this gist Jul 28, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. tekh created this gist Jul 28, 2024.
    27 changes: 27 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #How to add rke2 agents;

    ## Tested on Ubuntu Server 22.04LTS, minimal install. Seems to have no issues, a little less ram used (30meg) and saving about 2gb of HD space

    ### On the server
    # Retrieve the server token located in /var/lib/rancher/rke2/server/node-token

    ### On the nodes (run as root!);
    systemctl stop --now ufw
    apt update && apt install byobu nano fail2ban nfs-common -y && apt dist-upgrade -y && systemctl enable --now fail2ban && apt autoremove -y && byobu-enable && byobu

    # Run the installer
    curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE="agent" sh -

    # Configure the rke2-agent service
    mkdir -p /etc/rancher/rke2/
    nano /etc/rancher/rke2/config.yaml

    # Content for config.yaml:
    server: https://<server>:9345
    token: <token from server node>

    # Enable && Start the service
    systemctl enable --now rke2-agent.service

    # Follow the logs, if you like
    journalctl -u rke2-agent -f