service (legacy)
1ctl service manages the Kubernetes Services that sit in front of your pods. A Service gives a deployment a stable internal address: as pods restart and their IPs change, the Service IP stays constant. Other workloads inside the cluster reach your app through this address without ever needing to track individual pod IPs.
pods (ephemeral IPs) → K8s Service (stable ClusterIP) → public route → public traffic1ctl deploy creates a Service automatically. Use these commands when you need direct control — for example, to expose multiple ports, replace a broken Service, or wire up a manually managed deployment.
Commands
Section titled “Commands”1ctl service list
Section titled “1ctl service list”1ctl service listLists all Services associated with the current organisation. The output shows each Service’s name, namespace, target deployment, and the port it exposes.
Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--output | -o | table | Output format: table or json. |
Under the hood:
GET /v1/cli/services— the API returns all Service records scoped to the authenticated org- Results are read from the
servicestable and sorted by creation time (newest last)
Examples
# List all services in the active org1ctl service list
# Output as JSON for scripting1ctl service list -o json1ctl service upsert
Section titled “1ctl service upsert”1ctl service upsert --deployment-id <id> --name <name> --port <port> [--namespace <ns>]Creates a new Kubernetes ClusterIP Service for a deployment, or updates it if one with the same name already exists in the target namespace. This is idempotent — running it twice with the same arguments is safe.
Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--deployment-id <id> | required | ID of the deployment the Service should select pods for. | |
--name <name> | required | Name of the Service. Also becomes the DNS label: <name>.<namespace>.svc.cluster.local. | |
--port <port> | required | Port number the Service exposes. Must match the container port your app listens on. | |
--namespace <ns> | org namespace | Kubernetes namespace to create the Service in. Defaults to your organisation’s namespace. |
Under the hood:
POST /v1/cli/services/upsertwith the provided parameters- The API looks up the deployment to retrieve its app label
- A ClusterIP Service is created (or patched) in Kubernetes via client-go — the selector targets pods carrying that app label
- The Service record is written to the
servicestable with its cluster-assigned ClusterIP
Examples
# Create a service named "api" on port 80801ctl service upsert \ --deployment-id dep_01abc \ --name api \ --port 8080
# Same, but target a specific namespace1ctl service upsert \ --deployment-id dep_01abc \ --name api \ --port 8080 \ --namespace productionOnce created, your Service is reachable inside the cluster at:
api.production.svc.cluster.local:80801ctl service delete
Section titled “1ctl service delete”1ctl service delete --service-id <id> [-y]Deletes a Service. The Kubernetes resource is removed immediately, which means any public routes pointing to it will stop routing traffic. If 1ctl deploy originally created the Service, deleting it manually may cause your deployment to become unreachable until you recreate it.
Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--service-id <id> | required | ID of the Service to delete. Use 1ctl service list to look up IDs. | |
--yes | -y | false | Skip the confirmation prompt. |
Under the hood:
DELETE /v1/cli/services/{serviceID}- The API calls client-go to delete the K8s Service resource from the cluster
- The row is removed from the
servicestable
Examples
# Delete with confirmation prompt1ctl service delete --service-id svc_04xyz
# Delete without prompting — useful in scripts1ctl service delete --service-id svc_04xyz -y