Configuration
The Yandex Cloud provider parameters are defined in four resources:
- The ModuleConfig of the
cloud-provider-yandexmodule defines the layout, the network parameters, and the cloud and folder IDs. - The
d8-credentialsSecret in thed8-cloud-provider-yandexnamespace stores the service account key. Its format is described in “Credentials Secret”. - YandexInstanceClass describes the virtual machine parameters.
- NodeGroup describes the node groups and refers to an instance class. The master node group is described by the same resource with the
CloudPermanenttype.
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_IDandFOLDER_IDare the Yandex Cloud cloud and folder identifiers, specified by thecloudIDandfolderIDparameters in theprovider.parameterssection of the ModuleConfig resource of thecloud-provider-yandexmodule. For instructions on obtaining these identifiers, see “Connecting and authorizing in Yandex Cloud”.SSH_PUBLIC_KEYis the public SSH key used to access nodes, specified by thesshPublicKeyparameter in thenodes.parameterssection of the ModuleConfig resource of thecloud-provider-yandexmodule.IMAGE_IDis the operating system image ID used to create virtual machines, specified by theimageIDparameter of the YandexInstanceClass resource. If the parameter is not set, the image of themasternode 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.