nebius.com/managed-by: mk8s label. However, if the service is deleted, this allocation is also removed by default.
To retain the allocated public IP address and reuse it in future, convert the system-managed allocation into a persistent one and manually link it to your service by using an annotation.
Prerequisites
-
Make sure you are in a group that has at least the
editorrole within your tenant; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console. -
Install jq to extract IDs and tokens from the JSON data returned by the Nebius AI Cloud CLI:
- Create a Managed Service for Kubernetes cluster if you have not done it before.
- Install kubectl and connect to the cluster.
How to convert a dynamic IP address
-
Get the public IP address of your load balancer:
Copy the IP address from the
EXTERNAL-IPcolumn. -
Get the ID of the allocation associated with the IP address:
Specify the IP address that you copied in the previous step. Alternatively, list all allocations by using the nebius vpc allocation list command. In the output, look for a block that contains the matching IP address under
status.details.allocated_cidrand alabelsfield containingnebius.com/managed-by: mk8s. Copy the allocation ID. It has thevpcallocation-***format. -
To detach the allocation from automatic deletion, remove system-managed labels of this allocation:
-
Open the editor to edit the allocation:
Specify the ID that you copied in the previous step. For details on using the
editcommand, see How to edit resources via the Nebius AI Cloud CLI. -
In the editor, delete all labels from the
labelslist: - Save the changes and close the editor.
-
Open the editor to edit the allocation:
-
Update your Kubernetes load balancer manifest (for example, service.yaml) with the following annotation:
-
Apply the updated manifest: