Skip to content

add support for service.labels and deploy.labels#245

Open
nick-potts wants to merge 2 commits into
psviderski:mainfrom
nick-potts:feat/labels
Open

add support for service.labels and deploy.labels#245
nick-potts wants to merge 2 commits into
psviderski:mainfrom
nick-potts:feat/labels

Conversation

@nick-potts

Copy link
Copy Markdown
Contributor

Two label types with different update semantics:

  • Labels (from service.labels) — applied to Docker containers. Changes require container recreation.
  • DeployLabels (from deploy.labels) — stored in service spec only. Can be updated without touching containers.

User labels cannot override uncloud.* prefixed labels.

CLI

  • uc run --label key=value — set container labels
  • uc service inspect — displays both label types

@nick-potts

nick-potts commented Jan 20, 2026

Copy link
Copy Markdown
Contributor Author

I believe deploy labels like this is a good choice and somewhat mirrors swarm. You can then use something like deployment_id under a deploy label, and it won't require re-creating a stateful resource like postgres.

Annoyingly in Swarm, deploy.labels are "service labels" (metadata on the service itself), while service.labels are actually "container labels" (applied to containers) and is quite confusing. Maybe its worth considering whether the ServiceSpec field names could be more explicit - e.g., ContainerLabels vs ServiceLabels to avoid the same confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant