Scaleway CLI (v2) Documentation

repository·main·Indexed 21 days ago

https://github.com/scaleway/scaleway-cli

A command-line tool for managing and piloting Scaleway cloud infrastructure. It features a namespace-based command structure for services including instances, Kubernetes (Kapsule), IAM, VPC, and managed databases. The CLI also includes a Model Context Protocol (MCP) server to expose commands as tools for AI assistants, and supports configuration via environment variables and a dedicated config file.

Tokens
159.9K
Snippets
842
Records
908
Agent score
72%

What's inside Scaleway CLI

  1. Manage Access Control Lists (ACL) for Managed Databases

    main
    Use the scw rdb acl command group to manage Network Access Control Lists for PostgreSQL and MySQL Managed Databases. ACL rules allow you to control incoming network traffic by defining IP addresses that are allowed, denied, or redirected.
  2. Manage Flexible IPs for Elastic Metal

    main

    The scw fip command set allows you to manage flexible public IP addresses for your Elastic Metal servers. A flexible IP can be attached to any Elastic Metal server within the same zone, and multiple flexible IPs can be attached to a single server.

    Key capabilities include:

    • Creating, deleting, and updating flexible IPs.
    • Attaching and detaching flexible IPs from servers.
    • Listing and retrieving details of existing IPs.
    • Managing virtual MAC addresses associated with these IPs.
  3. What is User Data and how to access it

    main

    User data is a key/value store used to provide instances with introspective data (e.g., SSH host fingerprints).

    There are two ways to access it:

    1. From within a running Instance: Query the Metadata API at http://169.254.42.42/user_data (or http://[fd00:42::42]/user_data via IPv6). For security, requests must originate from a port below 1024. You can use the scw-userdata helper (included in Scaleway OS images) or curl --local-port 1-1023 http://169.254.42.42/user_data.
    2. From the Instance API: Use the Scaleway CLI commands to manage keys externally.
  4. What is a Kapsule pool and how does it work?

    main

    A pool is a set of identical nodes within a Kubernetes cluster. Each pool is defined by a name, a desired number of nodes (size), node number limits (min-size and max-size), and a Scaleway Instance type (node-type).

    When autoscaling is enabled, the pool will automatically grow or shrink within the specified min-size and max-size limits based on the cluster's load. Changing these limits directly affects the pool's size.

  5. Migrate snapshots to Scaleway Block Storage (SBS)

    main

    To migrate a volume or snapshot to SBS, you must follow a two-step process:

    1. Generate a migration plan: Use scw instance snapshot plan-migration <snapshot-id> to get a migration plan and a validation_key.
    2. Apply the migration: Use scw instance snapshot apply-migration <snapshot-id> providing the validation-key returned in the first step to confirm the migration of all resources listed in the plan.
    # Step 1: Plan (returns validation_key)
    scw instance snapshot plan-migration 11111111-1111-1111-1111-111111111111
    
    # Step 2: Apply (requires validation-key from Step 1)
    scw instance snapshot apply-migration 11111111-1111-1111-1111-111111111111 validation-key=YOUR_KEY
  6. Manage Instance volumes

    main

    Volumes are block devices used to store data within an Instance. The Instance API supports l_ssd and scratch volume types. For block storage volumes, use the SBS API.

    Best Practice: When using multiple block devices, mount them using their UUID (found in /dev/disk/by-id/) instead of device names, as device names can change based on the order of volumes.

  7. Manage Database Instance advanced settings

    main

    Advanced settings allow you to tune database engine behavior.

    Important Notes:

    • Available settings depend on the specific database engine and version.
    • Init settings: Some settings can only be defined during database engine initialization and cannot be updated later.
    • Deleting a setting entry restores it to its default value.
    • Some default values are optimized specifically for the Scaleway platform and may differ from the engine's standard defaults.