Connection method overview
You can connect to a Managed Service for Kubernetes cluster using the following methods:
- Over the internet if you configured public access for the cluster when creating it.
- From Nebius AI virtual machines located in the same cloud network.
To connect to a cluster, you can use:
To connect to cluster nodes, follow the instructions in Connecting to a node over SSH.
Connecting to a cluster
-
If you don't have the Nebius AI command line interface yet, install and initialize it.
-
The folder specified in the CLI profile is used by default. You can specify a different folder using the
--folder-name
or--folder-id
parameter. -
Add credentials to the
kubectl
configuration file:-
To connect to the cluster's private IP address from a VM located on the same network:
ncp managed-kubernetes cluster \ get-credentials <cluster name or ID> \ --internal
-
To connect to the cluster's public IP address via the internet:
ncp managed-kubernetes cluster \ get-credentials <cluster name or ID> \ --external
Note
By default, credentials are added to the
$HOME/.kube/config
file. If you need to change the configuration location, use the--kubeconfig <file path>
parameter. -
-
Make sure the cluster is accessible:
kubectl cluster-info
If
kubectl
is configured correctly, the command returns cluster information.
Connecting using a static configuration
If you can't use the Nebius AI CLI for some reason, connect to a cluster using static configuration files.