Giter VIP home page Giter VIP logo

kubeha's Introduction

kubeha

Simple opinionated high availability Kubernetes cluster deployed in libvirt.

APIServer connections can be made highly available for kube-controller-manager and scheduler as well and can be toggled with the kcm_scheduler_with_ha_apiserver_connection variable in vars.yaml (WARNING: setting to true can cause problems with upgrades).

Creating the Cluster

  1. Install ansible requirements: ansible-galaxy collection install -r requirements.yml
  2. Copy the hosts.example file into the hosts file.
  3. Create kubeha network with ansible-playbook base/network-init.yml
  4. Prepare the base VM
    1. Install fedora rawhide and name it fedora-rawhide-base. Select kubeha network as the source of the VM's NIC.
    2. Input the base VM name and IP address into hosts file
    3. Start the base VM and create ssh keys: ansible-playbook base/base-vm-start.yml
    4. Copy the public key into the VM: ssh-copy-id -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -i auth/id_rsa root@${BASE_VM_IP}
    5. Prepare the base VM and turn it off: ansible-playbook base/base-vm-prepare.yml
  5. Clone fedora-rawhide-base into as many masters and workers as desired via virt-manager.
  6. Start all the VMs to obtain generated IP addresses.
  7. Insert the VM names and IP addresses into the hosts file.
  8. Inspect vars.yaml for any customization.
  9. Install the DNS servers: ansible-playbook install-dns.yml
  10. Install the cluster: ansible-playbook install-cluster.yml
  11. Either add dns group IPs from the ./hosts file as your DNS server, or add the following entry to your hosts file: echo '192.168.150.2 api-kube.kubeha.knet' >> /etc/hosts
  12. Use ./lifecycle and ./cluster scripts for management of the cluster.

Upgrading the Cluster

Run ansible-playbook cluster/upgrade-to-latest.yml to upgrade the cluster, the system and its packages to the latest version.

Upgrading or Downgrading the Cluster to a Specific Version

This option will only upgrade or downgrade the kubernetes packages, not the whole system. There is no guarantee that this will work.

  1. Set a k8s_version variable in vars.yaml to the desired Kubernetes version.
  2. Run ansible-playbook cluster/upgrade-downgrade-to-version.yml to upgrade or downgrade the cluster.
  3. The force_upgrade_downgrade variable can be set to true in vars.yaml if you encounter errors (e.g. when downgrading).

Upgrade versions and validations can be checked by sshing into a master node and running kubeadm upgrade plan.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.