UpdateClusterUserData#

Description#

Обновляет пользовательские данные кластера Kubernetes. Во время обновления группы рабочих узлов продолжают функционировать.

Request Syntax#

 POST /clusters/name/update-config HTTP/1.1
 Content-type: application/json

 {
    "userDataConfig": {
       "userData": [ "string" ],
       "userDataContentType": [ "string" ],
    }
 }

URI Request Parameters#

The request uses the following URI parameters.

  • name — The cluster name.

    • Type: String

    • Required: Yes

Request Parameters#

  • userDataConfig — Конфигурация пользовательских данных, используемых кластером Kubernetes.

Response Syntax#

HTTP/1.1 200
Content-type: application/json

{
   "update": {
      "createdAt": number,
      "errors": [
         {
            "errorCode": "string",
            "errorMessage": "string",
            "resourceIds": [ "string" ]
         }
      ],
      "id": "string",
      "params": [
         {
            "type": "string",
            "value": "string"
         }
      ],
      "status": "string",
      "type": "string"
   }
}

Response Elements#

If the request is executed successfully, API will return an HTTP response with 200 code. The response contains the following data in JSON format.

  • update — The description of an asynchronous update description.

Examples#

boto3 K2 Cloud boto3 Client
import boto3

session = boto3.Session(
   aws_access_key_id="<AWS_ACCESS_KEY_ID>",
   aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
   region_name="",
)

eks_client = session.client(
   'eks',
   endpoint_url='https://eks.ru-msk.k2.cloud/',
)

eks_client.update_cluster_user_data(
   name="production",
   userDataConfig={
         "userData": "#!/bin/bash\n hostname",
         "userDataContentType": "x-shellscript"
   },
)
c2-eks K2 Cloud API Client
c2-eks UpdateClusterUserData \
    name production \
    userDataConfig.userData.1 "#!/bin/bash\nhostname" \
    userDataConfig.userDataContentType.1 "x-shellscript"
aws-cli
aws eks --endpoint https://eks.ru-msk.k2.cloud/ update-cluster-user-data \
    --name production \
    --user-data-config '{"userData": ["#!/bin/bash\nhostname"], "userDataContentType": ["x-shellscript"]}'