techno-tim / k3s-ansible

The easiest way to bootstrap a self-hosted High Availability Kubernetes cluster. A fully automated HA k3s etcd install with kube-vip, MetalLB, and more. Build. Destroy. Repeat.
https://technotim.live/posts/k3s-etcd-ansible/
Apache License 2.0
2.41k stars 1.05k forks source link

Master apiserver_enpoint IP not assigned #34

Closed grimkroton closed 2 years ago

grimkroton commented 2 years ago

Expected Behavior

The IP adress provided as apiserver_endpoint should get assigned to the master node as vIP. Nodes can register to this IP as Kubernetes API.

Current Behavior

The installation fails at the step TASK [k3s/master : Verify that all nodes actually joined (check k3s-init.service if this fails)] *** I do not see the IP provided as apiserver_endpoint anywhere getting assigned to. Do I need multi-master setup to get a vIP assigned?

Steps to Reproduce

  1. Setup 3 Ubuntu 20.04 VMs
  2. Assign 1 VM as Master and 2 VMs as Nodes
  3. Assign a IP in the same subnet as the 3 VMs as apiserver_endpoint
  4. Run the playbook as documented

Context (variables)

Operating system: Ubuntu 20.04

Hardware: VMs on AMD Ryzen 7 4900G on a Proxmox hypervisor

Variables Used:

all.yml

k3s_version: "v1.23.4+k3s1"
ansible_user: NA
systemd_dir: "/etc/systemd/system"

flannel_iface: "eth0"

apiserver_endpoint: "10.0.0.5"

k3s_token: "NA"

extra_server_args: "--no-deploy servicelb --no-deploy traefik"
extra_agent_args: ""

kube_vip_tag_version: ""v0.4.4""

metal_lb_speaker_tag_version: "v0.12.1"
metal_lb_controller_tag_version: "v0.12.1"

metal_lb_ip_range: "10.0.0.150-10.0.0.200"

Hosts

host.ini

[master]
master01.dc.lab.domain.tld

[node]
node01.dc.lab.domain.tld
node02.dc.lab.domain.tld

[k3s_cluster:children]
master
node

Possible Solution

Since the vIP for the master node does not getting assigned, the nodes cannot register to a master. So the Kubernetes cluster stays a single master cluster.

grimkroton commented 2 years ago

Sorry, my VMs were cloned from a template with just 2GB disk space. I just figured out. After attaching enough storage, everything is running fine -.-