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

fix: set default token expiration to 1h #247

Merged
merged 1 commit into from
Oct 25, 2021
Merged

fix: set default token expiration to 1h #247

merged 1 commit into from
Oct 25, 2021

Conversation

aramase
Copy link
Member

@aramase aramase commented Oct 22, 2021

The kubernetes default for projected service account token is 1h. Using
the same expiry value to be conformant. The minimum is 1h and max is
24h.

Signed-off-by: Anish Ramasekar anish.ramasekar@gmail.com

Reason for Change:

Requirements

  • squashed commits
  • included documentation
  • added unit tests and e2e tests (if applicable).

Issue Fixed:

fixes #245

Please answer the following questions with yes/no:

Does this change contain code from or inspired by another project? If so, did you notify the maintainers and provide attribution?

  • yes
  • no

Notes for Reviewers:

@aramase aramase requested a review from chewong as a code owner October 22, 2021 20:36
The kubernetes default for projected service account token is 1h. Using
the same expiry value to be conformant. The minimum is 1h and max is
24h.

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
@aramase aramase requested a review from chewong October 22, 2021 23:58
@@ -112,7 +112,8 @@ test_helm_chart() {
--create-namespace \
--wait
poll_webhook_readiness
make test-e2e-run
# TODO(aramase) remove the service account token expiration after v0.7.0 release
E2E_EXTRA_ARGS=-e2e.service-account-token-expiration=24h make test-e2e-run
Copy link
Contributor

@chewong chewong Oct 23, 2021

Choose a reason for hiding this comment

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

The reason why we added this is that we want to test the upgrade path where the default token expiration is changed from 24h to 1h right?

Copy link
Member Author

@aramase aramase Oct 23, 2021

Choose a reason for hiding this comment

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

On the contrary, we're adding that because the default expiry is 24h in case of webhook v0.6.0 and is 1h with this change. We're using that flag to determine what value to check based on the webhook version we're deploying.

We don't have in-place upgrade tests in our test suite, i.e we don't have a pod that's retained while we upgrade webhook version n to n+1.

so with webhook v0.6.0 we'll use 24h in test when we check the projected service account token volume and for upgrade to the code in main branch we'll check if it's equal to 1h.

@aramase aramase requested a review from chewong October 25, 2021 16:19
@aramase aramase merged commit 584ae7f into Azure:main Oct 25, 2021
@aramase aramase deleted the default-timeout branch October 25, 2021 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change the K8s token lifetime to 1 hour
2 participants