Skip to content

kube-vip requires super-admin.conf with Kubernetes 1.29 #684

Open
@louhisuo

Description

@louhisuo

Describe the bug
Setting up a new Kubernetes 1.29.0 cluster with kubeadm fails when kube-vip is used. Lima-VM with Ubuntu 22.04 LTS image was used as a machine.

To Reproduce
Steps to reproduce the behavior:

  1. Start a machine (virtual machine) with all Kubernetes prerequisites satisfied for Kubernetes 1.29.0

  2. Within a control plane machine generate kube-vip static pod

export KVVERSION=v0.6.4
export INTERFACE=lima0
export VIP=<VIP address>
sudo ctr image pull ghcr.io/kube-vip/kube-vip:$KVVERSION
sudo ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$KVVERSION vip /kube-vip manifest pod \
    --arp \
    --controlplane \
    --address $VIP \
    --interface $INTERFACE \
    --enableLoadBalancer \
    --leaderElection | sudo tee /etc/kubernetes/manifests/kube-vip.yaml

  1. Initiate Kubernetes 1.29.0 control plane with 'kubeadm init', observe timeout and failure to initiate a cluster
  2. Check logs for kube-vip container with crictl and observe an error
# crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock logs 72f0058318b86
time="2023-12-14T09:30:38Z" level=info msg="Starting kube-vip.io [v0.6.4]"
time="2023-12-14T09:30:38Z" level=info msg="namespace [kube-system], Mode: [ARP], Features(s): Control Plane:[true], Services:[false]"
time="2023-12-14T09:30:38Z" level=info msg="prometheus HTTP server started"
time="2023-12-14T09:30:38Z" level=info msg="Starting Kube-vip Manager with the ARP engine"
time="2023-12-14T09:30:38Z" level=info msg="Beginning cluster membership, namespace [kube-system], lock name [plndr-cp-lock], id [lima-cp-1]"
I1214 09:30:38.362358       1 leaderelection.go:250] attempting to acquire leader lease kube-system/plndr-cp-lock...
E1214 09:30:38.907904       1 leaderelection.go:332] error retrieving resource lock kube-system/plndr-cp-lock: leases.coordination.k8s.io "plndr-cp-lock" is forbidden: User "kubernetes-admin" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "kube-system"
E1214 09:30:40.258727       1 leaderelection.go:332] error retrieving resource lock kube-system/plndr-cp-lock: leases.coordination.k8s.io "plndr-cp-lock" is forbidden: User "kubernetes-admin" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "kube-system"

Expected behavior
kube-vip is able to retrieve resource lock. This can be achieved by manually editing kube-vip.conf with following configuration before running kubeadm init.

  volumes:
  - hostPath:
      path: /etc/kubernetes/super-admin.conf
    name: kubeconfig

For details why see Kubernetes 1.29 CHANGELOG

Screenshots
n/a

Environment (please complete the following information):

  • OS/Distro: Ubuntu 22.04 LTS
  • Kubernetes Version: 1.29.0
  • Kube-vip Version: 0.6.4

Kube-vip.yaml:
Will be provided if really needed.

Additional context
kubeadm init generates another kubeconfig file super-admin.conf in Kubernetes 1.29 and onwards which is required by kube-vip static pod to able start static pod during cluster initiation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    trackerFor tracking related problems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions