> ## Documentation Index
> Fetch the complete documentation index at: https://docs.preprod.world/llms.txt
> Use this file to discover all available pages before exploring further.

# Update k8s cluster



## OpenAPI

````yaml /api-reference/services_docs_mintlify_enriched/cloud_api.yaml patch /cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Cloud API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: 23526a255bc8
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Bare Metal
  - name: Container as a Service
  - name: Cost Reports
  - name: DDoS Protection
  - name: Everywhere Inference
  - name: Everywhere Inference Apps
  - name: File Shares
  - name: Floating IPs
  - name: Function as a Service
  - name: GPU Bare Metal
  - name: GPU Virtual
  - name: IP Ranges
  - name: Images
  - name: Instances
  - name: Load Balancers
  - name: Logging
  - name: Managed Kubernetes
  - name: Managed PostgreSQL
  - name: Networks
  - name: Placement Groups
  - name: Ports
  - name: Projects
  - name: Quotas
  - name: Regions
  - name: Registry
  - name: Reservations
  - name: Reserved IPs
  - name: Routers
  - name: SSH Keys
  - name: Secrets
  - name: Security Groups
  - name: Snapshot Schedules
  - name: Snapshots
  - name: Tasks
  - name: User Actions
  - name: User Role Assignments
  - name: Volumes
paths:
  /cloud/v2/k8s/clusters/{project_id}/{region_id}/{cluster_name}:
    patch:
      tags:
        - Managed Kubernetes
      summary: Update k8s cluster
      operationId: K8sClusterViewSetV2.patch
      parameters:
        - in: path
          name: project_id
          required: true
          description: Project ID
          schema:
            description: Project ID
            example: 1
            examples:
              - 1
            title: Project Id
            type: integer
        - in: path
          name: region_id
          required: true
          description: Region ID
          schema:
            description: Region ID
            example: 7
            examples:
              - 7
            title: Region Id
            type: integer
        - in: path
          name: cluster_name
          required: true
          description: Cluster name
          schema:
            description: Cluster name
            example: my-cluster
            examples:
              - my-cluster
            title: Cluster Name
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/K8sClusterUpdateV2Serializer'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskIDsSerializer'
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            task_id_list = client.cloud.k8s.clusters.update(
                cluster_name="my-cluster",
                project_id=1,
                region_id=7,
            )
            print(task_id_list.tasks)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/cloud\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttaskIDList, err := client.Cloud.K8S.Clusters.Update(\n\t\tcontext.TODO(),\n\t\t\"my-cluster\",\n\t\tcloud.K8SClusterUpdateParams{\n\t\t\tProjectID: gcore.Int(1),\n\t\t\tRegionID:  gcore.Int(7),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", taskIDList.Tasks)\n}\n"
components:
  schemas:
    K8sClusterUpdateV2Serializer:
      properties:
        add_ons:
          $ref: '#/components/schemas/K8sClusterAddonsUpdateV2Serializer'
          description: Cluster add-ons configuration
          examples:
            - slurm:
                enabled: true
                file_share_id: cbc94d0e-06c6-4d12-9e86-9782ba14fc8c
                ssh_key_ids:
                  - 25735292-bd97-44b0-a1af-d7eab876261d
                  - efc01f3a-35b9-4385-89f9-e38439093ee7
                worker_count: 2
        authentication:
          anyOf:
            - $ref: '#/components/schemas/K8sClusterAuthenticationCreateV2Serializer'
            - type: 'null'
          default: null
          description: Authentication settings
          examples:
            - oidc:
                client_id: kubernetes
                groups_claim: groups
                groups_prefix: 'oidc:'
                issuer_url: https://accounts.provider.example
                required_claims:
                  claim: value
                signing_algs:
                  - RS256
                  - RS512
                username_claim: sub
                username_prefix: 'oidc:'
        autoscaler_config:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          default: null
          description: |-
            Cluster autoscaler configuration.

              It allows you to override the default cluster-autoscaler parameters provided by the platform with your preferred values.

              Supported parameters (in alphabetical order):
              - balance-similar-node-groups (boolean: true/false) - Detect similar node groups and balance the number of nodes between them.
              - expander (string: random, most-pods, least-waste, price, priority, grpc) - Type of node group expander to be used in scale up. Specifying multiple values separated by commas will call the expanders in succession until there is only one option remaining.
              - expendable-pods-priority-cutoff (float) - Pods with priority below cutoff will be expendable. They can be killed without any consideration during scale down and they don't cause scale up. Pods with null priority (PodPriority disabled) are non expendable.
              - ignore-daemonsets-utilization (boolean: true/false) - Should CA ignore DaemonSet pods when calculating resource utilization for scaling down.
              - max-empty-bulk-delete (integer) - Maximum number of empty nodes that can be deleted at the same time.
              - max-graceful-termination-sec (integer) - Maximum number of seconds CA waits for pod termination when trying to scale down a node.
              - max-node-provision-time (duration: e.g., '15m') - The default maximum time CA waits for node to be provisioned - the value can be overridden per node group.
              - max-total-unready-percentage (float) - Maximum percentage of unready nodes in the cluster. After this is exceeded, CA halts operations.
              - new-pod-scale-up-delay (duration: e.g., '10s') - Pods less than this old will not be considered for scale-up. Can be increased for individual pods through annotation.
              - ok-total-unready-count (integer) - Number of allowed unready nodes, irrespective of max-total-unready-percentage.
              - scale-down-delay-after-add (duration: e.g., '10m') - How long after scale up that scale down evaluation resumes.
              - scale-down-delay-after-delete (duration: e.g., '10s') - How long after node deletion that scale down evaluation resumes.
              - scale-down-delay-after-failure (duration: e.g., '3m') - How long after scale down failure that scale down evaluation resumes.
              - scale-down-enabled (boolean: true/false) - Should CA scale down the cluster.
              - scale-down-unneeded-time (duration: e.g., '10m') - How long a node should be unneeded before it is eligible for scale down.
              - scale-down-unready-time (duration: e.g., '20m') - How long an unready node should be unneeded before it is eligible for scale down.
              - scale-down-utilization-threshold (float) - The maximum value between the sum of cpu requests and sum of memory requests of all pods running on the node divided by node's corresponding allocatable resource, below which a node can be considered for scale down.
              - scan-interval (duration: e.g., '10s') - How often cluster is reevaluated for scale up or down.
              - skip-nodes-with-custom-controller-pods (boolean: true/false) - If true cluster autoscaler will never delete nodes with pods owned by custom controllers.
              - skip-nodes-with-local-storage (boolean: true/false) - If true cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath.
              - skip-nodes-with-system-pods (boolean: true/false) - If true cluster autoscaler will never delete nodes with pods from kube-system (except for DaemonSet or mirror pods).
          examples:
            - scale-down-unneeded-time: 5m
          title: Autoscaler Config
        cni:
          anyOf:
            - $ref: '#/components/schemas/K8sClusterCNICreateV2Serializer'
            - type: 'null'
          default: null
          description: Cluster CNI settings
          examples:
            - cilium:
                cni_exclusive: true
                encryption: true
                hubble_relay: true
                hubble_ui: true
                lb_acceleration: true
                lb_mode: snat
                tunnel: geneve
              provider: cilium
        ddos_profile:
          anyOf:
            - $ref: '#/components/schemas/K8sClusterDdosProfileUpdateV2Serializer'
            - type: 'null'
          default: null
          description: Advanced DDoS Protection profile
          examples:
            - enabled: true
              fields:
                - base_field: 10
                  field_value:
                    - 45046
                    - 45047
              profile_template: 29
            - enabled: false
        logging:
          anyOf:
            - $ref: '#/components/schemas/K8sClusterLoggingUpdateV2Serializer'
            - type: 'null'
          default: null
          description: Logging configuration
          examples:
            - destination_region_id: 1
              enabled: true
              retention_policy:
                period: 45
              topic_name: my-log-name
            - enabled: false
            - null
      title: K8sClusterUpdateV2Serializer
      type: object
    TaskIDsSerializer:
      properties:
        tasks:
          description: >-
            List of task IDs representing asynchronous operations. Use these IDs
            to monitor operation progress:
              - `GET /v1/tasks/{task_id}` - Check individual task status and details
              Poll task status until completion (`FINISHED`/`ERROR`) before proceeding with dependent operations.
          example:
            - d478ae29-dedc-4869-82f0-96104425f565
          examples:
            - - d478ae29-dedc-4869-82f0-96104425f565
          items:
            type: string
          title: Tasks
          type: array
      required:
        - tasks
      title: TaskIDsSerializer
      type: object
    K8sClusterAddonsUpdateV2Serializer:
      properties:
        slurm:
          $ref: '#/components/schemas/K8sClusterSlurmAddonV2Serializers'
          description: Slurm add-on configuration
      title: K8sClusterAddonsUpdateV2Serializer
      type: object
    K8sClusterAuthenticationCreateV2Serializer:
      properties:
        oidc:
          anyOf:
            - $ref: '#/components/schemas/K8sClusterOIDCV2Serializer'
            - type: 'null'
          default: null
          description: OIDC authentication settings
      title: K8sClusterAuthenticationCreateV2Serializer
      type: object
    K8sClusterCNICreateV2Serializer:
      properties:
        cilium:
          anyOf:
            - $ref: '#/components/schemas/K8sClusterCiliumV2Serializer'
            - type: 'null'
          default: null
          description: Cilium settings
        provider:
          $ref: '#/components/schemas/K8sClusterCNI'
          default: calico
          description: CNI provider
          examples:
            - calico
      title: K8sClusterCNICreateV2Serializer
      type: object
    K8sClusterDdosProfileUpdateV2Serializer:
      properties:
        enabled:
          description: Enable advanced DDoS protection
          example: true
          examples:
            - true
          title: Enabled
          type: boolean
        fields:
          default: []
          description: DDoS profile parameters
          example:
            - base_field: 10
              field_value:
                - 45046
                - 45047
          examples:
            - - base_field: 10
                field_value:
                  - 45046
                  - 45047
          items:
            $ref: '#/components/schemas/K8sClusterDdosProfileFieldV2Serializer'
          title: Fields
          type: array
        profile_template:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: DDoS profile template ID
          examples:
            - 29
          title: Profile Template
        profile_template_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: DDoS profile template name
          examples: []
          title: Profile Template Name
      required:
        - enabled
      title: K8sClusterDdosProfileUpdateV2Serializer
      type: object
    K8sClusterLoggingUpdateV2Serializer:
      properties:
        destination_region_id:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: Destination region id to which the logs will be written
          examples:
            - 1
          title: Destination Region Id
        enabled:
          default: false
          description: Enable/disable forwarding logs to LaaS
          example: true
          examples:
            - true
            - false
          title: Enabled
          type: boolean
        retention_policy:
          anyOf:
            - $ref: '#/components/schemas/LaasIndexRetentionPolicyPydanticSerializer'
            - type: 'null'
          default: null
          description: The logs retention policy
          examples:
            - period: 45
        topic_name:
          anyOf:
            - maxLength: 223
              minLength: 1
              pattern: >-
                ^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\.[a-z0-9](?:[-a-z0-9]*[a-z0-9])*)*$
              type: string
            - type: 'null'
          default: null
          description: The topic name to which the logs will be written
          examples:
            - my-log-name
          title: Topic Name
      title: K8sClusterLoggingUpdateV2Serializer
      type: object
    K8sClusterSlurmAddonV2Serializers:
      discriminator:
        mapping:
          'False':
            $ref: '#/components/schemas/K8sClusterSlurmAddonDisableV2Serializer'
          'True':
            $ref: '#/components/schemas/K8sClusterSlurmAddonEnableV2Serializer'
        propertyName: enabled
      oneOf:
        - $ref: '#/components/schemas/K8sClusterSlurmAddonEnableV2Serializer'
        - $ref: '#/components/schemas/K8sClusterSlurmAddonDisableV2Serializer'
      title: K8sClusterSlurmAddonV2Serializers
    K8sClusterOIDCV2Serializer:
      properties:
        client_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Client ID
          examples:
            - kubernetes
          title: Client Id
        groups_claim:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: JWT claim to use as the user's group
          examples:
            - groups
          title: Groups Claim
        groups_prefix:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Prefix prepended to group claims
          examples:
            - 'oidc:'
          title: Groups Prefix
        issuer_url:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Issuer URL
          examples:
            - https://accounts.provider.example
          title: Issuer Url
        required_claims:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          default: null
          description: Key-value pairs that describe required claims in the token
          examples:
            - claim: value
          title: Required Claims
        signing_algs:
          anyOf:
            - items:
                $ref: '#/components/schemas/OIDCSigningAlgorithmEnum'
              type: array
            - type: 'null'
          default: null
          description: Accepted signing algorithms
          examples:
            - - RS512
          title: Signing Algs
        username_claim:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: JWT claim to use as the user name
          examples:
            - sub
          title: Username Claim
        username_prefix:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Prefix prepended to username claims to prevent clashes
          examples:
            - 'oidc:'
          title: Username Prefix
      title: K8sClusterOIDCV2Serializer
      type: object
    K8sClusterCiliumV2Serializer:
      properties:
        cni_exclusive:
          default: true
          description: >-
            Whether Cilium manages networking exclusively. Set to `false` to
            allow other CNI components to coexist with Cilium.
          example: true
          examples:
            - true
          title: Cni Exclusive
          type: boolean
        encryption:
          default: false
          description: Wireguard encryption
          title: Encryption
          type: boolean
        hubble_relay:
          default: false
          description: Hubble Relay
          title: Hubble Relay
          type: boolean
        hubble_ui:
          default: false
          description: Hubble UI
          title: Hubble Ui
          type: boolean
        lb_acceleration:
          default: false
          description: LoadBalancer acceleration
          title: Lb Acceleration
          type: boolean
        lb_mode:
          $ref: '#/components/schemas/K8sClusterCiliumLBMode'
          default: snat
          description: LoadBalancer mode
          examples:
            - hybrid
            - snat
            - dsr
        mask_size:
          default: 24
          description: Mask size for IPv4
          example: 24
          examples:
            - 24
          title: Mask Size
          type: integer
        mask_size_v6:
          default: 120
          description: Mask size for IPv6
          example: 120
          examples:
            - 120
          title: Mask Size V6
          type: integer
        routing_mode:
          $ref: '#/components/schemas/K8sClusterCiliumRoutingMode'
          default: tunnel
          description: Routing mode
          examples:
            - tunnel
        tunnel:
          $ref: '#/components/schemas/K8sClusterCiliumTunnel'
          default: geneve
          description: CNI provider
          examples:
            - geneve
      title: K8sClusterCiliumV2Serializer
      type: object
    K8sClusterCNI:
      enum:
        - calico
        - cilium
      title: K8sClusterCNI
      type: string
    K8sClusterDdosProfileFieldV2Serializer:
      properties:
        base_field:
          description: ''
          example: 10
          examples:
            - 10
          title: Base Field
          type: integer
        field_value:
          anyOf:
            - {}
            - type: 'null'
          default: null
          description: Complex value for the DDoS profile field
          examples:
            - - 45046
              - 45047
          title: Field Value
      required:
        - base_field
      title: K8sClusterDdosProfileFieldV2Serializer
      type: object
    LaasIndexRetentionPolicyPydanticSerializer:
      properties:
        period:
          anyOf:
            - exclusiveMinimum: 0
              maximum: 1825
              type: integer
            - type: 'null'
          description: Duration of days for which logs must be kept.
          examples:
            - 45
          title: Period
      required:
        - period
      title: LaasIndexRetentionPolicyPydanticSerializer
      type: object
    K8sClusterSlurmAddonDisableV2Serializer:
      properties:
        enabled:
          const: false
          description: The Slurm add-on will be disabled in the cluster.
          example: false
          examples:
            - false
          title: Enabled
          type: boolean
      required:
        - enabled
      title: K8sClusterSlurmAddonDisableV2Serializer
      type: object
    K8sClusterSlurmAddonEnableV2Serializer:
      properties:
        enabled:
          const: true
          description: |-
            The Slurm add-on will be enabled in the cluster.

              This add-on is only supported in clusters running Kubernetes v1.31 and v1.32 with at least 1 GPU cluster pool and VAST NFS support enabled.
          example: true
          examples:
            - true
          title: Enabled
          type: boolean
        file_share_id:
          description: |-
            ID of a VAST file share to be used as Slurm storage.

              The Slurm add-on will create separate Persistent Volume Claims for different purposes (controller spool, worker spool, jail) on that file share.

              The file share must have `root_squash` disabled, while `path_length` and `allowed_characters` settings must be set to `NPL`.
          example: cbc94d0e-06c6-4d12-9e86-9782ba14fc8c
          examples:
            - cbc94d0e-06c6-4d12-9e86-9782ba14fc8c
          format: uuid4
          title: File Share Id
          type: string
        ssh_key_ids:
          description: >-
            IDs of SSH keys to authorize for SSH connection to Slurm login
            nodes.
          example:
            - 25735292-bd97-44b0-a1af-d7eab876261d
            - efc01f3a-35b9-4385-89f9-e38439093ee7
          examples:
            - - 25735292-bd97-44b0-a1af-d7eab876261d
              - efc01f3a-35b9-4385-89f9-e38439093ee7
          items:
            format: uuid4
            type: string
          minItems: 1
          title: Ssh Key Ids
          type: array
        worker_count:
          description: >-
            Size of the worker pool, i.e. the number of Slurm worker nodes.


            Each Slurm worker node will be backed by a Pod scheduled on one of
            cluster's GPU nodes.


            Note: Downscaling (reducing worker count) is not supported.
          example: 2
          examples:
            - 2
          minimum: 1
          title: Worker Count
          type: integer
      required:
        - enabled
        - file_share_id
        - ssh_key_ids
        - worker_count
      title: K8sClusterSlurmAddonEnableV2Serializer
      type: object
    OIDCSigningAlgorithmEnum:
      enum:
        - ES256
        - ES384
        - ES512
        - PS256
        - PS384
        - PS512
        - RS256
        - RS384
        - RS512
      title: OIDCSigningAlgorithmEnum
      type: string
    K8sClusterCiliumLBMode:
      enum:
        - dsr
        - hybrid
        - snat
      title: K8sClusterCiliumLBMode
      type: string
    K8sClusterCiliumRoutingMode:
      enum:
        - native
        - tunnel
      title: K8sClusterCiliumRoutingMode
      type: string
    K8sClusterCiliumTunnel:
      enum:
        - ''
        - geneve
        - vxlan
      title: K8sClusterCiliumTunnel
      type: string
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234_abcdef`
      type: apiKey
      in: header
      name: Authorization

````