×

kubeadmin 用户

OpenShift Container Platform 在安装过程完成后会创建一个集群管理员 kubeadmin

此用户会自动应用 cluster-admin 角色,并被视为集群的 root 用户。密码是动态生成的,对于您的 OpenShift Container Platform 环境是唯一的。安装完成后,密码将在安装程序的输出中提供。例如

INFO Install complete!
INFO Run 'export KUBECONFIG=<your working directory>/auth/kubeconfig' to manage the cluster with 'oc', the OpenShift CLI.
INFO The cluster is ready when 'oc login -u kubeadmin -p <provided>' succeeds (wait a few minutes).
INFO Access the OpenShift web-console here: https://console-openshift-console.apps.demo1.openshift4-beta-abcorp.com
INFO Login to the console with user: kubeadmin, password: <provided>

移除 kubeadmin 用户

定义身份提供者并创建新的 cluster-admin 用户后,您可以移除 kubeadmin 以提高集群安全性。

如果您在其他用户成为集群管理员 (cluster-admin)之前执行此过程,则必须重新安装 OpenShift Container Platform。此命令无法撤销。

先决条件
  • 您必须至少配置了一个身份提供商。

  • 您必须已将集群管理员 (cluster-admin)角色添加到一个用户。

  • 您必须以管理员身份登录。

步骤
  • 删除kubeadmin密钥

    $ oc delete secrets kubeadmin -n kube-system