Translated message

A translation of this page exists in English.

在 OpenShift 4 中,当添加了 API 证书后,如何为 system:admin 用户修改 kubeconfig?

Solution In Progress - Updated -

Issue

  • kubeconfig 文件没有缺失,但需要在添加了 API 服务器证书后修改它。
  • 根据文档中的步骤添加了 API 服务器证书后,无法使用原始的 kubeconfig 文件访问集群,出现以下错误:
$ oc login -u system:admin --kubeconfig=<install directory>/auth/kubeconfig
error: username system:admin is invalid for basic auth
  • 我希望继续使用原始的 kubeconfig 文件,因为它有 10 年的有效期,而重新创建的 kubeconfig 文件只有 14 个月的有效期。

Environment

  • Red Hat OpenShift Container Platform (RHOCP)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content