k8snetworkplumbingwg / whereabouts

A CNI IPAM plugin that assigns IP addresses cluster-wide
Apache License 2.0
282 stars 124 forks source link

Post OIDC Key rotation, Whereabouts start failing #401

Open pukubee opened 9 months ago

pukubee commented 9 months ago

Describe the bug We use OIDC enabled K8s cluster, we rotate OIDC issuer key after few months. Post rotation of the key whereabouts cannot allocate IP for newly created pods.

whereabouts.log

2024-01-02T09:06:16Z [debug] Used defaults from parsed flat file config @ /etc/cni/net.d/whereabouts.d/whereabouts.conf 2024-01-02T09:06:16Z [debug] ADD - IPAM configuration successfully read: {Name:test-sriov Type:whereabouts xxx Routes:[] GatewayStr: LeaderLeaseDuration:1500 LeaderRenewDeadline:1000 LeaderRetryPeriod:500 LogFile:/var/log/whereabouts.log LogLevel:info ReconcilerCronExpression:30 4 OverlappingRanges:true SleepForRace:0 Gateway: Kubernetes:{KubeConfigPath:/etc/cni/net.d/whereabouts.d/whereabouts.kubeconfig K8sAPIRoot:} ConfigurationPath: PodName:test-pod PodNamespace:default NetworkName:} 2024-01-02T09:06:16Z [debug] Beginning IPAM for ContainerID: 21c1209c11d5075e50ae42216e5cc633c6f9d75524eac31f883b28f81f710f21 2024-01-02T09:06:16Z [debug] Started leader election 2024-01-02T09:08:16Z [debug] OnStoppedLeading() called 2024-01-02T09:08:16Z [debug] Finished leader election 2024-01-02T09:08:16Z [debug] IPManagement: [], time limit exceeded while waiting to become leader* 2024-01-02T09:08:16Z [error] Error at storage engine: time limit exceeded while waiting to become leader

Restarting whereabouts pods help mitigate this problem.

Expected behavior A clear and concise description of what you expected to happen. Looking for sample config to allow whereabouts use in-pod service account token instead of kubeconfig. Service account token refreshes hourly. (we faced similar issue with Multus, and switched to multus-thick deployment, it helped!)

To Reproduce Steps to reproduce the behavior:

  1. Rotate oidc issuer key twice.
  2. Create pods that use whereabouts for IP allocation

Environment: Linux

Additional info / context Add any other information / context about the problem here.