karpor icon indicating copy to clipboard operation
karpor copied to clipboard

Token Based Cluster Context Not Working

Open kmadel opened this issue 10 months ago • 4 comments

What happened?

Uploading the following Kube Config results in this error:

E0315 13:56:23.962506       1 authentication.go:63] "Unable to authenticate the request" err="verifying certificate SN=4792605077399134197, SKID=, AKID=9B:3D:E7:D3:5D:64:7F:70:81:AF:C8:F0:6D:BA:CA:CB:AF:24:B0:D2 failed: x509: certificate signed by unknown authority (possibly because of \"crypto/rsa: verification error\" while trying to verify candidate authority certificate \"kubernetes\")"

Config yaml:

apiVersion: v1
kind: Config
clusters:
- cluster:
    server: https://xxxxxxxxxxxx/kubernetes/project/demos/virtualcluster/xxxx
    insecure-skip-tls-verify: true
  name: loft
contexts:
- context:
    cluster: loft
    user: loft
    
  name: loft
current-context: loft
users:
- name: loft
  user:
    token: K*************************************************7

What did you expect to happen?

Based on this merged PR, I would expect it to work with just a user.token: https://github.com/KusionStack/karpor/pull/527

How can we reproduce it (as minimally and precisely as possible)?

Install vCluster Platform: https://www.vcluster.com/docs/platform/install/quick-start-guide Then create a vCluster with the Platform, export the KubeConfig and add it to Karpor.

Anything else we need to know?

No response

Karpor version

kusionstack/karpor:v0.6.3

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

kmadel avatar Mar 15 '25 14:03 kmadel

Also, Kube Configs that work fine with Flux don't work with Karpor.

kmadel avatar Mar 15 '25 14:03 kmadel

I got it to accept the following, but it complains about:

address hostname: missing port in address

kmadel avatar Mar 15 '25 14:03 kmadel

Hi, thank for your attention. Let me understand your question. Did you already solve that question of "Unable to authenticate the request", but now have another question "address hostname"?

fanfan-yu avatar Mar 16 '25 06:03 fanfan-yu

@kmadel Hi, thank you for your feedback! It seems like you mentioned several issues:

  1. The kubeconfig exported from vCluster cannot be imported into karpor, and the error message is "Unable to authenticate the request."
  2. KubeConfig compatible with Flux cannot be imported into karpor (is it related to 1?)
  3. Error: address hostname: missing port in address (What is the relationship between this and 1 and 2?)

elliotxx avatar Mar 17 '25 11:03 elliotxx