The module lifecycle stage: General Availability
Below is an example of the Yandex Cloud cloud provider configuration.
An example of the module configuration
apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
name: cloud-provider-yandex
spec:
version: 1
enabled: true
settings:
additionalExternalNetworkIDs:
- enp6t4snovl2ko4p15em
Managing zones
The zones parameter defines the cluster-wide list of zones. Use this section when installing a cluster and when changing the zone list in a running cluster. Before changing a running cluster, complete the checks before changing the zone list.
In automatic mode, if zones is not set, Deckhouse Platform uses ru-central1-a, ru-central1-b, ru-central1-d, and ru-central1-e. You can list one to four supported zones in a non-empty list. To use ru-central1-f, list it explicitly. For existingZoneToSubnetIDMap, see Using existing subnets.
Selecting zones for the cluster
When it creates subnets automatically, Deckhouse Platform divides nodeNetworkCIDR into four equal parts. The ru-central1-a zone uses the first part, ru-central1-b uses the second, ru-central1-e uses the third, and ru-central1-d uses the fourth.
Select the tab that matches your zone list.
- Default zones only
- The ru-central1-f zone
When subnets are created automatically, if zones is not set or contains only default zones, Deckhouse Platform creates or retains subnets in all four default zones. This also applies when the list contains only one zone. The zone list in a node group configuration determines which of these subnets receive nodes.
To use the default zones, do not set the zones parameter. An empty list [] is allowed by the schema but differs from an unset parameter when the zone list for node groups is formed.
You can list ru-central1-f without any default zones. For example, set the following list in the YandexClusterConfiguration resource:
zones:
- ru-central1-f
If existingZoneToSubnetIDMap is not set or empty, Deckhouse Platform creates a subnet only in ru-central1-f. It uses the part of the range released by one of the default zones. With only ru-central1-f in the list, it uses the part assigned to ru-central1-a. As long as ru-central1-f remains in the list, Deckhouse Platform preserves the CIDR of the existing subnet. If you remove the zone from the list, the subnet is removed with it.
When you replace a default zone with ru-central1-f, the new subnet receives the part of the range assigned to the excluded zone. For example, replacing ru-central1-e with ru-central1-f uses the third part of the range. Deckhouse Platform deletes the ru-central1-e subnet after nodes and other resources have been removed from it.
If masterNodeGroup.zones or nodeGroups[].zones contains a zone list, add ru-central1-f to the groups that need nodes in this zone. For a NodeGroup, use spec.cloudInstances.zones.
Using existing subnets
If you pre-created subnets in Yandex Cloud and want cluster nodes to use them, map zones to subnet IDs in existingZoneToSubnetIDMap. Deckhouse Platform uses these subnets but does not manage their lifecycle. You can specify one subnet ID for a zone.
The existingZoneToSubnetIDMap parameter can contain more than four zones. The four-zone limit applies only to an explicitly set zones list. To select placement unambiguously, set zones and include zones that are present in existingZoneToSubnetIDMap.
The following configuration contains subnets for five zones and places nodes in two of them:
apiVersion: deckhouse.io/v1
kind: YandexClusterConfiguration
layout: Standard
nodeNetworkCIDR: 10.241.32.0/20
sshPublicKey: ssh-rsa AAAAB3Nza...
zones:
- ru-central1-a
- ru-central1-f
existingZoneToSubnetIDMap:
ru-central1-a: <RU_CENTRAL1_A_SUBNET_ID>
ru-central1-b: <RU_CENTRAL1_B_SUBNET_ID>
ru-central1-d: <RU_CENTRAL1_D_SUBNET_ID>
ru-central1-e: <RU_CENTRAL1_E_SUBNET_ID>
ru-central1-f: <RU_CENTRAL1_F_SUBNET_ID>
In this example, the ru-central1-b, ru-central1-d, and ru-central1-e subnets remain in existingZoneToSubnetIDMap and in Yandex Cloud, but their zones are not selected for node placement. To use one of them, add its zone to zones and to the zone lists of the required node groups.
If zones is not set, Deckhouse Platform uses the subnets from existingZoneToSubnetIDMap. For CloudEphemeral, the default zone list comes from discovery data. If the parameter contains default zones, this list contains only those zones. If the parameter contains only zones outside the default set, the list contains all zones specified in the parameter. For CloudPermanent groups without their own zone list, all subnets specified in the parameter are used. To limit placement unambiguously, set zones explicitly and specify node group zone lists when needed.
To add a new zone, pre-create a subnet in it and add its ID to existingZoneToSubnetIDMap. Then include the zone in zones and in the zone lists of the node groups that should place nodes there. Keep entries for the other zones that you continue to use.
If you remove all entries from existingZoneToSubnetIDMap, Deckhouse Platform switches to automatic subnet creation. Before removing the last entry, make sure that this is part of the intended infrastructure change.
Changing the zone set in a running cluster
Changing the zone list does not move nodes, disks, or other resources between zones automatically. First update the zone lists of the node groups and move workloads, then update the cluster-wide zones list. A Yandex Cloud disk tied to a zone can only be attached to a node in the same zone. Move the data before changing zones by following the procedure for the relevant workload. For general information about disks and PersistentVolume, see Yandex Cloud storage.
A subnet cannot be deleted while nodes or other Yandex Cloud resources use it. Before changing zones, remove nodes from the excluded zone and detach other resources from the subnet to be deleted. See the Yandex Cloud subnet deletion documentation.
If withNATInstance.internalSubnetID and withNATInstance.externalSubnetID are not set in the WithNATInstance layout, NAT instance placement is determined by zones:
| Zone list | NAT instance placement |
|---|---|
| Contains only default zones | The NAT instance remains in ru-central1-a |
Contains a dynamic zone and ru-central1-a |
The NAT instance remains in ru-central1-a |
Contains a zone outside the default set and excludes ru-central1-a |
The NAT instance is recreated in the alphabetically first zone in zones |
If existingZoneToSubnetIDMap is used without a ru-central1-a subnet, explicitly set withNATInstance.internalSubnetID or withNATInstance.externalSubnetID. Otherwise, the NAT instance cannot determine a subnet in ru-central1-a.
Cluster egress is interrupted while the NAT instance is recreated.
According to Yandex Cloud information, creating and changing virtual machines in ru-central1-b will be unavailable from December 16, 2026. Before that date, remove nodes from the zone using one of the examples below. Retaining the subnet does not restore the ability to create or change virtual machines in the zone.
Before changing the zone list, complete the following checks:
- Make sure that the installed Deckhouse Platform version supports the selected zones. The available
zonesvalues are listed in the YandexClusterConfiguration reference. - Check the cluster state and create an etcd backup. The procedure is described in Backing up etcd.
- Check the compute quota in the zones from the temporary and final node group lists. When replacing a single master node, allow resources for temporarily increasing the number of master nodes to three. The procedure for changing master nodes is described in Managing master nodes.
- For CloudPermanent groups, check
externalSubnetIDsandexternalIPAddresses. Nodes are assigned to zones in alphabetical order, repeating the zone list for subsequent nodes. After changing zones, make sure that each node’s external subnet and external IP address match its zone. -
For each CloudEphemeral node group, check the node management engine:
d8 k get nodegroup -o custom-columns=NAME:.metadata.name,ENGINE:.status.engineThe procedure below applies to groups with
status.engine: MCMand to CloudPermanent groups. In a group withstatus.engine: CAPI, old zonal MachineDeployments are not removed automatically. First follow the Cluster API (CAPI) node group migration procedure, then change the cluster-widezoneslist after deleting the old group. -
Find nodes in the excluded zone. For example, run the following command for
ru-central1-e:d8 k get nodes -l topology.kubernetes.io/zone=ru-central1-e -o name - Make sure that workloads do not use disks bound to the excluded zone. Move data from those disks by following the procedure for the relevant workload.
- Make sure that no other Yandex Cloud resources are attached to the excluded subnet.
Zone replacement procedure
The following example replaces ru-central1-e with ru-central1-f when subnets are created automatically. The YAML fragments show only the fields to change. Keep the other configuration fields.
The following procedure changes spec.cloudInstances.zones for CloudEphemeral groups with status.engine: MCM. Do not use this order for groups with status.engine: CAPI. Old zonal MachineDeployments are not removed automatically, so first follow the migration procedure linked in the check step, then change the cluster-wide zones list.
-
Set temporary zone lists without
ru-central1-efor all node groups that use this zone. For CloudEphemeral groups withstatus.engine: MCM, changespec.cloudInstances.zonesin the relevant NodeGroups. For CloudPermanent, changenodeGroups[].zonesandmasterNodeGroup.zoneswithd8 system edit provider-cluster-configuration. If a group has no zone list, set one explicitly so that its nodes leave the zone before you change the global list.nodeGroups: - name: worker zones: - ru-central1-a - ru-central1-b - ru-central1-d masterNodeGroup: zones: - ru-central1-a - ru-central1-b - ru-central1-d - Apply the node group changes. For CloudPermanent, use
dhctl converge. For CloudEphemeral groups withstatus.engine: MCM, wait for the corresponding MachineDeployment and nodes to be removed. When changing master nodes, follow the master node replacement procedure. -
Make sure that no nodes remain in
ru-central1-e:d8 k get nodes -l topology.kubernetes.io/zone=ru-central1-e -o nameThe command must not return node names.
-
Run
d8 system edit provider-cluster-configurationand replaceru-central1-ewithru-central1-finzones:zones: - ru-central1-a - ru-central1-b - ru-central1-d - ru-central1-f - Apply the change with
dhctl converge. Deckhouse Platform deletes theru-central1-esubnet and creates aru-central1-fsubnet with the same CIDR slot. - Add
ru-central1-fto the zone lists of the node groups that should place nodes there. Apply the node group changes using the method described in step 2. -
Check that the nodes and subnets match the final configuration:
d8 k get nodes -L topology.kubernetes.io/zone yc vpc subnet list
If dhctl converge reports a CIDR overlap, wait for the old subnet deletion to finish and apply the change again. If the error persists, remove ru-central1-f from zones, apply the change with dhctl converge, then set the final list with ru-central1-f and apply it again.
If the cluster already uses existingZoneToSubnetIDMap, Deckhouse Platform does not create or delete subnets. In this case, pre-create the ru-central1-f subnet, add its ID to the parameter, and update zones. Remove the ru-central1-e entry only after you stop using that subnet. Do not switch a cluster from automatic mode to existing subnets without a separate procedure.
Decommissioning the ru-central1-b zone
The following examples assume a cluster with four default zones and automatic subnet creation. If your cluster uses a different zone set, keep the required zones in the final list. For a NodeGroup, change spec.cloudInstances.zones. For CloudPermanent, change nodeGroups[].zones and masterNodeGroup.zones in YandexClusterConfiguration.
If a CloudEphemeral group uses CAPI, do not remove ru-central1-b by simply changing its zone list. Old zonal MachineDeployments are not removed automatically. First use the Cluster API (CAPI) node group migration procedure, then change the cluster-wide zones list after deleting the old group in the sequence required by your cluster configuration. For a group with status.engine: MCM, change the zone list using the steps in the selected example.
Choose one of the examples. Before changing the cluster-wide zone list, remove nodes from ru-central1-b using the method for the node management engine.
- Retain the ru-central1-b subnet
- Replace ru-central1-b with ru-central1-f
Use this example if the ru-central1-b subnet must remain in Yandex Cloud but nodes are no longer needed in this zone.
- Set temporary node group zone lists without
ru-central1-band apply the changes. For CloudPermanent, usedhctl converge. For CloudEphemeral groups withstatus.engine: MCM, wait for the corresponding MachineDeployment and nodes to be removed. -
Make sure that no nodes remain in
ru-central1-b:d8 k get nodes -l topology.kubernetes.io/zone=ru-central1-b -o name -
Run
d8 system edit provider-cluster-configurationand list the remaining zones inzones. For example:zones: - ru-central1-a - ru-central1-d - ru-central1-e - Apply the change with
dhctl converge. Because the list contains only default zones, Deckhouse Platform retains the subnets in all four default zones, includingru-central1-b. - If the cluster already uses
existingZoneToSubnetIDMap, keep theru-central1-bentry in the parameter. Deckhouse Platform will continue to use the mapped subnets without managing their deletion.
Use this example if the final list must contain ru-central1-f. This example assumes automatic subnet creation.
- Set temporary node group zone lists without
ru-central1-band apply the changes. For CloudPermanent, usedhctl converge. For CloudEphemeral groups withstatus.engine: MCM, wait for the corresponding MachineDeployment and nodes to be removed. - Make sure that no nodes or other Yandex Cloud resources remain in
ru-central1-b. -
Run
d8 system edit provider-cluster-configurationand replaceru-central1-bwithru-central1-finzones:zones: - ru-central1-a - ru-central1-d - ru-central1-e - ru-central1-f - Apply the change with
dhctl converge. Deckhouse Platform deletes theru-central1-bsubnet and creates aru-central1-fsubnet in the released CIDR slot. - Add
ru-central1-fto the zone lists of the node groups that should place nodes there and apply the node group changes. -
Check the final configuration:
d8 k get nodes -L topology.kubernetes.io/zone yc vpc subnet listNo nodes from
ru-central1-bmust remain. The Yandex Cloud subnet list must contain aru-central1-fsubnet.
If node removal does not complete, check the corresponding NodeGroup status and error messages. For CloudPermanent, check the dhctl converge output. For CloudEphemeral groups with status.engine: CAPI, return to the Cluster API (CAPI) migration procedure. Change the global zones list only after the nodes have been removed.
Do not manually delete managed virtual machines or Machine objects. This can disrupt the node group change process.
An example of the YandexInstanceClass custom resource
apiVersion: deckhouse.io/v1
kind: YandexInstanceClass
metadata:
name: test
spec:
cores: 4
memory: 8192
LoadBalancer
Service annotations
Default values are configured in the cluster for placing load balancer resources (the network for the target group and the subnet for the Listener). These values are set automatically during cluster setup and can be overridden with annotations at the individual Service level.
The default behavior (external or internal LB) depends on the cluster configuration. To explicitly choose the type, use the
yandex.cpi.flant.com/loadbalancer-externalannotation.
The following annotations are supported by Yandex Cloud Controller Manager:
yandex.cpi.flant.com/target-group-network-id— specifies the NetworkID in which the target group for this Service will be created. Overrides the corresponding default value.yandex.cpi.flant.com/listener-subnet-id— sets the SubnetID for the Listeners of the LB created for this Service. Overrides the corresponding default value.yandex.cpi.flant.com/listener-address-ipv4— sets a predefined IPv4 address for the Listeners (supported for both internal and external LBs).yandex.cpi.flant.com/loadbalancer-external— enables creation of an external LB for this Service (use it when you need to explicitly create an external load balancer). Overrides the default behavior.yandex.cpi.flant.com/target-group-name-prefix— specifies the name prefix of the target group used by the LoadBalancer. The annotation on the Service identifies the target group but does not select nodes. To include nodes in the target group, set the same annotation value inspec.nodeTemplate.annotationsin the NodeGroup. Yandex Cloud Controller Manager includes all suitable nodes carrying this annotation value, regardless of their NodeGroup. The target group name is formed as<ANNOTATION_VALUE><YANDEX_CLOUD_CLUSTER_NAME><NETWORK_ID>. For details, see Using a separate target group for a NodeGroup.
If separate target groups are created for the control plane or master nodes, add the label node.kubernetes.io/exclude-from-external-load-balancers: "" to the master nodes. This prevents the controller from automatically adding master nodes to new target groups for load balancers.
If you create your own load balancer for master nodes and want YCC to also be able to place its load balancers on master nodes, pre-create a target group with a name matching the pattern ${CLUSTER-NAME}${VPC.ID}.
Target group health checks
Health check parameters (for LB target groups created by the controller):
yandex.cpi.flant.com/healthcheck-interval-seconds— how often to run the check, in seconds (default: 2).yandex.cpi.flant.com/healthcheck-timeout-seconds— how long to wait for an endpoint response, in seconds. If no response is received within this time, the check is considered failed (default: 1).yandex.cpi.flant.com/healthcheck-unhealthy-threshold— how many consecutive failed checks are required to mark an endpoint as unhealthy and exclude it from load balancing (default: 2).yandex.cpi.flant.com/healthcheck-healthy-threshold— how many consecutive successful checks are required to return an endpoint to healthy status and include it back in load balancing (default: 2).