Skip to content

feat: added vnet dns name generation as db custom label#65676

Draft
nibrasohin wants to merge 1 commit intomasterfrom
ohin/add-db-vnet-custom-label
Draft

feat: added vnet dns name generation as db custom label#65676
nibrasohin wants to merge 1 commit intomasterfrom
ohin/add-db-vnet-custom-label

Conversation

@nibrasohin
Copy link
Copy Markdown
Contributor

@nibrasohin nibrasohin commented Apr 10, 2026

Changes

  • Adds a new internal label teleport.internal/vnet-dns-name that is automatically set on every database resource during CheckAndSetDefaults
  • The label value is a deterministic, DNS-safe hash of the database name in the format db-{base32hex(sha256(name)[:8])}, will be used by VNet in future PRs to resolve database FQDNs

Manual Test Plan

Test Environment

  • Ensure you have at least one database registered with your local Teleport cluster
  • Build tsh from this branch: make build/tsh

Test Cases

  • Run tsh db ls -v --format=json and verify every database has the label teleport.internal/vnet-dns-name with a value matching the format db-<13 char base32hex hash> (e.g., db-k0i03gnmb0tng)
  • Verify the label is deterministic: restart the database service and run tsh db ls -v --format=json again — the vnet-dns-name value for each database should be unchanged
  • Verify uniqueness: confirm that no two databases with different names share the same vnet-dns-name value
  • Verify existing labels are preserved: any database that already had user-defined labels (e.g., env=dev) should still have those labels alongside the new vnet-dns-name label

Changelog: Added vnet dns name as database custom label to be used for db access support via vnet

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