Connecting to a Cluster
Use the kubectl
package to connect to a Kubernetes cluster created
with the libvirt
provider.
After creating a Kubernetes cluster, two Kubernetes configuration
(kubeconfig
) files are created to connect to the cluster using
the kubectl
command.
One file provides direct access to the true Kubernetes API server
endpoint. This kubeconfig
file is saved as
.
You can use this file to access a cluster created on the localhost, or to access a
cluster created on a remote libvirt host.
$HOME/.kube/kubeconfig.cluster_name.local
The second kubeconfig
file provides access to a
dedicated tunnel implemented with SLiRP to access the cluster on remote systems.
This file is saved as
.
If the cluster is started on a remote system, and you want to log into that remote
system to access the cluster, you need to copy this second
$HOME/.kube/kubeconfig.cluster_name.vm
kubeconfig
to the remote system.
Install kubectl
on the host on which you want to access the cluster,
either the localhost, or the remote libvirt system.
These steps, unless explicitly mentioned, are to be performed on the host on which you want to access the cluster (either the localhost or a remote libvirt system).