kubernetes: readiness probe is not scheduled as configured periodSeconds

What happened?

Below pod yaml file was deployed. From probe logs we see probe is getting scheduled more than once in 30 sec duration of perodSeconds configured for readinessProbe. At times it gets scheduled twice within 5 seconds though 30 sec is configured as periodSeconds apiVersion: v1 kind: Pod metadata: labels: test: readiness name: ready1 spec: containers:

  • name: readiness image: busybox command: [“top”] readinessProbe: exec: command: - /tmp/probe.sh initialDelaySeconds: 3 failureThreshold: 1 successThreshold: 1 periodSeconds: 30 /tmp/probe.sh was added as executable after doing exec to pod to simulate the issue.

/ # cat /tmp/probe.sh #!/bin/sh echo “Probe at date” >> /tmp/probe.log exit 1 / # tail -f /tmp/probe.log Probe at Fri Jun 16 07:16:16 UTC 2023 Probe at Fri Jun 16 07:16:35 UTC 2023 Probe at Fri Jun 16 07:17:05 UTC 2023 Probe at Fri Jun 16 07:17:19 UTC 2023 Probe at Fri Jun 16 07:17:35 UTC 2023

What did you expect to happen?

Expect readinessProbe to be scheduled acurately as periodSeconds.

How can we reproduce it (as minimally and precisely as possible)?

Above yaml file can be created in k8s 1.27 with probe content to log output of date command.

Anything else we need to know?

When probe was successful scheduling was accurate.

Kubernetes version

$ kubectl version

WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.1", GitCommit:"c978334577baba04da0671abbcd788e510503453", GitTreeState:"clean", BuildDate:"2023-06-18T06:28:15Z", GoVersion:"go1.20.3", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.1", GitCommit:"c978334577baba04da0671abbcd788e510503453", GitTreeState:"clean", BuildDate:"2023-06-18T06:17:43Z", GoVersion:"go1.20.3", Compiler:"gc", Platform:"linux/amd64"}

Cloud provider

sudo dmidecode | grep -i -e manufacturer -e product -e vendor Vendor: SeaBIOS Manufacturer: OpenStack Foundation Product Name: OpenStack Nova Manufacturer: QEMU Manufacturer: QEMU Manufacturer: QEMU Manufacturer: QEMU

OS version

# On Linux:
$ cat /etc/os-release
 cat /etc/os-release
NAME="SLES"
VERSION="15-SP4"
VERSION_ID="15.4"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP4"
ID="sles"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:15:sp4"
DOCUMENTATION_URL="https://documentation.suse.com/"

$ uname -a
Linux master-2-test10 5.14.21-150400.24.63-default #1 SMP PREEMPT_DYNAMIC Tue May 2 15:49:04 UTC 2023 (fd0cc4f) x86_64 x86_64 x86_64 GNU/Linux

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

/usr/local/bin/containerd --version containerd github.com/containerd/containerd v1.7.0 1fbd70374134b891f97ce19c70b6e50c7b9f4e0d

Related plugins (CNI, CSI, …) and versions (if applicable)

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 20 (12 by maintainers)

Most upvoted comments

Thank you @mochizuki875 for your explanation.