Skip to content

Managed Kubernetes

Our Managed Kubernetes gives each workspace a managed k3s cluster. Activating it provisions control-plane infrastructure for the workspace. You then enroll instances as worker nodes, deploy containerized services, and store secrets that those services can reference. All provisioning and teardown operations are asynchronous.

Cluster

Get cluster status

GET/v1/workspaces/{wid}/k3sGet managed Kubernetes status

Returns the cluster record for the workspace, including its lifecycle status.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Returns a cluster object with the fields below.

FieldTypeDescription
idstringCluster ID
ownerobjectWorkspace summary
namestringCluster namespace identifier
statusstringLifecycle status: PROVISIONING, ACTIVE, DEPROVISIONING, or FAILED

Activate managed Kubernetes

POST/v1/workspaces/{wid}/k3sActivate managed Kubernetes

Provisions a managed k3s cluster for the workspace. This is asynchronous; poll the returned workflow or re-fetch GET /v1/workspaces/{wid}/k3s and wait for status to become ACTIVE.

Path parameters

NameTypeDescription
widintegerWorkspace ID

No request body.

bash
curl -X POST https://api.galaxygate.net/v1/workspaces/42/k3s \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN"

Returns a workflow. Poll GET /v1/workspaces/{wid}/k3s until status is ACTIVE.

Deactivate managed Kubernetes

DELETE/v1/workspaces/{wid}/k3sDeactivate managed Kubernetes

Removes all nodes, services, and secrets, then tears down the cluster. This is destructive and asynchronous.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Returns a workflow.

Worker nodes

List worker nodes

GET/v1/workspaces/{wid}/k3s/nodesList worker nodes

Lists all worker nodes enrolled in the cluster, with pagination. Each entry includes live status from the cluster when available.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Query parameters

NameTypeDescription
idinteger[]Filter to specific node IDs
statusstringFilter by node status (JOINING, READY, DRAINING, FAILED)
instanceinteger[]Filter by instance IDs

Plus the shared pagination parameters. Returns a paged list of node objects.

Add a worker node

POST/v1/workspaces/{wid}/k3s/nodesAdd a worker node

Enrolls an instance as a worker node. The instance must be running and belong to the same workspace. This is asynchronous.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Request body

FieldTypeRequiredDescription
instance_idintegeryesInstance ID to enroll as a worker node
bash
curl -X POST https://api.galaxygate.net/v1/workspaces/42/k3s/nodes \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "instance_id": 101 }'

Returns a workflow. Poll GET /v1/workspaces/{wid}/k3s/nodes/{id} until node.status is READY.

Get a worker node

GET/v1/workspaces/{wid}/k3s/nodes/{id}Get node details

Returns one node record plus live status from the cluster.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerNode ID

Returns an object with a node field and a live field (null when the control plane is unreachable).

FieldTypeDescription
node.idstringNode ID
node.workspaceobjectWorkspace summary
node.instanceobjectInstance summary
node.node_namestringNode name inside the cluster
node.statusstringJOINING, READY, DRAINING, or FAILED
live.readybooleanWhether the node is ready in the cluster
live.conditionsobjectNode condition map, for example { "MemoryPressure": "False" }
live.allocatableobjectAllocatable resource map, for example { "cpu": "4", "memory": "8Gi", "pods": "110" }

Remove a worker node

DELETE/v1/workspaces/{wid}/k3s/nodes/{id}Remove a worker node

Drains the node and removes it from the cluster. Running pods are rescheduled if resources allow. This is asynchronous.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerNode ID

Returns a workflow.

Look up the node for an instance

GET/v1/instances/{iid}/k3sLook up node by instance

Returns the worker node record associated with a specific instance. Useful when you know the instance ID but not the node ID.

Path parameters

NameTypeDescription
iidintegerInstance ID

Returns the same node object (with live status) as Get a worker node.

Services

List services

GET/v1/workspaces/{wid}/k3s/servicesList services

Lists all deployed services in the cluster, with pagination. Each entry includes live status when available.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Query parameters

NameTypeDescription
qstringQuick search by name or ID
idinteger[]Filter to specific service IDs
namestringFilter by name (partial match)
modestringFilter by deployment mode (PINNED or SPREAD)
statusstringFilter by service status

Plus the shared pagination parameters. Returns a paged list of service objects.

Create a service

POST/v1/workspaces/{wid}/k3s/servicesCreate a service

Deploys a new containerized service onto the cluster. This is asynchronous.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Request body

FieldTypeRequiredDescription
namestringyesService name, unique within the workspace
imagestringyesDocker image URL including tag, for example nginx:1.27
modestringyesPINNED schedules pods only on target_instances; SPREAD schedules across all nodes up to replicas
target_instancesinteger[]yesInstance IDs the scheduler is allowed to use
replicasintegerNumber of replicas; only meaningful for SPREAD mode (default 1)
portsobject[]Port mappings; each entry has host_port, container_port, protocol (TCP or UDP), and http (boolean marking ports eligible for a custom subdomain)
volumesobject[]Volume mounts; each entry has host_path and container_path
environmentobjectEnvironment variables as a flat key-value map
secret_refsstring[]Names of secrets whose key-value pairs are injected as environment variables
update_strategystringROLLING (default) or START_FIRST
bash
curl -X POST https://api.galaxygate.net/v1/workspaces/42/k3s/services \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "web",
    "image": "nginx:1.27",
    "mode": "SPREAD",
    "target_instances": [101, 102],
    "replicas": 2,
    "ports": [
      { "host_port": 8080, "container_port": 80, "protocol": "TCP", "http": true }
    ],
    "update_strategy": "ROLLING"
  }'

Returns a workflow. Poll GET /v1/workspaces/{wid}/k3s/services/{id} until service.status is RUNNING.

Get a service

GET/v1/workspaces/{wid}/k3s/services/{id}Get service details

Returns the full service configuration and live replica status.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerService ID

Returns an object with a service field (full configuration) and a live field (null when unavailable).

FieldTypeDescription
service.idstringService ID
service.namestringService name
service.imagestringDocker image URL including tag
service.modestringPINNED or SPREAD
service.target_instancesobject[]Target instance summaries
service.replicasintegerReplica count
service.portsobject[]Port mappings
service.volumesobject[]Volume mounts
service.secret_refsstring[]Referenced secret names
service.update_strategystringROLLING or START_FIRST
service.statusstringDEPLOYING, RUNNING, UPDATING, DELETING, FAILED, or STOPPED
live.desired_replicasintegerHow many replicas are requested
live.available_replicasintegerReplicas that are ready
live.unavailable_replicasintegerReplicas that are not ready
live.updated_replicasintegerReplicas on the current revision
live.updatingbooleanWhether a rollout is in progress
live.podsobject[]Per-pod status: name, phase, restart_count, ready, node_name

Update a service

PUT/v1/workspaces/{wid}/k3s/services/{id}Update a service

Replaces the service configuration and triggers a redeployment. All fields except name and mode can be changed. Send the full desired state; omitted optional fields are cleared.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerService ID

Request body

FieldTypeRequiredDescription
imagestringyesDocker image URL including tag
target_instancesinteger[]yesInstance IDs the scheduler is allowed to use
replicasintegerReplica count (SPREAD mode only)
portsobject[]Port mappings
volumesobject[]Volume mounts
environmentobjectEnvironment variables as a flat key-value map
secret_refsstring[]Secret names to inject
update_strategystringROLLING or START_FIRST

Returns a workflow.

Delete a service

DELETE/v1/workspaces/{wid}/k3s/services/{id}Delete a service

Removes the service from the cluster and deletes its record. This is asynchronous.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerService ID

Returns a workflow.

Get service logs

GET/v1/workspaces/{wid}/k3s/services/{id}/logsGet service logs

Fetches container logs. Returns plain text. To stream logs in real time, add ?follow to the URL; the server responds with text/event-stream (SSE) instead.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerService ID

Query parameters

NameTypeDescription
tailintegerNumber of lines to return from the end of the log (default 100)
since_secondsintegerReturn only log lines newer than this Unix timestamp in seconds
pod_indexintegerFor SPREAD services with multiple replicas, select which pod by zero-based index (default 0)
follow(flag)When present, switches the response to an SSE stream (text/event-stream)

Returns text/plain log content, or an SSE stream when follow is present.

Redeploy a service

POST/v1/workspaces/{wid}/k3s/services/{id}/redeployRedeploy a service

Force-restarts the service using its current configuration. Useful for picking up an updated image at the same tag.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerService ID

No request body. Returns a workflow.

Rollback a service

POST/v1/workspaces/{wid}/k3s/services/{id}/rollbackRollback a service

Reverts the service to the previous revision.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerService ID

No request body. Returns a workflow.

Secrets

Secrets store sensitive key-value pairs. The API never returns secret values; only the name and key names are included in responses. Once a secret is referenced by a service (secret_refs), deleting it is blocked until the reference is removed.

List secrets

GET/v1/workspaces/{wid}/k3s/secretsList secrets

Lists all secrets in the workspace, returning names and key names only. Values are never returned.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Plus the shared pagination parameters. Returns a paged list of secret objects.

FieldTypeDescription
idstringSecret ID
namestringSecret name
keysstring[]Key names stored in this secret (values omitted)

Create a secret

POST/v1/workspaces/{wid}/k3s/secretsCreate a secret

Creates a secret with one or more key-value pairs. Each pair is injected as an environment variable into services that list this secret in secret_refs.

Path parameters

NameTypeDescription
widintegerWorkspace ID

Request body

FieldTypeRequiredDescription
namestringyesSecret name, unique within the workspace
dataobjectyesKey-value pairs to store, for example { "DB_PASSWORD": "s3cr3t" }
bash
curl -X POST https://api.galaxygate.net/v1/workspaces/42/k3s/secrets \
  -H "Authorization: Bearer $GALAXYGATE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "db-credentials",
    "data": {
      "DB_USER": "app",
      "DB_PASSWORD": "s3cr3t"
    }
  }'

Returns the secret object (name and keys only; values are not echoed back).

Update a secret

PUT/v1/workspaces/{wid}/k3s/secrets/{id}Update a secret

Replaces all key-value pairs in the secret. This is a full replacement: any keys not present in data are removed.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerSecret ID

Request body

FieldTypeRequiredDescription
dataobjectyesNew key-value pairs; replaces all existing pairs

Returns the updated secret object (name and keys only).

Delete a secret

DELETE/v1/workspaces/{wid}/k3s/secrets/{id}Delete a secret

Deletes the secret. Returns 409 Conflict if any service still references this secret in its secret_refs.

Path parameters

NameTypeDescription
widintegerWorkspace ID
idintegerSecret ID

Returns 204 No Content.