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

# Scale Node Pool

> Set the pool's node count (2–20). Scale-up deploys new nodes; scale-down cordons and drains the newest nodes first — honouring PodDisruptionBudgets, never force-deleting — then removes their VMs. Both run asynchronously; watch the pool's `status` and `status_message`.

Scale-down credits the remainder on every cluster. Scale-up on a pay-as-you-go cluster accrues hourly; on a subscription cluster the API charges the pro-rated difference to the saved payment method (balance first) and raises the monthly price, while the dashboard routes it through checkout.


<sub>Updated August 24, 2026</sub>

<Note>
  Scaling runs asynchronously. Scale-down drains the newest nodes first, honouring PodDisruptionBudgets — a node that cannot be emptied within 10 minutes stops the operation with the reason in the pool's `status_message`. Scale-up on subscription-billed clusters goes through the dashboard checkout (`409` here).
</Note>


## OpenAPI

````yaml POST /api/v1/k8s/clusters/{cluster_id}/pools/{pool_id}/scale
openapi: 3.0.3
info:
  title: Raff API
  description: >
    REST API for managing cloud infrastructure on Raff.


    ## Authentication

    Most endpoints require authentication via API key. Catalog endpoints under
    `/api/v1/public/` are open and require no authentication.


    ### API Key Authentication

    Include your API key in the `X-API-Key` header:
      ```
      curl -H "X-API-Key: YOUR_API_KEY" https://api.rafftechnologies.com/api/v1/vms
      ```

    ## Catalog

    Use the public catalog endpoints to discover available regions, OS
    templates, and pricing plans before creating resources:

    - `GET /api/v1/public/regions` — list available regions

    - `GET /api/v1/public/templates` — list OS templates (use the `id` as
    `template_id` when creating a VM)

    - `GET /api/v1/public/pricing/vm` — list VM pricing plans (use the `id` as
    `pricing_id` when creating a VM)

    - `GET /api/v1/public/pricing/volume` — volume storage pricing

    - `GET /api/v1/public/pricing/snapshot` — snapshot storage pricing

    - `GET /api/v1/public/pricing/backup` — backup storage pricing

    - `GET /api/v1/public/pricing/ip` — IP address pricing

    - `GET /api/v1/public/pricing/database` — managed database pricing (plans,
    high availability, read replicas, extra storage)

    - `GET /api/v1/public/pricing/kubernetes` — managed Kubernetes pricing
    (worker node plans, HA control plane, storage nodes)
  version: 1.0.0
  contact:
    name: Raff Technologies
    url: https://rafftechnologies.com
servers:
  - url: https://api.rafftechnologies.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Catalog
    description: >-
      Discover available regions, OS templates, and pricing plans. No
      authentication required.
  - name: Health
    description: Health check endpoints
  - name: Projects
    description: Organize resources into projects for billing and access control
  - name: Virtual Machines
  - name: Kubernetes
    description: >-
      Managed Kubernetes clusters — HA control planes, autoscaling node pools,
      kubeconfig access
  - name: Functions
    description: Deploy and manage serverless functions
  - name: Raff Apps
    description: >-
      Push-to-deploy web services, private services, workers, cron jobs, and
      one-off jobs on the Raff PaaS — with custom domains, environment
      variables, autoscaling, and per-second billing with spend caps
  - name: Managed Databases
    description: >-
      Fully managed PostgreSQL and Valkey databases with private VPC networking,
      automatic backups, and metrics
  - name: Networking
    description: >-
      Attach and detach VPCs, floating IPs, and security groups to VM network
      interfaces
  - name: Snapshots
    description: Point-in-time copies of VMs and volumes for quick rollback or cloning
  - name: Backups
    description: Scheduled and on-demand VM backups with restore capability
  - name: Backup Schedules
    description: Recurring daily or weekly backup schedules attached to a VM
  - name: SSH Keys
    description: Manage account-level SSH keys for VM provisioning
  - name: Members
    description: Account-level members — invite, list, update role, remove
  - name: Project Members
    description: Members of a specific project — same model as Members but project-scoped
  - name: Roles
    description: Custom roles bundling account or project permissions
  - name: Permissions
    description: List the catalog of permission strings used by roles
  - name: API Keys
    description: Create and manage API keys for programmatic access
  - name: Invitations
    description: Create and cancel email-based invitations to join the account or a project
paths:
  /api/v1/k8s/clusters/{cluster_id}/pools/{pool_id}/scale:
    post:
      tags:
        - Kubernetes
      summary: Scale node pool
      description: >
        Set the pool's node count (2–20). Scale-up deploys new nodes; scale-down
        cordons and drains the newest nodes first — honouring
        PodDisruptionBudgets, never force-deleting — then removes their VMs.
        Both run asynchronously; watch the pool's `status` and `status_message`.


        Scale-down credits the remainder on every cluster. Scale-up on a
        pay-as-you-go cluster accrues hourly; on a subscription cluster the API
        charges the pro-rated difference to the saved payment method (balance
        first) and raises the monthly price, while the dashboard routes it
        through checkout.
      operationId: scaleK8sNodePool
      parameters:
        - $ref: '#/components/parameters/K8sClusterIDPath'
        - $ref: '#/components/parameters/K8sPoolIDPath'
        - $ref: '#/components/parameters/ProjectIDHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - node_count
              properties:
                node_count:
                  type: integer
                  minimum: 2
                  maximum: 20
                  example: 3
      responses:
        '200':
          description: Scaling started
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  new_node_count:
                    type: integer
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            Pool busy (already scaling), or subscription-billed scale-up (use
            the dashboard)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    K8sClusterIDPath:
      name: cluster_id
      in: path
      required: true
      description: Cluster ID (short id, e.g. `q7z7zg`)
      schema:
        type: string
    K8sPoolIDPath:
      name: pool_id
      in: path
      required: true
      description: Node pool ID
      schema:
        type: string
        format: uuid
    ProjectIDHeader:
      name: X-Project-ID
      in: header
      required: true
      description: >-
        Project ID. Required for all mutating operations (create, delete, power
        actions, resize).
      schema:
        type: string
        format: uuid
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication. Each key is bound to a specific account.

````