-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to using the pod service account by default (#28)
Motivation ------------ Since K8S 1.24, service accounts don't automatically generate `Secret` resources that contain a token that never expires. While it is possible to make such a token manually, it is more difficult to find the token because the `ServiceAccount` no longer gets a reference to the `Secret`. Additionally, this approach is less secure because the token doesn't expire and is not rotated. Modifications --------------- By default, assume that the service account for the pod has the access rights to `Endpoints` required by Shawarma. This eliminates the need to handle tokens altogether. This also eliminates the need to grant RBAC rights to the webhook as well. The user may still opt-in to the old behavior using the `SHAWARMA_SERVICE_ACCT_NAME` environment variable or `shawarma-service-acct-name` command line switch. **BREAKING CHANGE**: The consumer must change the command line switch or environment variables used on the webhook to retain the default behavior *OR* update their service accounts to grant the `shawarma` role. This may be applied to the `default` service account in most cases, but any pods using a different service account will require the rights to be granted to that service account.
- Loading branch information
1 parent
81d377c
commit 9b82654
Showing
8 changed files
with
131 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters