Skip to content

Kubernetes

Prerequisites

  • Ansible installed on your local machine. See Infrastructure as Code page.
  • SSH access to the target machines where you want to install k3s.

Add SSH keys on local device

  1. Copy private and public key (stored in Bitwarden Vault)

    cp /path/to/my/key/ansible ~/.ssh/ansible
    cp /path/to/my/key/ansible.pub ~/.ssh/ansible.pub
    
  2. Change permissions on the files

    sudo chmod 600 ~/.ssh/ansible
    sudo chmod 600 ~/.ssh/ansible.pub
    
  3. Make ssh agent to actually use copied key

    ssh-add ~/.ssh/ansible
    

Setting up VM hosts on Proxmox

  1. Create a VM with the following partitions
    • / (10 GB) xfs
    • /var (50GB) xfs
    • /boot (1GB)

Note

No swap partition is needed for kubernetes

  1. Login to the VM and set hostname.
    hostnamectl set-hostname <hostname>
    
  2. Reboot.
  3. Set static ip for the VM in the DHCP server.

  4. Reboot.

  5. Set this hostname in the ansible inventory hosts.yaml file.