Managed Services for Kubernetes API, REST: Cluster.create
Creates a Kubernetes cluster in the specified folder.
HTTP request
POST https://mks.api.cloud.yandex.net/managed-kubernetes/v1/clusters
Body parameters
{
"folderId": "string",
"name": "string",
"description": "string",
"labels": "object",
"networkId": "string",
"masterSpec": {
"locations": [
{
"zoneId": "string",
"subnetId": "string"
}
],
"etcdClusterSize": "string",
"externalV4AddressSpec": {
"address": "string"
},
"externalV6AddressSpec": {
"address": "string"
},
"version": "string",
"maintenancePolicy": {
"autoUpgrade": true,
"maintenanceWindow": {
// `masterSpec.maintenancePolicy.maintenanceWindow` includes only one of the fields `anytime`, `dailyMaintenanceWindow`, `weeklyMaintenanceWindow`
"anytime": {},
"dailyMaintenanceWindow": {
"startTime": {
"hours": "integer",
"minutes": "integer",
"seconds": "integer",
"nanos": "integer"
},
"duration": "string"
},
"weeklyMaintenanceWindow": {
"daysOfWeek": [
{
"days": [
"string"
],
"startTime": {
"hours": "integer",
"minutes": "integer",
"seconds": "integer",
"nanos": "integer"
},
"duration": "string"
}
]
},
// end of the list of possible fields`masterSpec.maintenancePolicy.maintenanceWindow`
}
},
"securityGroupIds": [
"string"
],
"masterLogging": {
"enabled": true,
"auditEnabled": true,
"clusterAutoscalerEnabled": true,
"kubeApiserverEnabled": true,
"eventsEnabled": true,
// `masterSpec.masterLogging` includes only one of the fields `logGroupId`, `folderId`
"logGroupId": "string",
"folderId": "string",
// end of the list of possible fields`masterSpec.masterLogging`
},
// `masterSpec` includes only one of the fields `zonalMasterSpec`, `regionalMasterSpec`
"zonalMasterSpec": {
"zoneId": "string",
"internalV4AddressSpec": {
"subnetId": "string"
},
"externalV4AddressSpec": {
"address": "string"
}
},
"regionalMasterSpec": {
"regionId": "string",
"locations": [
{
"zoneId": "string",
"internalV4AddressSpec": {
"subnetId": "string"
}
}
],
"externalV4AddressSpec": {
"address": "string"
},
"externalV6AddressSpec": {
"address": "string"
}
},
// end of the list of possible fields`masterSpec`
},
"ipAllocationPolicy": {
"clusterIpv4CidrBlock": "string",
"nodeIpv4CidrMaskSize": "string",
"serviceIpv4CidrBlock": "string",
"clusterIpv6CidrBlock": "string",
"serviceIpv6CidrBlock": "string"
},
"serviceAccountId": "string",
"nodeServiceAccountId": "string",
"releaseChannel": "string",
"networkPolicy": {
"provider": "string"
},
"kmsProvider": {
"keyId": "string"
},
"gatewayIpv4Address": "string",
"cilium": {
"routingMode": "string"
}
}
Field | Description |
---|---|
folderId | string Required. ID of the folder to create a Kubernetes cluster in. To get the folder ID use a list request. |
name | string Name of the Kubernetes cluster. The name must be unique within the folder. Value must match the regular expression |
description | string Description of the Kubernetes cluster. The maximum string length in characters is 256. |
labels | object Resource labels as No more than 64 per resource. The string length in characters for each key must be 1-63. Each key must match the regular expression |
networkId | string Required. ID of the network. |
masterSpec | object Required. Master specification of the Kubernetes cluster. |
masterSpec. locations[] |
object Locations specification for Kubernetes control-plane (master) instances. Works in conjunction with
|
masterSpec. locations[]. zoneId |
string Required. ID of the availability zone where the master resides. |
masterSpec. locations[]. subnetId |
string ID of the VPC network's subnet where the master resides. If not specified and there is a single subnet in specified zone, address in this subnet will be allocated. |
masterSpec. etcdClusterSize |
string (int64) Number of etcd nodes in cluster. Works in conjunction with Value must be one of 0, 1 or 3. |
masterSpec. externalV4AddressSpec |
object Specification of parameters for external IPv6 networking. |
masterSpec. externalV4AddressSpec. address |
string IP address. |
masterSpec. externalV6AddressSpec |
object Specification of parameters for external IPv4 networking. |
masterSpec. externalV6AddressSpec. address |
string IP address. |
masterSpec. version |
string Version of Kubernetes components that runs on the master. |
masterSpec. maintenancePolicy |
object Maintenance policy of the master. |
masterSpec. maintenancePolicy. autoUpgrade |
boolean (boolean) If set to true, automatic updates are installed in the specified period of time with no interaction from the user. If set to false, automatic upgrades are disabled. |
masterSpec. maintenancePolicy. maintenanceWindow |
object Maintenance window settings. Update will start at the specified time and last no more than the specified duration. The time is set in UTC. |
masterSpec. maintenancePolicy. maintenanceWindow. anytime |
object Updating the master at any time. masterSpec.maintenancePolicy.maintenanceWindow includes only one of the fields anytime , dailyMaintenanceWindow , weeklyMaintenanceWindow |
masterSpec. maintenancePolicy. maintenanceWindow. dailyMaintenanceWindow |
object Updating the master on any day during the specified time window. masterSpec.maintenancePolicy.maintenanceWindow includes only one of the fields anytime , dailyMaintenanceWindow , weeklyMaintenanceWindow |
masterSpec. maintenancePolicy. maintenanceWindow. dailyMaintenanceWindow. startTime |
object Required. Window start time, in the UTC timezone. Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and google.protobuf.Timestamp. |
masterSpec. maintenancePolicy. maintenanceWindow. dailyMaintenanceWindow. startTime. hours |
integer (int32) Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time. |
masterSpec. maintenancePolicy. maintenanceWindow. dailyMaintenanceWindow. startTime. minutes |
integer (int32) Minutes of hour of day. Must be from 0 to 59. |
masterSpec. maintenancePolicy. maintenanceWindow. dailyMaintenanceWindow. startTime. seconds |
integer (int32) Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds. |
masterSpec. maintenancePolicy. maintenanceWindow. dailyMaintenanceWindow. startTime. nanos |
integer (int32) Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. |
masterSpec. maintenancePolicy. maintenanceWindow. dailyMaintenanceWindow. duration |
string Window duration. Acceptable values are 3600 seconds to 86400 seconds, inclusive. |
masterSpec. maintenancePolicy. maintenanceWindow. weeklyMaintenanceWindow |
object Updating the master on selected days during the specified time window. masterSpec.maintenancePolicy.maintenanceWindow includes only one of the fields anytime , dailyMaintenanceWindow , weeklyMaintenanceWindow |
masterSpec. maintenancePolicy. maintenanceWindow. weeklyMaintenanceWindow. daysOfWeek[] |
object Required. Days of the week and the maintenance window for these days when automatic updates are allowed. The number of elements must be in the range 1-7. |
masterSpec. maintenancePolicy. maintenanceWindow. weeklyMaintenanceWindow. daysOfWeek[]. days[] |
string Required. Days of the week when automatic updates are allowed. The number of elements must be in the range 1-7.
|
masterSpec. maintenancePolicy. maintenanceWindow. weeklyMaintenanceWindow. daysOfWeek[]. startTime |
object Required. Window start time, in the UTC timezone. Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and google.protobuf.Timestamp. |
masterSpec. maintenancePolicy. maintenanceWindow. weeklyMaintenanceWindow. daysOfWeek[]. startTime. hours |
integer (int32) Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time. |
masterSpec. maintenancePolicy. maintenanceWindow. weeklyMaintenanceWindow. daysOfWeek[]. startTime. minutes |
integer (int32) Minutes of hour of day. Must be from 0 to 59. |
masterSpec. maintenancePolicy. maintenanceWindow. weeklyMaintenanceWindow. daysOfWeek[]. startTime. seconds |
integer (int32) Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds. |
masterSpec. maintenancePolicy. maintenanceWindow. weeklyMaintenanceWindow. daysOfWeek[]. startTime. nanos |
integer (int32) Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. |
masterSpec. maintenancePolicy. maintenanceWindow. weeklyMaintenanceWindow. daysOfWeek[]. duration |
string Window duration. Acceptable values are 3600 seconds to 86400 seconds, inclusive. |
masterSpec. securityGroupIds[] |
string Master security groups. |
masterSpec. masterLogging |
object Cloud Logging for master components. |
masterSpec. masterLogging. enabled |
boolean (boolean) Identifies whether Cloud Logging is enabled for master components. |
masterSpec. masterLogging. auditEnabled |
boolean (boolean) Identifies whether Cloud Logging is enabled for audit logs. |
masterSpec. masterLogging. clusterAutoscalerEnabled |
boolean (boolean) Identifies whether Cloud Logging is enabled for cluster-autoscaler. |
masterSpec. masterLogging. kubeApiserverEnabled |
boolean (boolean) Identifies whether Cloud Logging is enabled for kube-apiserver. |
masterSpec. masterLogging. eventsEnabled |
boolean (boolean) Identifies whether Cloud Logging is enabled for events. |
masterSpec. masterLogging. logGroupId |
string masterSpec.masterLogging includes only one of the fields logGroupId , folderId ID of the log group where logs of master components should be stored. Value must match the regular expression |
masterSpec. masterLogging. folderId |
string masterSpec.masterLogging includes only one of the fields logGroupId , folderId ID of the folder where logs should be stored (in default group). Value must match the regular expression |
masterSpec. zonalMasterSpec |
object Specification of the zonal master. masterSpec includes only one of the fields zonalMasterSpec , regionalMasterSpec |
masterSpec. zonalMasterSpec. zoneId |
string Required. ID of the availability zone. |
masterSpec. zonalMasterSpec. internalV4AddressSpec |
object Specification of parameters for internal IPv4 networking. |
masterSpec. zonalMasterSpec. internalV4AddressSpec. subnetId |
string ID of the subnet. If no ID is specified, and there only one subnet in specified zone, an address in this subnet will be allocated. |
masterSpec. zonalMasterSpec. externalV4AddressSpec |
object Specification of parameters for external IPv4 networking. |
masterSpec. zonalMasterSpec. externalV4AddressSpec. address |
string IP address. |
masterSpec. regionalMasterSpec |
object Specification of the regional master. masterSpec includes only one of the fields zonalMasterSpec , regionalMasterSpec |
masterSpec. regionalMasterSpec. regionId |
string Required. ID of the availability zone where the master resides. |
masterSpec. regionalMasterSpec. locations[] |
object List of locations where the master will be allocated. |
masterSpec. regionalMasterSpec. locations[]. zoneId |
string Required. ID of the availability zone. |
masterSpec. regionalMasterSpec. locations[]. internalV4AddressSpec |
object If not specified and there is a single subnet in specified zone, address in this subnet will be allocated. |
masterSpec. regionalMasterSpec. locations[]. internalV4AddressSpec. subnetId |
string ID of the subnet. If no ID is specified, and there only one subnet in specified zone, an address in this subnet will be allocated. |
masterSpec. regionalMasterSpec. externalV4AddressSpec |
object Specify to allocate a static public IP for the master. |
masterSpec. regionalMasterSpec. externalV4AddressSpec. address |
string IP address. |
masterSpec. regionalMasterSpec. externalV6AddressSpec |
object Specification of parameters for external IPv6 networking. |
masterSpec. regionalMasterSpec. externalV6AddressSpec. address |
string IP address. |
ipAllocationPolicy | object IP allocation policy of the Kubernetes cluster. |
ipAllocationPolicy. clusterIpv4CidrBlock |
string CIDR block. IP range for allocating pod addresses. It should not overlap with any subnet in the network the Kubernetes cluster located in. Static routes will be set up for this CIDR blocks in node subnets. |
ipAllocationPolicy. nodeIpv4CidrMaskSize |
string (int64) Size of the masks that are assigned for each node in the cluster. If not specified, 24 is used. Value must be one of 0, 24, 25, 26, 27 or 28. |
ipAllocationPolicy. serviceIpv4CidrBlock |
string CIDR block. IP range Kubernetes service Kubernetes cluster IP addresses will be allocated from. It should not overlap with any subnet in the network the Kubernetes cluster located in. |
ipAllocationPolicy. clusterIpv6CidrBlock |
string IPv6 range for allocating pod IP addresses. |
ipAllocationPolicy. serviceIpv6CidrBlock |
string IPv6 range for allocating Kubernetes service IP addresses |
serviceAccountId | string Required. Service account to be used for provisioning Compute Cloud and VPC resources for Kubernetes cluster. Selected service account should have |
nodeServiceAccountId | string Required. Service account to be used by the worker nodes of the Kubernetes cluster to access Container Registry or to push node logs and metrics. |
releaseChannel | string Release channel for the master.
|
networkPolicy | object |
networkPolicy. provider |
string |
kmsProvider | object KMS provider configuration. |
kmsProvider. keyId |
string KMS key ID for secrets encryption. To obtain a KMS key ID use a list request. |
gatewayIpv4Address | string Gateway IPv4 address. |
cilium | object |
cilium. routingMode |
string |
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": true,
"metadata": "object",
// includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": "object",
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
createdAt | string (date-time) Creation timestamp. String in RFC3339 text format. The range of possible values is from To work with values in this field, use the APIs described in the Protocol Buffers reference. In some languages, built-in datetime utilities do not support nanosecond precision (9 digits). |
createdBy | string ID of the user or service account who initiated the operation. |
modifiedAt | string (date-time) The time when the Operation resource was last modified. String in RFC3339 text format. The range of possible values is from To work with values in this field, use the APIs described in the Protocol Buffers reference. In some languages, built-in datetime utilities do not support nanosecond precision (9 digits). |
done | boolean (boolean) If the value is |
metadata | object Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
error | object The error result of the operation in case of failure or cancellation. includes only one of the fields error , response |
error. code |
integer (int32) Error code. An enum value of google.rpc.Code. |
error. message |
string An error message. |
error. details[] |
object A list of messages that carry the error details. |
response | object includes only one of the fields error , response The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any. |