feat(dns): allow setting an externally managed cluster domain (uc dns set)

* feat: add uc dns set

This allows manual setting of the cluster's domain name. I use this to
make the local cluster admin aware that this has been done.
(and then manually update the external dns)

```
% uc dns set ctrl.u.science.ru.nl
Set cluster domain: ctrl.u.science.ru.nl
Deploy the Caddy reverse proxy service ('uc caddy deploy') to enable internet access to your services via the reserved or your custom domain.

% uc dns show
ctrl.u.science.ru.nl

% uc dns set ctrl.u.science.ru.nl
Error: domain already reserved

% uc dns release
Released cluster domain: ctrl.u.science.ru.nl
```

See: #37

Signed-off-by: Miek Gieben <miek@miek.nl>

* docs

Signed-off-by: Miek Gieben <miek@miek.nl>

* check validatity

Signed-off-by: Miek Gieben <miek@miek.nl>

* No need to call out to update anything, as set doesnt use uncloud dns

Signed-off-by: Miek Gieben <miek@miek.nl>

* Ignore domain when there is no endpoint

Prevents this error, when you know what you're doing:

    Error: failed to update DNS records pointing to caddy service: create cluster domain records in Uncloud DNS: rpc error: code = Unknown desc = Post "/domains/ctrl.u.science.ru.nl/records": unsupported protocol scheme ""

Signed-off-by: Miek Gieben <miek@miek.nl>

* from main

Signed-off-by: Miek Gieben <miek@miek.nl>

* mise proto && make cli-docs

Signed-off-by: Miek Gieben <miek@miek.nl>

* Rebase and and generate protos again

Signed-off-by: Miek Gieben <miek@miek.nl>

* Rebase and fix

Signed-off-by: Miek Gieben <miek@miek.nl>

* feat(dns): allow setting an externally managed cluster domain

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
Co-authored-by: Pasha Sviderski <me@psviderski.name>
This commit is contained in:
Miek GiebenandPasha Sviderski authored and GitHub committed 2026-09-25 16:36:01 +10:00
1 parent 3482eeefab
commit 417e402c73
21 files changed
+463 -133

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ A CLI tool for managing Uncloud resources such as machines, services, and volume
* [uc caddy](uc_caddy.md) - Manage Caddy reverse proxy service.
* [uc ctx](uc_ctx.md) - Switch between different cluster contexts. Contains subcommands to manage contexts.
* [uc deploy](uc_deploy.md) - Deploy services from a Compose file.
* [uc dns](uc_dns.md) - Manage cluster domain in Uncloud DNS.
* [uc dns](uc_dns.md) - Manage the cluster domain.
* [uc exec](uc_exec.md) - Execute a command in a running service container.
* [uc image](uc_image.md) - Manage images on machines in the cluster.
* [uc images](uc_images.md) - List images on machines in the cluster.
+5 -2
View File
@@ -1,12 +1,14 @@
# uc dns
Manage cluster domain in Uncloud DNS.
Manage the cluster domain.
## Synopsis
Manage cluster domain in Uncloud DNS.
Manage the cluster domain.
DNS commands allow you to reserve or release a unique 'xxxxxx.uncld.dev' domain for your cluster. When reserved, Caddy service deployments will automatically update DNS records to route traffic to the services in the cluster.
EXPERIMENTAL: Use 'uc dns set' to configure an externally managed domain instead. Uncloud does not manage DNS records for manually set domains.
## Options
```
@@ -27,5 +29,6 @@ DNS commands allow you to reserve or release a unique 'xxxxxx.uncld.dev' domain
* [uc](uc.md) - A CLI tool for managing Uncloud resources such as machines, services, and volumes.
* [uc dns release](uc_dns_release.md) - Release the reserved cluster domain.
* [uc dns reserve](uc_dns_reserve.md) - Reserve a cluster domain in Uncloud DNS.
* [uc dns set](uc_dns_set.md) - Set or unset an externally managed cluster domain (EXPERIMENTAL).
* [uc dns show](uc_dns_show.md) - Print the cluster domain name.
@@ -23,5 +23,5 @@ uc dns release [flags]
## See also
* [uc dns](uc_dns.md) - Manage cluster domain in Uncloud DNS.
* [uc dns](uc_dns.md) - Manage the cluster domain.
@@ -24,5 +24,5 @@ uc dns reserve [flags]
## See also
* [uc dns](uc_dns.md) - Manage cluster domain in Uncloud DNS.
* [uc dns](uc_dns.md) - Manage the cluster domain.
@@ -0,0 +1,40 @@
# uc dns set
Set or unset an externally managed cluster domain (EXPERIMENTAL).
## Synopsis
EXPERIMENTAL: Set the cluster domain used to generate ingress hostnames for services.
Configure wildcard DNS records for this domain with your DNS provider. Uncloud will not create, verify, update, or delete external DNS records.
Pass an empty string to unset a manually set domain. Use 'uc dns release' to release a domain reserved in Uncloud DNS. Setting or unsetting the domain does not change existing service hostnames.
```
uc dns set DOMAIN_NAME [flags]
```
## Examples
```
uc dns set apps.example.com
uc dns set ""
```
## Options
```
-h, --help help for set
```
## Options inherited from parent commands
```
--connect string Connect to a remote cluster machine without using the Uncloud configuration file. [$UNCLOUD_CONNECT]
Format: [ssh://]user@host[:port], ssh+go://user@host[:port], tcp://host:port, or unix:///path/to/uncloud.sock
-c, --context string Name of the cluster context to use (default is the current context). [$UNCLOUD_CONTEXT]
--uncloud-config string Path to the Uncloud configuration file. [$UNCLOUD_CONFIG] (default "~/.config/uncloud/config.yaml")
```
## See also
* [uc dns](uc_dns.md) - Manage the cluster domain.
+1 -1
View File
@@ -23,5 +23,5 @@ uc dns show [flags]
## See also
* [uc dns](uc_dns.md) - Manage cluster domain in Uncloud DNS.
* [uc dns](uc_dns.md) - Manage the cluster domain.