{"id":50782888,"url":"https://github.com/mitja/hcloud-gardener-dnsrecord","last_synced_at":"2026-06-12T05:02:11.385Z","repository":{"id":364173298,"uuid":"1266742779","full_name":"mitja/hcloud-gardener-dnsrecord","owner":"mitja","description":"Gardener DNSRecord extension for the Hetzner Cloud DNS API (provider type hcloud-dns)","archived":false,"fork":false,"pushed_at":"2026-06-12T00:08:59.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-12T01:10:16.204Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-11T23:06:00.000Z","updated_at":"2026-06-12T00:09:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mitja/hcloud-gardener-dnsrecord","commit_stats":null,"previous_names":["mitja/hcloud-gardener-dnsrecord"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mitja/hcloud-gardener-dnsrecord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitja%2Fhcloud-gardener-dnsrecord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitja%2Fhcloud-gardener-dnsrecord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitja%2Fhcloud-gardener-dnsrecord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitja%2Fhcloud-gardener-dnsrecord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitja","download_url":"https://codeload.github.com/mitja/hcloud-gardener-dnsrecord/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitja%2Fhcloud-gardener-dnsrecord/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34229624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-12T05:02:10.683Z","updated_at":"2026-06-12T05:02:11.378Z","avatar_url":"https://github.com/mitja.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gardener-extension-dnsrecord-hcloud\n\nA [Gardener](https://gardener.cloud) extension that implements the **DNSRecord**\ncontract for provider type **`hcloud-dns`**, backed by the project-scoped\n[Hetzner Cloud DNS API](https://docs.hetzner.cloud/) (`https://api.hetzner.cloud/v1`).\n\nGardener ships no DNS provider for Hetzner, yet shoot reconciliation hard-requires\na working DNSRecord controller for the internal domain. Hetzner moved DNS into the\n**Cloud** API (project-scoped zones and rrsets), so a single `HCLOUD_TOKEN` now\ncovers both servers *and* DNS. This extension closes that gap.\n\n## What it does\n\n- Watches `DNSRecord` resources of `spec.type: hcloud-dns`.\n- **Reconcile**: idempotent upsert of an rrset (create, or replace records + TTL\n  if it already exists). Sets `status.zone` to the resolved zone name.\n- **Delete**: deletes the rrset, treating a `404` as success.\n- **ForceDelete** = Delete. **Restore** = Reconcile. **Migrate** = no-op.\n- Record types: **A, AAAA, CNAME, TXT**. TTL from `spec.ttl` (default 120; the\n  Hetzner API minimum is 60).\n- **Zone resolution**: if `spec.zone` is set it is used; otherwise the zone is\n  found by **longest-suffix match** of `spec.name` (an FQDN) against the\n  project's zones. The rrset name is computed relative to the zone (apex → `@`).\n- **Value normalization**: CNAME targets are made fully qualified (trailing dot);\n  TXT values are double-quoted (and inner quotes escaped) unless already quoted.\n\n## Authentication\n\nThe API token is read from the `Secret` referenced by the DNSRecord's\n`spec.secretRef`, key **`hcloudToken`** (the same key the\n[provider-hcloud](https://github.com/23technologies/gardener-extension-provider-hcloud)\nextension uses, so one secret serves both). Key `token` is accepted as a fallback.\n\n## Provider type\n\n```\nhcloud-dns\n```\n\nThe bundled `ControllerRegistration` claims `kind: DNSRecord, type: hcloud-dns`.\n\n## How the landscape wires it (M2)\n\nThis extension is the missing piece for fully-managed shoot DNS on Hetzner:\n\n1. Apply `example/controller-registration.yaml` to the **virtual garden** to\n   register `ControllerDeployment` + `ControllerRegistration` (`dnsrecord-hcloud`).\n   Gardener installs the extension on every seed (`DNSRecord` is a `primary`,\n   seed-local resource).\n2. Create the `garden`-namespace domain secrets in the virtual garden:\n   - `internal-domain` (`gardener.cloud/role=internal-domain`, provider type\n     `hcloud-dns`, domain `internal.g.paasbox.com`, with the `hcloudToken` data key),\n   - `default-domain` (`shoots.g.paasbox.com`).\n3. Gardenlet `seedConfig.spec.dns.provider`: type `hcloud-dns` + the token secret.\n4. Shoot manifests: drop any `unmanaged` DNS provider block — the default domain\n   takes over.\n\n## Build \u0026 test\n\n```sh\ngo build ./...\ngo vet ./...\ngo test ./...\n\n# regenerate the controller-registration after a chart change\n./hack/generate-controller-registration.sh \\\n  charts/gardener-extension-dnsrecord-hcloud \\\n  example/controller-registration.yaml \\\n  v0.1.0\n```\n\nContainer image (multi-stage, distroless/static, linux/amd64):\n\n```sh\ndocker build --build-arg VERSION=v0.1.0 \\\n  -t ghcr.io/mitja/hcloud-gardener-dnsrecord:v0.1.0 .\n```\n\nReleases are cut by pushing a `v*` tag; the GitHub Actions workflow\n(`.github/workflows/release.yml`) builds and pushes the image to `ghcr.io` and\nattaches the regenerated `controller-registration.yaml` to the GitHub release.\n\n## Binary flags\n\nThe binary `gardener-extension-dnsrecord-hcloud` mirrors the standard Gardener\nextension cmd structure (controller-runtime manager, leader election, heartbeat):\n\n| Flag | Default | Purpose |\n|---|---|---|\n| `--kubeconfig` | (in-cluster) | path to a kubeconfig (only out-of-cluster) |\n| `--max-concurrent-reconciles` | `5` | DNSRecord controller concurrency |\n| `--ignore-operation-annotation` | `false` | reconcile without the operation annotation |\n| `--leader-election` | `true` | enable leader election |\n| `--leader-election-id` | `gardener-extension-dnsrecord-hcloud-leader-election` | lease name |\n| `--leader-election-namespace` | `kube-system` | lease namespace |\n| `--heartbeat-namespace` | (none) | namespace for the heartbeat lease (set to the deployment namespace) |\n| `--heartbeat-renew-interval-seconds` | `30` | heartbeat renew interval |\n| `--health-bind-address` | `:8081` | health/readiness probe address |\n| `--metrics-bind-address` | `:8080` | Prometheus metrics address |\n| `--controllers` / `--disable-controllers` | all | enable/disable `dnsrecord`,`heartbeat` |\n\nThe Helm chart sets `--heartbeat-namespace`, `--leader-election-*` and the\nconcurrency/log flags from `values.yaml`.\n\n## Version pinning rule\n\nThe `github.com/gardener/gardener` dependency is pinned **in lockstep with the\nlandscape** (currently **v1.122.3**, dictated by\n`23technologies/gardener-extension-provider-hcloud v0.6.42`). The extensions\nlibrary API must match the running Gardener version; do **not** bump this\ndependency independently of the landscape.\n\n## Layout\n\n```\ncmd/gardener-extension-dnsrecord-hcloud/   extension binary (app + main)\npkg/hcloud/                                Hetzner Cloud DNS client, zone/name/value logic\npkg/dnsrecord/                             DNSRecord Actuator + controller wiring\ncharts/gardener-extension-dnsrecord-hcloud Helm chart (deployment, RBAC, SA, VPA)\nhack/generate-controller-registration.sh   ControllerDeployment+Registration generator\nexample/controller-registration.yaml       generated registration (image v0.1.0)\nDockerfile                                  multi-stage distroless/static build\n.github/workflows/release.yml              tag-triggered image + release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitja%2Fhcloud-gardener-dnsrecord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitja%2Fhcloud-gardener-dnsrecord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitja%2Fhcloud-gardener-dnsrecord/lists"}