cloider target command reference
cloider target routes traffic on your domains to where it should go. A target maps a path on a domain, such as example.com/ or example.com/api, to one of your apps, to a Service in one of your Kubernetes clusters, or to a bucket's static website. Cloider serves the domain over HTTPS and forwards each request to the matching target.
cloider target <command> [flags]
Alias: cloider targets. Targets are named by their id, which cloider target list <domain> -o wide shows.
Subcommands
| Command | Description |
|---|---|
cloider target list | List a domain's targets |
cloider target create | Route a path of a domain to an app, a bucket website or a cluster service, or a domain to a LoadBalancer |
cloider target update | Change a target, keeping what isn't given |
cloider target delete | Delete a target |
All subcommands also take the global flags.
Target flags
create and update take the same flags:
| Flag | Type | Default | Description |
|---|---|---|---|
--app | string | Route to this app (name or id) | |
--bucket | string | Serve this bucket's website (name or id), at the domain's root. The bucket's website must be on, and --path must be / | |
--cluster | string | Route to a service in this cluster (name or id). --app, --bucket and --cluster can't be combined | |
--service | string | The cluster service, as <namespace>/<service>, for example default/web | |
--loadbalancer | string | With --cluster, point the whole custom domain at this LoadBalancer's IP with an A record, as <namespace>/<service>. Can't be combined with --service, --port, --protocol, --app or --bucket, and --path must be /. See Point a domain at a LoadBalancer | |
--port | int | the service's only port | The service port. Required when the service has several |
--protocol | string | the port's own | TCP or UDP |
--path | string | / | Path on the domain to route |
--target-path | string | --path | Path the request reaches the target with |
The services you can route to are listed by cloider cluster services.
cloider target list
List a domain's targets.
cloider target list <domain> [flags]
Alias: cloider target ls.
cloider target list example.com -o wide
ID ROUTE TARGET TARGET PATH PROTOCOL
t4k9x example.com/ app web / -
m2p8q example.com/api production/shop/api:8080 / TCP
ROUTE is the domain and path; TARGET is app <name>, website of bucket <name>, <cluster>/<namespace>/<service>:<port> or lb <cluster>/<namespace>/<service> (<ip>); TARGET PATH is the path the request arrives at the target with. Without -o wide, the ID column is hidden; -q prints ids. cloider domain get shows the same table. The MCP server has no separate list tool; agents read targets from get_domain.
cloider target create
Route a path of a domain to an app, a bucket website or a cluster service, or a domain to a LoadBalancer.
cloider target create <domain> [flags]
Route a free subdomain to an app:
cloider target create blog.cloider.app --app blog
✓ Routed blog.cloider.app/ to the app
Serve a bucket's static website on a domain:
cloider target create docs.example.com --bucket acme-site
✓ Routed docs.example.com/ to the bucket's website
Route /api on a custom domain to a Service in a cluster, stripping the prefix:
cloider target create example.com --cluster production --service shop/api --port 8080 --path /api --target-path /
✓ Routed example.com/api to production/shop/api:8080
Point a custom domain at a LoadBalancer Service, for any port and protocol. The domain can have no other targets, and Cloider issues no certificate for it: you manage the ingress controller or Gateway API, routes and TLS behind the LoadBalancer, see Point a domain at a LoadBalancer:
cloider target create play.example.com --cluster production --loadbalancer games/server
✓ Routed play.example.com/ to LoadBalancer games/server
The CLI checks the cluster's services first: an unknown service fails with exit code 4 (no service shop/api in cluster production, see `cloider cluster services` ), and a service with several ports needs --port (shop/api has several ports (8080/TCP, 9090/TCP), pick one with --port). Without --app, --bucket or --cluster it fails with say where to route to with --app, --bucket or --cluster. See Targets and Expose services. MCP tool: create_domain_target.
cloider target update
Change a target's path, target path or destination. What you don't pass is kept. If the path and target path were the same, changing --path changes both.
cloider target update <domain> <target-id> [flags]
cloider target update example.com m2p8q --path /v2
cloider target update example.com t4k9x --app blog
cloider target update example.com t4k9x --bucket acme-site
cloider target update example.com m2p8q --port 9090
✓ Updated example.com/v2 to production/shop/api:8080
To move an app target to a cluster service, give --cluster and --service; --service, --port or --protocol alone on an app target fail with this target routes to an app, give --cluster to route it to a service instead, on a bucket target with this target serves a bucket website, give --cluster to route it to a service instead, and on a LoadBalancer target with this target points at a LoadBalancer, give --cluster to route it to a service instead. --loadbalancer without --cluster uses the cluster a cluster or LoadBalancer target already routes to; a target at a path other than / needs --path / with it. --bucket moves a target to a bucket's website, which works only for a target whose path is /. MCP tool: update_domain_target.
cloider target delete
Delete a target. Its route stops answering.
cloider target delete <target-id> [flags]
Alias: cloider target rm. Unlike update, delete takes only the target's id. It asks Delete target ...? Its route stops answering. [y/N]; pass --yes to skip it.
cloider target delete m2p8q --yes
✓ Deleted target m2p8q
MCP tool: delete_domain_target.
Related
Frequently asked questions
How do I point a domain at my app?
Run cloider target create example.com --app web. The whole domain (path /) then routes to the app over HTTPS.
How do I route a domain to a Kubernetes service?
List the services with cloider cluster services, then run cloider target create example.com --cluster production --service default/web --port 80.
How do I serve a bucket's static website on my domain?
Turn the website on with cloider bucket website acme-site on, then run cloider target create example.com --bucket acme-site. A bucket target takes the whole domain, at the path /.
Can different paths of one domain go to different apps?
Yes. Create one target per path, for example --path / to the web app and --path /api to the api app or a cluster service. --target-path sets the path the request arrives with.