How to re-create kubeconfig for system:admin user in OpenShift 4

Solution Verified - Updated -

Issue

  • kubeconfig file is missing and it is needed to recreate it and set client certificate authentication for system:admin.
  • It is possible to recreate the installation kubeconfig file in RHOCP 4?
  • Impossible to access the cluster with the original kubeconfig file for certificate error:

    $ oc get nodes --kubeconfig=<install directory>/auth/kubeconfig
    Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kube-apiserver-lb-signer")
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4.6+

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