Skip to content
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

Document apiserver.latency.k8s.io/total audit annotation #47448

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

Conversation

Ritikaa96
Copy link
Contributor

Documented apiserver.latency.k8s.io/total annotation in page https://kubernetes.io/docs/reference/labels-annotations-taints/audit-annotations/
also added values details in authorization.k8s.io/decision annotation.
Partially Fixes: #29479

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 12, 2024
@k8s-ci-robot k8s-ci-robot requested a review from reylejano August 12, 2024 04:06
@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Aug 12, 2024
@k8s-ci-robot k8s-ci-robot requested a review from sftim August 12, 2024 04:06
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign natalisucks for approval. For more information see the Kubernetes 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

@Ritikaa96
Copy link
Contributor Author

/sig cli
/kind feature

@k8s-ci-robot k8s-ci-robot added sig/cli Categorizes an issue or PR as relevant to SIG CLI. kind/feature Categorizes issue or PR as related to a new feature. labels Aug 12, 2024
@Ritikaa96
Copy link
Contributor Author

Information taken from kep and code file, specifically audit.go

Copy link

netlify bot commented Aug 12, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 4a53adf
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/66c711941826550008f1f5db
😎 Deploy Preview https://deploy-preview-47448--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Ritikaa96
Copy link
Contributor Author

i added in flow to my other work
/remove-sig cli
/sig auth

@k8s-ci-robot k8s-ci-robot added sig/auth Categorizes an issue or PR as relevant to SIG Auth. and removed sig/cli Categorizes an issue or PR as relevant to SIG CLI. labels Aug 12, 2024
@sftim
Copy link
Contributor

sftim commented Aug 12, 2024

/retitle Document apiserver.latency.k8s.io/total audit annotation

@k8s-ci-robot k8s-ci-robot changed the title registering apiserver.latency.k8s.io/total annotation Document apiserver.latency.k8s.io/total audit annotation Aug 12, 2024
@aramase
Copy link
Member

aramase commented Aug 12, 2024

/triage accepted

/assign nilekhc
(assigned to review the authz changes as part of SIG Auth triage meeting)

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Aug 12, 2024
@aramase
Copy link
Member

aramase commented Aug 12, 2024

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Aug 12, 2024
@sftim
Copy link
Contributor

sftim commented Aug 20, 2024

Hello Prow. Is this now OK to merge?

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

Thanks; please see feedback.

Comment on lines 79 to 81
This value shows total latency incurred in components within the apiserver. Please note that the latency is recorded in
annotation only when the total latency of the given request exceeds 500ms; This is in keeping with the
traces in rest/handlers for create, delete, update, get, list, and delete collection.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This value shows total latency incurred in components within the apiserver. Please note that the latency is recorded in
annotation only when the total latency of the given request exceeds 500ms; This is in keeping with the
traces in rest/handlers for create, delete, update, get, list, and delete collection.
This annotation records total latency incurred in components within the API server.
The API server only adds this audit annotation for requests where the total latency for handling
and responding to that request exceeds a threshold; in Kubernetes {{< skew currentVersion >}}
that threshold is 500ms (half a second).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks clean , thanks for the suggestion.

## authorization.k8s.io/decision

Example: `authorization.k8s.io/decision: "forbid"`

This annotation indicates whether or not a request was authorized in Kubernetes audit logs.
Value must be **forbid** or **allow**. This annotation indicates whether or not a request was authorized in Kubernetes audit logs.
Copy link
Contributor

Choose a reason for hiding this comment

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

This change does not align with the PR title and description. I think it belongs in a separate commit and possibly a different PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should i add a different PR? In case it is needed i'll add another PR for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Two PRs is easiest.

Signed-off-by: Ritikaa96 <[email protected]>
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 22, 2024
@Ritikaa96
Copy link
Contributor Author

I have added different pr for improvement on already documented annotation. Is there any other change needed here?

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 27, 2024
@Ritikaa96
Copy link
Contributor Author

/remove-lifecycle stale
I am waiting for the reviews and approval so this is still active.

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. language/en Issues or PRs related to English language sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: Changes Requested
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Document well-known audit annotations
6 participants