Skip to content

Conversation

@liggitt
Copy link
Member

@liggitt liggitt commented Dec 30, 2018

What type of PR is this?
/kind bug

What this PR does / why we need it:
Fixes the token file cache period to be short enough to observe refreshed service account tokens before the original expires.

The original 5 minute window (actually 4 minutes because of the 1 minute leeway) could prevent reading a token refreshed 1 second after the last read and expiring 2 minutes later.

Does this PR introduce a user-facing change?:

client-go: shortens refresh period for token files to 1 minute to ensure auto-rotated projected service account tokens are read frequently enough.

/cc @mikedanese
/sig auth

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. sig/auth Categorizes an issue or PR as relevant to SIG Auth. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Dec 30, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt

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

The pull request process is described here

Details 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 30, 2018
@liggitt
Copy link
Member Author

liggitt commented Dec 30, 2018

/retest

// refreshes a projected service account token and when the original token expires.
// Default token lifetime is 10 minutes, and the kubelet starts refreshing at 80% of lifetime.
// This should induce re-reading at a frequency that works with the token volume source.
period: time.Minute,

Choose a reason for hiding this comment

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

  • Does this period control the client-go reload of the token after it has been refreshed by the kubelet ?
  • Is it configurable ?
  • If yes to 1, isnt this dependent on the expirationSeconds in the projected volume ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does control the refresh period. It is not configurable. expirationSeconds must be at least 10 minutes

@mikedanese
Copy link
Member

/lgtm
/shrug

@k8s-ci-robot k8s-ci-robot added ¯\_(ツ)_/¯ ¯\\\_(ツ)_/¯ lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jan 7, 2019
@k8s-ci-robot k8s-ci-robot merged commit de4e1ce into kubernetes:master Jan 7, 2019
@liggitt liggitt deleted the shorten-token-re-read branch January 8, 2019 04:16
@liggitt liggitt added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jan 8, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jan 8, 2019
k8s-ci-robot added a commit that referenced this pull request Jan 9, 2019
…7-upstream-release-1.13

Automated cherry pick of #72437: Shorten re-read period for token files to work with
k8s-ci-robot added a commit that referenced this pull request Jan 9, 2019
…7-upstream-release-1.12

Automated cherry pick of #72437: Shorten re-read period for token files to work with
@liggitt liggitt added this to the v1.14 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. ¯\_(ツ)_/¯ ¯\\\_(ツ)_/¯

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants