Obtain the configuration required to connect to the import cluster so that the platform can be authorized to access and manage it. This section provides the steps to retrieve the import cluster information.
A working kubectl environment. For public cloud clusters, it is strongly recommended to use the provider's CloudShell. If CloudShell is not available, Linux or macOS is recommended.
You have obtained the import cluster's KubeConfig file and copied it to the environment where kubectl is installed. To avoid operating on the wrong environment, it is strongly recommended to use one of the following non-destructive approaches:
cp "${HOME}/.kube/config" "${HOME}/.kube/config.backup"KUBECONFIG environment variable to point to the imported kubeconfig: export KUBECONFIG="/path/to/imported/kubeconfig"export KUBECONFIG="/path/to/imported/kubeconfig:${HOME}/.kube/config"kubectl config view --flatten > "${HOME}/.kube/merged.kubeconfig"export KUBECONFIG="${HOME}/.kube/merged.kubeconfig"Run the following commands:
This procedure creates a cluster-admin credential intended to be non-expiring.
Secret objects in cpaas-system.An example of the token obtained in the previous step is shown below.
Validate the token expiration.
Use any tool that supports parsing JWT tokens to analyze the token and confirm its expiration time. If you can find an expiration field in the parsed result (a key containing "exp", as shown below), the platform will be unable to manage the import cluster after that time. In this case, stop and contact technical support.
The expiration is recorded as "exp": 1684486916, in the original JWT payload. The value is a UNIX timestamp and can be converted to UTC time.
Cleanup (revoke access) when done:
If you have already obtained the API server address and CA certificate using the platform's Parse KubeConfig File feature on the import cluster page, skip this step.
Run the following commands: