第 3 章 Cluster access with kubeconfig
Learn about how kubeconfig files are used with MicroShift deployments. CLI tools use kubeconfig files to communicate with the API server of a cluster. These files provide cluster details, IP addresses, and other information needed for authentication.
3.1. Kubeconfig files for configuring cluster access 复制链接链接已复制到粘贴板!
The two categories of kubeconfig files used in MicroShift are local access and remote access. Every time MicroShift starts, a set of kubeconfig files for local and remote access to the API server are generated. These files are generated in the /var/lib/microshift/resources/kubeadmin/ directory using preexisting configuration information.
Each access type requires a different authentication certificate signed by different Certificate Authorities (CAs). The generation of multiple kubeconfig files accommodates this need.
You can use the appropriate kubeconfig file for the access type needed in each case to provide authentication details. The contents of MicroShift kubeconfig files are determined by either default built-in values or a config.yaml file.
A kubeconfig file must exist for the cluster to be accessible. The values are applied from built-in default values or a config.yaml, if one was created.
Example contents of the kubeconfig files
/var/lib/microshift/resources/kubeadmin/
├── kubeconfig
├── alt-name-1
│ └── kubeconfig
├── 1.2.3.4
│ └── kubeconfig
└── microshift-rhel9
└── kubeconfig