我正在尝试使用配置文件访问kubernetes仪表板.从我选择配置文件时的身份验证中给出' Not enough data to create auth info structure.' 为kubectl命令添加相同的配置文件.
这是我的配置文件.
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: REDACTED
server: https://kubemaster:6443
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: kubernetes-admin
name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
Run Code Online (Sandbox Code Playgroud)
有任何帮助来解决这个问题吗?
谢谢SR
我有以下服务:
ubuntu@master:~$ kubectl get services --all-namespaces
NAMESPACE NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes 100.64.0.1 <none> 443/TCP 48m
kube-system kube-dns 100.64.0.10 <none> 53/UDP,53/TCP 47m
kube-system kubernetes-dashboard 100.70.83.136 <nodes> 80/TCP 47m
Run Code Online (Sandbox Code Playgroud)
我正在尝试访问kubernetes仪表板.以下响应似乎是合理的,考虑到curl不是浏览器.
ubuntu@master:~$ curl 100.70.83.136
<!doctype html> <html ng-app="kubernetesDashboard"> <head> <meta charset="utf-8"> <title>Kubernetes Dashboard</title> <link rel="icon" type="image/png" href="assets/images/kubernetes-logo.png"> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="static/vendor.36bb79bb.css"> <link rel="stylesheet" href="static/app.d2318302.css"> </head> <body> <!--[if lt IE 10]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser.
Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your
experience.</p>
<![endif]--> <kd-chrome …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用网络外的 Token 方法访问 kubernetes Dashboard。
我运行了这两个命令来获取令牌
kubectl -n kube-system get secret
kubectl -n kube-system describe secret replicaset-controller-token-2p4fk
Run Code Online (Sandbox Code Playgroud)
将粘贴输出令牌复制到 K8 登录页面。
当我单击“登录”按钮(页面未加载)时,我收到此错误浏览器控制台。
我正在使用以下命令在内部服务器上运行 k8:
kubectl proxy --address 0.0.0.0 --accept-hosts '.*'
Run Code Online (Sandbox Code Playgroud)
并尝试从外部网络访问 k8 UI 控制台。
Failed to load resource: the server responded with a status of 401 (Unauthorized)
vendor.bd425c26.js:6 Error during global settings reload: Object
:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/api/v1/rbac/status:1 Failed to load resource: the server responded with a status of 401 (Unauthorized)
vendor.bd425c26.js:6 Possibly unhandled rejection: {"data":"MSG_LOGIN_UNAUTHORIZED_ERROR\n","status":401,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"api/v1/rbac/status","headers":{"Accept":"application/json, text/plain, */*"}},"statusText":"Unauthorized","xhrStatus":"complete","resource":{}}
Run Code Online (Sandbox Code Playgroud)
我什至尝试了这些步骤,但不幸的是,单击“登录”按钮时页面未加载。
$ kubectl -n …Run Code Online (Sandbox Code Playgroud)