-
Notifications
You must be signed in to change notification settings - Fork 539
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
403 Forbidden with system:anonymous using Kind cluster and @kubernetes/client-node 1.0 with Bun 1.1.29 #2157
Comments
Can you try it outside of |
Can you also send a redacted copy of your |
tried with deno, I get the same, works with AKS and EKS clusters and the kind cluster gets a 403. I had to run deno with |
redacted kubeconfig apiVersion: v1
clusters:
- cluster:
certificate-authority-data: <*****>
server: https://127.0.0.1:53896
name: kind-dedicated-configurator-test
contexts:
- context:
cluster: kind-dedicated-configurator-test
user: kind-dedicated-configurator-test
name: kind-dedicated-configurator-test
current-context: kind-dedicated-configurator-test
kind: Config
preferences: {}
users:
- name: kind-dedicated-configurator-test
user:
client-certificate-data: <*****>
client-key-data: <*****> |
That kubeconfig file should work just fine. Can you try running it just as Based on the error, I think that the client certificate and/or key are not being sent with the request and my guess is that they are being swallowed somehow inside of how bun is choosing to handle HTTPS certificates. Either that or it has something to do with how kind is creating the client certificates. The |
I think it has something to do with the migration to node-fetch, as the prior to v1.0 it works with the exact setup. I will try with some node project later |
yea it is the out of the box configuration, so no bearer token authentication |
Describe the bug
When using the client, load from default works to load, I get all the configurations and contexts. If I switch to a non-kind cluster it works. But when I try to access a kind cluster i get this error:
error: HTTP-Code: 403 Message: Unknown API Status Code! Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"nodes is forbidden: User \\\"system:anonymous\\\" cannot list resource \\\"nodes\\\" in API group \\\"\\\" at the cluster scope\",\"reason\":\"Forbidden\",\"details\":{\"kind\":\"nodes\"},\"code\":403}\n" Headers: {"audit-id":"8faa772b-0a02-4a11-a4d0-1ddda79052a9","cache-control":"no-cache, private","content-length":"256","content-type":"application/json","date":"Thu, 09 Jan 2025 22:13:50 GMT","x-content-type-options":"nosniff","x-kubernetes-pf-flowschema-uid":"447ed637-32cb-4e79-9fe9-7007b399d374","x-kubernetes-pf-prioritylevel-uid":"b292a39e-9771-4796-ad28-0c0f74ac00d7"} code: "403"
using
kubectl
it works, with the same selected context. And as described earlier, using any other cluster works fine. It does not matter what version of k8s is chosen. I have tried with 1.27, 1.32 and 1.29.12 version of kind, I get the same error.Client Version
e.g.
1.0.0
Server Version
e.g.
1.27, 1.32, 1.29.12
To Reproduce
index.ts
fileExpected behavior
To get a 200 response with data for the nodes in the cluster
Example Code
Environment (please complete the following information):
Additional context
I tried the same with the client version
0.22.3
using the same code, same cluster same everything except the npm package and that works as expectedThe text was updated successfully, but these errors were encountered: