Liveness/readiness probe in dualStack with IPv6 as preferred POD CIDR

Cluster information:

Kubernetes version: 1.23.12
Cloud being used: bare metal
Installation method: kubeadm
Host OS: Rocky 8.7
CNI and version: flannel
CRI and version: containerd

On a dual stack k8s with IPv6 as preferred POD CIDR, we see pods created having IPv6 address. A third party application which rely on httpGet for liveness and readiness probe. However, the application’s http service runs on 0.0.0.0. In this case, the probe fails to work as the default host address used by the kubelet will be IPv6 and the service is not bound to IPv6 address.

A quick hack is to change the livenessProbe to use exec and curl on localhost. In order for this to work, the container image need to have curl installed.

In the livenessProbe spec, it would be helpful if one can specify which ipFamily to use. If ipFamily is not specified, it would default to the ipFamily as per the POD CIDR provided during the k8s install.

livenessProbe:
  httpGet:
    path: /healthz
    port: liveness-port
    ipFamily: IPv6
  failureThreshold: 1
  periodSeconds: 10

Can you please open a github issue?

Hi, any update on this??

I am deploying Sonarqube on the IPV6 EKS cluster, but probes keep failing.