You can create a kubeconfig file on demand if required. Use the following steps:
- Establish a CLI session on the Bare Metal Orchestrator VM and log in. For high availability configurations, establish a CLI session using the virtual IP (VIP) of the Load Balancers for the Bare Metal Orchestrator cluster.
- Create token. Run the following command:
bmo create token --username admin --password <PASSWORD> --update-kubeconfig=<kube-config-path>
where username and password are the user credentials
Note: The create token command creates three tokens:
- Access token - required for user create, read, update, and delete operations.
- ID token - required for all Bare Metal Orchestrator operations.
- Refresh token - required to refresh the access token and the ID token.
- Export the ID token. Run the following command:
export idtoken=<id-token>
- Export the refresh token. Run the following command:
export reftoken=<refresh-token>
- Run the following command to create the kubeconfig file:
bmo create kubeconfig --token $idtoken --refresh-token $reftoken -f <file-name> --host <VIP>
where:
- file-name - optional: It is the file where the kubeconfig content is stored
-
--host
<VIP> - optional: For high availability configurations, it is the virtual IP (VIP) address. For single node configurations, it is the IP address of the server or VM that is hosting the Global Controller node. If the IP address is provided, it is used to connect to the API service and is set in the kubeconfig file to access the cluster. If it is not provided, the default node IP address (single node) or the IP address of either CP1, CP2, or CP3 in HA cluster is used. An existing kubeconfig file must be available if VIP is not provided