Configuration

The Yandex Cloud provider parameters are defined in four resources:

To change the provider settings in a running cluster, edit the ModuleConfig:

d8 k edit mc cloud-provider-yandex

After changing the node parameters, run the following command:

dhctl converge

If the cluster was installed with the YandexClusterConfiguration schema, it must be migrated to the ModuleConfig-based configuration. Until the migration is complete, the D8CloudProviderYandexCloudMigrationPending alert fires and a Deckhouse Platform update can be blocked.

For instructions, see “How to migrate a cloud provider to ModuleConfig-based configuration?”.

If the module settings had the storageClass.default parameter, set the default StorageClass with the global defaultClusterStorageClass parameter after the migration. The conversion does not carry this value over.

Configuration example

Below is a minimal configuration of a cluster with the Standard layout, one master node, and one group of worker nodes:

apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
  name: cloud-provider-yandex
spec:
  version: 2
  enabled: true
  settings:
    provider:
      parameters:
        cloudID: <CLOUD_ID>
        folderID: <FOLDER_ID>
    nodes:
      parameters:
        layout: Standard
        nodeNetworkCIDR: 10.241.32.0/20
        sshPublicKey: <SSH_PUBLIC_KEY>
        labels:
          billing: prod
---
apiVersion: deckhouse.io/v1
kind: YandexInstanceClass
metadata:
  name: master
spec:
  cores: 4
  memory: 8192
  imageID: <IMAGE_ID>
  etcdDiskSizeGB: 10
---
apiVersion: deckhouse.io/v1
kind: NodeGroup
metadata:
  name: master
spec:
  nodeType: CloudPermanent
  cloudInstances:
    classReference:
      kind: YandexInstanceClass
      name: master
    minPerZone: 1
    maxPerZone: 1
---
apiVersion: deckhouse.io/v1
kind: YandexInstanceClass
metadata:
  name: worker
spec:
  cores: 4
  memory: 8192
  coreFraction: 50
  imageID: <IMAGE_ID>
---
apiVersion: deckhouse.io/v1
kind: NodeGroup
metadata:
  name: worker
spec:
  nodeType: CloudEphemeral
  cloudInstances:
    classReference:
      kind: YandexInstanceClass
      name: worker
    minPerZone: 1
    maxPerZone: 3
    zones:
      - ru-central1-a

Where:

  • CLOUD_ID and FOLDER_ID are the Yandex Cloud cloud and folder identifiers, specified by the cloudID and folderID parameters in the provider.parameters section of the ModuleConfig resource of the cloud-provider-yandex module. For instructions on obtaining these identifiers, see “Connecting and authorizing in Yandex Cloud”.
  • SSH_PUBLIC_KEY is the public SSH key used to access nodes, specified by the sshPublicKey parameter in the nodes.parameters section of the ModuleConfig resource of the cloud-provider-yandex module.
  • IMAGE_ID is the operating system image ID used to create virtual machines, specified by the imageID parameter of the YandexInstanceClass resource. If the parameter is not set, the image of the master node group instance class is used.

The YandexInstanceClass resource for the master node group must specify the etcdDiskSizeGB parameter, which defines the size of a separate disk for etcd. This parameter must not be specified for other node groups.

The rest of the parameters are described in the module settings and in the YandexInstanceClass resource description.

The service account key is not stored in ModuleConfig. It is defined in a separate Secret.

Additional resources