Skip to content

[WIP]: PodStartSLIDuration excludes init container runtime #131950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alimaazamat
Copy link

@alimaazamat alimaazamat commented May 23, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

PodStartSLIDuration should not include init container run time according to https://github.com/kubernetes/community/blob/master/sig-scalability/slos/pod_startup_latency.md

Which issue(s) this PR fixes:

Fixes #131733

Special notes for your reviewer:

Does this PR introduce a user-facing change?

TBD

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 23, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

Welcome @alimaazamat!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 23, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @alimaazamat. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label May 23, 2025
@k8s-ci-robot k8s-ci-robot requested review from feiskyer and kannon92 May 23, 2025 23:28
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. labels May 23, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label May 23, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: alimaazamat
Once this PR has been reviewed and has the lgtm label, please assign random-liu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@alimaazamat alimaazamat changed the title [WIP]: initContainerDuration SLI created and subtracted from podStartSLOdura… [WIP]: PodStartSLIDuration excludes init container runtime May 23, 2025
@alimaazamat alimaazamat force-pushed the subtract-init-container-runtime-from-slo branch from 9e26af4 to b606046 Compare May 23, 2025 23:46
@alimaazamat alimaazamat force-pushed the subtract-init-container-runtime-from-slo branch from b606046 to 84042ad Compare May 23, 2025 23:47
}
}

// Find when all main containers are running

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether as an approach it might be feasible/simpler/more precise to wait for all InitContainerStatuses to have non-nil Terminated, then subtract min(Terminated.StartedAt.Time) from max(Terminated.FinishedAt.Time) ?

@@ -99,7 +102,8 @@ func (p *basicPodStartupLatencyTracker) ObservedPodOnWatch(pod *v1.Pod, when tim
if hasPodStartedSLO(pod) {
podStartingDuration := when.Sub(pod.CreationTimestamp.Time)
imagePullingDuration := state.lastFinishedPulling.Sub(state.firstStartedPulling)
podStartSLOduration := (podStartingDuration - imagePullingDuration).Seconds()
initContainerDuration := state.containersRunningTime.Sub(state.initContainerStartTime)
podStartSLOduration := (podStartingDuration - imagePullingDuration - initContainerDuration).Seconds()
Copy link

@jim-minter jim-minter May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for init container execution to overlap image pulling?
e.g. the init container images are tiny, but the main container images are huge. The init containers pull quickly and start running while the main containers are still pulling?
I've no idea if this is possible, but I think this calculation relies on it being impossible, otherwise you'll double count?

@alimaazamat
Copy link
Author

/sig node

@alimaazamat
Copy link
Author

alimaazamat commented May 28, 2025

Waiting for feedback from Sig Node before proceeding...
We expect additional changes to be added (excluding init container runtime, excluding some stateful pods, and excluding schedulable pods)
SLO definition doesn't match the formula being used, but perhaps the definition needs to be updated.

@k8s-ci-robot k8s-ci-robot removed the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 30, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 30, 2025
@k8s-ci-robot
Copy link
Contributor

@alimaazamat: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-conformance-kind-ga-only-parallel 473a1af link true /test pull-kubernetes-conformance-kind-ga-only-parallel
pull-kubernetes-node-e2e-containerd 473a1af link true /test pull-kubernetes-node-e2e-containerd
pull-kubernetes-e2e-kind 473a1af link true /test pull-kubernetes-e2e-kind
pull-kubernetes-e2e-kind-ipv6 473a1af link true /test pull-kubernetes-e2e-kind-ipv6
pull-kubernetes-e2e-gce 473a1af link true /test pull-kubernetes-e2e-gce
pull-kubernetes-typecheck 473a1af link true /test pull-kubernetes-typecheck
pull-kubernetes-unit 473a1af link true /test pull-kubernetes-unit
pull-kubernetes-linter-hints 473a1af link false /test pull-kubernetes-linter-hints
pull-kubernetes-unit-windows-master 473a1af link false /test pull-kubernetes-unit-windows-master
pull-kubernetes-verify 473a1af link true /test pull-kubernetes-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@bart0sh bart0sh moved this from Triage to Work in progress in SIG Node: code and documentation PRs Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

kubelet_pod_start_sli_duration_seconds appears not to match its specification, at least as far as excluding init container runtime
3 participants