Skip to content

Conversation

@soltysh
Copy link
Contributor

@soltysh soltysh commented Oct 22, 2024

Description

Add batch.kubernetes.io/cronjob-scheduled-timestamp annotation information to cronjob page

Issue

kubernetes/enhancements#4026

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 22, 2024
@k8s-ci-robot k8s-ci-robot added this to the 1.32 milestone Oct 22, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language labels Oct 22, 2024
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 22, 2024
@netlify
Copy link

netlify bot commented Oct 22, 2024

👷 Deploy Preview for kubernetes-io-vnext-staging processing.

Name Link
🔨 Latest commit a4e093c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/6728bfcfe416a700084da07d

@netlify
Copy link

netlify bot commented Oct 22, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit a4e093c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/6728bfcfd8a4110008414f37
😎 Deploy Preview https://deploy-preview-48498--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.

@dipesh-rawat
Copy link
Member

/sig apps

@k8s-ci-robot k8s-ci-robot added the sig/apps Categorizes an issue or PR as relevant to SIG Apps. label Oct 22, 2024
The CronJob is only responsible for creating Jobs that match its schedule, and
the Job in turn is responsible for the management of the Pods it represents.

Starting with Kubernetes v1.32 the job created by CronJob controller will have an annotation `batch.kubernetes.io/cronjob-scheduled-timestamp` which will show the original (expected) creation timestamp for a Job. The value of this field is in RFC3339 format.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not technically true. Wouldn't this annotation have shown up in 1.28 and now we are forbidding users from turning it off in 1.32?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically - yes, it should show up starting in 1.32, but since it was beta, it could potentially be disabled. Going with 1.32, where the feature is always on is safer assumption, b/c it will always appear. I thought for a while to go with 1.28, but based on what I wrote, I've decided to go with the stable.

@sftim
Copy link
Contributor

sftim commented Oct 25, 2024

@soltysh if you're ready for more reviews, feel free to mark this as not-draft

@soltysh soltysh marked this pull request as ready for review November 4, 2024 11:48
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 4, 2024
@soltysh
Copy link
Contributor Author

soltysh commented Nov 4, 2024

@soltysh if you're ready for more reviews, feel free to mark this as not-draft

@sftim yup, it's ready for final review

/assign @atiratree

The CronJob is only responsible for creating Jobs that match its schedule, and
the Job in turn is responsible for the management of the Pods it represents.

Starting with Kubernetes v1.32 the job created by CronJob controller will have an annotation `batch.kubernetes.io/cronjob-scheduled-timestamp` which will show the original (expected) creation timestamp for a Job. The value of this field is in RFC3339 format.
Copy link
Member

Choose a reason for hiding this comment

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

I think it is a bit confusing to place this after:

The CronJob is only responsible for creating Jobs that match its schedule, and
the Job in turn is responsible for the management of the Pods it represents.

Can we either:

  • highlight here why this annotation is useful? For example: can be useful if the job has not been created according to the schedule
  • or just place above the last sentence or somewhere else in the Job creation section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, moved it up, after the first paragraph.

…ation to cronjob page

Signed-off-by: Maciej Szulik <soltysh@gmail.com>
@atiratree
Copy link
Member

LGTM from sig-apps POV

@chanieljdan
Copy link
Contributor

Tech LGTM noted, @tengqm could we get your docs review for this one?

Kubernetes tries to avoid those situations, but does not completely prevent them. Therefore,
the Jobs that you define should be _idempotent_.

Starting with Kubernetes v1.32 the job created by CronJob controller will have an annotation
Copy link
Contributor

@katcosgrove katcosgrove Nov 26, 2024

Choose a reason for hiding this comment

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

v1.32 will be out when this documentation merges, so this should be in present tense.
Consider this non-blocking if necessary.

Suggested change
Starting with Kubernetes v1.32 the job created by CronJob controller will have an annotation
Starting with Kubernetes v1.32, the job created by CronJob controller has an annotation

Copy link
Member

Choose a reason for hiding this comment

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

Suggest: job --> Job

Kubernetes tries to avoid those situations, but does not completely prevent them. Therefore,
the Jobs that you define should be _idempotent_.

Starting with Kubernetes v1.32 the job created by CronJob controller will have an annotation
Copy link
Member

Choose a reason for hiding this comment

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

Suggest: job --> Job

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: janetkuo
Once this PR has been reviewed and has the lgtm label, please assign tengqm 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

@janetkuo
Copy link
Member

This is superseded by #48860

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 26, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@soltysh soltysh closed this Nov 27, 2024
@soltysh soltysh deleted the job_annotation branch November 27, 2024 12:33
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. language/en Issues or PRs related to English language needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. sig/apps Categorizes an issue or PR as relevant to SIG Apps. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

9 participants