gpt4 book ai didi

openshift - 无法使用 CLI 登录到 openshift

转载 作者:行者123 更新时间:2023-12-01 21:56:41 24 4
gpt4 key购买 nike

我正在尝试登录 starter openshift 服务器。然后得到错误:

C:\Users\Admin>oc login https://console-openshift-console.apps.us-west-1.online-starter.openshift.com
error: invalid character '<' looking for beginning of value

CLI 版本:

C:\Users\Admin>oc version
Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.1", GitCommit:"4b47d3394", GitTreeState:"clean", BuildDate:"2019-06-05T20:42:01Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"windows/amd64"}

在线 Openshift 4 中的“关于”:Kubernetes 主版本v1.13.4+81fc896

错误的完整堆栈跟踪:

C:\Users\Admin>oc login https://console-openshift-console.apps.us-west-1.online-starter.openshift.com --loglevel=9
I0610 15:30:13.242674 6768 round_trippers.go:419] curl -k -v -XHEAD 'https://console-openshift-console.apps.us-west-1.online-starter.openshift.com:443/'
I0610 15:30:14.731741 6768 round_trippers.go:438] HEAD https://console-openshift-console.apps.us-west-1.online-starter.openshift.com:443/ 200 OK in 1459 milliseconds
I0610 15:30:14.741867 6768 round_trippers.go:444] Response Headers:
I0610 15:30:14.742863 6768 round_trippers.go:447] Date: Mon, 10 Jun 2019 12:30:14 GMT
I0610 15:30:14.742863 6768 round_trippers.go:447] Content-Type: text/html; charset=utf-8
I0610 15:30:14.743861 6768 round_trippers.go:447] Cache-Control: private
I0610 15:30:14.743861 6768 round_trippers.go:447] X-Content-Type-Options: nosniff
I0610 15:30:14.744858 6768 round_trippers.go:447] Set-Cookie: csrf-token=Y5HTi5JEtyltd27b7VgaS3tC0jpkYk2WWHqibPSa4tRsh0TJgt0k6fzfZdQTZMawO0rLB6nLNINqNmYTAtqUPQ==; Path=/; Secure
I0610 15:30:14.744858 6768 round_trippers.go:447] Set-Cookie: 1e2670d92730b515ce3a1bb65da45062=c13f251446e70d52cfdceee5ed73bcbb; path=/; HttpOnly; Secure
I0610 15:30:14.744858 6768 round_trippers.go:447] X-Dns-Prefetch-Control: off
I0610 15:30:14.745855 6768 round_trippers.go:447] X-Frame-Options: DENY
I0610 15:30:14.745855 6768 round_trippers.go:447] X-Xss-Protection: 1; mode=block
I0610 15:30:14.745855 6768 round_trippers.go:447] Referrer-Policy: strict-origin-when-cross-origin
I0610 15:30:14.746857 6768 request_token.go:92] SSPI Enabled
I0610 15:30:14.746857 6768 round_trippers.go:419] curl -k -v -XGET -H "X-Csrf-Token: 1" 'https://console-openshift-console.apps.us-west-1.online-starter.openshift.com:443/.well-known/oauth-authorization-server'
I0610 15:30:15.085208 6768 round_trippers.go:438] GET https://console-openshift-console.apps.us-west-1.online-starter.openshift.com:443/.well-known/oauth-authorization-server 200 OK in 338 milliseconds
I0610 15:30:15.085208 6768 round_trippers.go:444] Response Headers:
I0610 15:30:15.086206 6768 round_trippers.go:447] X-Dns-Prefetch-Control: off
I0610 15:30:15.086206 6768 round_trippers.go:447] Date: Mon, 10 Jun 2019 12:30:14 GMT
I0610 15:30:15.087203 6768 round_trippers.go:447] Cache-Control: private
I0610 15:30:15.087203 6768 round_trippers.go:447] Content-Type: text/html; charset=utf-8
I0610 15:30:15.088200 6768 round_trippers.go:447] Referrer-Policy: strict-origin-when-cross-origin
I0610 15:30:15.088200 6768 round_trippers.go:447] Set-Cookie: csrf-token=nowDCVVg+iMNf9Ldc6MldQJwsIgg8Tltk5djsue2h3uZy7woy7F1b0SfTQkv1Lw2kO3cs+82mOFOgE0Io5VUGQ==; Path=/; Secure
I0610 15:30:15.088200 6768 round_trippers.go:447] Set-Cookie: 1e2670d92730b515ce3a1bb65da45062=a7f4fcdbc17050ff7e35cf025b9ceaf2; path=/; HttpOnly; Secure
I0610 15:30:15.089199 6768 round_trippers.go:447] X-Content-Type-Options: nosniff
I0610 15:30:15.089199 6768 round_trippers.go:447] X-Frame-Options: DENY
I0610 15:30:15.090228 6768 round_trippers.go:447] X-Xss-Protection: 1; mode=block
I0610 15:30:15.090228 6768 negotiator_sspi.go:135] Attempt to release SSPI
F0610 15:30:15.090228 6768 helpers.go:116] error: invalid character '<' looking for beginning of value

我做错了什么?

最佳答案

您应该使用 api URL 登录,而不是控制台 URL,例如 https://console-openshift-console.apps.us-west-1.online-starter.openshift.com . api URL 正在使用 6443默认端口。

# oc login https://<api url>:6443

更新:

据我所知,api URLkubeconfig 中配置默认授权文件。而且您通常可以在不指定 api URL 的情况下登录如下。

# export KUBECONFIG=/home/user_id/install/auth/kubeconfig
# oc login

通常,api URL格式为api.<cluster name>.<domain> .

引用OpenShift 4: Install Experience了解更多详情。

关于openshift - 无法使用 CLI 登录到 openshift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56526569/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com