Невозможно войти в openshift через CLI - PullRequest
1 голос
/ 10 июня 2019

Я пытаюсь войти на стартовый сервер 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 Master Version v1.13.4 + 81fc896

full stacktraceошибки:

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

Что я делаю не так?

1 Ответ

1 голос
/ 10 июня 2019

Вы должны войти в систему, используя api URL, а не консольный URL, например https://console-openshift-console.apps.us-west-1.online-starter.openshift.com. URL API использует порт 6443 по умолчанию.

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

UPDATE:

AFAIK, api URL по умолчанию настроен в kubeconfig файл аутентификации. И вы обычно можете войти без указания api URL следующим образом.

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

Обычно формат API-адреса api.<cluster name>.<domain>.

См. OpenShift 4: Опыт установки для получения более подробной информации.

...