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

Improve error message for projected tokens when API is not enabled #83192

Merged

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Sep 26, 2019

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Improves the error message returned from the kubelet if a token cannot be fetched because the API server doesn't have TokenRequest APIs enabled

Which issue(s) this PR fixes:
xref #83189

Does this PR introduce a user-facing change?:

NONE

/sig auth
/cc @mikedanese

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Sep 26, 2019
@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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. 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. labels Sep 26, 2019
@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

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. labels Sep 26, 2019
@mikedanese
Copy link
Member

I guess this could give an inccorrect error if TokenRequest was enabled on the apiserver after kubelet startup, and the service account the pod is running as doesn't exist.

@mikedanese
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 1, 2019
@k8s-ci-robot k8s-ci-robot merged commit 40d4ddc into kubernetes:master Oct 1, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Oct 1, 2019
@liggitt liggitt deleted the improve-token-request-error branch October 3, 2019 04:34
@tariq1890
Copy link
Contributor

@liggitt @mikedanese Is it possible that this error may be thrown when BoundServiceAccountTokenVolume disabled despite TokenRequest being enabled.

@liggitt
Copy link
Member Author

liggitt commented Apr 8, 2020

BoundServiceAccountTokenVolume enables/disables auto-injected projected token volumes for service account tokens. A pod can manually specify a projected token volume as well.

The kubelet doesn't care whether a projected token volume was auto-injected or manually specified in the pod. When it encounters that type of volume, it makes a token request to the API server to get a token to mount into the pod. If the token request APIs are unavailable, the kubelet will display this error.

@tariq1890
Copy link
Contributor

Thanks for the clarification @liggitt :)

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. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/node Categorizes an issue or PR as relevant to SIG Node. 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.

None yet

4 participants