Skip to content

Commit 638bb64

Browse files
authored
feat(route53): adoption-only private hosted zones via ZoneClass zoneType (#13)
ZoneClass parameters gain zoneType (Public default, Private). Private is adoption-only: creation policy is forced to Deny, deletion policy to Retain, and dns-api never creates, deletes, or VPC-associates private hosted zones. Adoption verifies the observed zone type matches the class; status.provider.data exposes the observed zoneType. Provider schema, chart, sample, docs, UI form and detail view, and an env-gated kest lifecycle follow the same contract.
1 parent cd98668 commit 638bb64

22 files changed

Lines changed: 1144 additions & 44 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ It is useful when platform teams want to give application teams a safe DNS workf
66

77
dns-api is currently focused on:
88

9-
- Amazon Route 53 public hosted zones
9+
- Amazon Route 53 public hosted zones, and adoption of existing private hosted zones
1010
- Cloudflare full zones
1111
- `A`, `AAAA`, `TXT`, `CNAME`, `MX`, `CAA`, and delegated `NS` records
1212
- Route 53 `ALIAS` records

‎app/operator/config/provider/route53_extensions.yaml‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
display:
77
name: Amazon Route 53
8-
description: Public DNS zones and record sets managed through Route 53.
8+
description: Public and adopted private DNS zones and record sets managed through Route 53.
99
logo:
1010
url: https://cdn.jsdelivr.net/gh/glincker/thesvg@main/public/icons/aws-amazon-route-53/default.svg
1111
versions:
@@ -25,15 +25,21 @@ spec:
2525
type: object
2626
additionalProperties: false
2727
properties:
28+
zoneType:
29+
type: string
30+
description: Route 53 hosted zone type. Defaults to Public. Private is adoption-only and requires zoneCreationPolicy Deny and zoneDeletionPolicy Retain; dns-api never creates, deletes, or manages VPC associations for private hosted zones.
31+
enum:
32+
- Public
33+
- Private
2834
zoneCreationPolicy:
2935
type: string
30-
description: Controls whether dns-api may create a Route 53 public hosted zone when a Zone does not adopt an existing hosted zone.
36+
description: Controls whether dns-api may create a Route 53 public hosted zone when a Zone does not adopt an existing hosted zone. Defaults to Create for Public and Deny for Private.
3137
enum:
3238
- Create
3339
- Deny
3440
zoneDeletionPolicy:
3541
type: string
36-
description: Controls whether dns-api deletes the Route 53 hosted zone when the Kubernetes Zone is deleted.
42+
description: Controls whether dns-api deletes the Route 53 hosted zone when the Kubernetes Zone is deleted. Private requires Retain.
3743
enum:
3844
- Delete
3945
- Retain
@@ -60,7 +66,7 @@ spec:
6066
properties:
6167
hostedZoneId:
6268
type: string
63-
description: Route 53 public hosted zone ID of the existing hosted zone to adopt.
69+
description: Route 53 hosted zone ID of the existing hosted zone to adopt. The zone must be public or private as declared by the ZoneClass zoneType.
6470
pattern: '^Z[A-Z0-9]+$'
6571
statusProviderData:
6672
openAPIV3Schema:
@@ -71,6 +77,12 @@ spec:
7177
type: string
7278
description: Route 53 hosted zone ID managed for this Zone.
7379
pattern: '^Z[A-Z0-9]+$'
80+
zoneType:
81+
type: string
82+
description: Observed Route 53 hosted zone type.
83+
enum:
84+
- Public
85+
- Private
7486
recordSet:
7587
supportedTypes:
7688
- A
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Install the Route 53 Provider and create the tenant namespaces first.
2+
# Label tenant-a-app with appthrust.io/tenant: tenant-a.
3+
# Use an existing private hosted zone named internal.example.com with its VPC
4+
# associations already configured, and replace hostedZoneId with that zone's ID.
5+
apiVersion: route53.dns.appthrust.io/v1alpha1
6+
kind: Route53Identity
7+
metadata:
8+
namespace: tenant-a-platform
9+
name: route53-dev
10+
spec:
11+
accountID: "123456789012"
12+
region: ap-northeast-1
13+
credentials:
14+
runtime: {}
15+
---
16+
apiVersion: dns.appthrust.io/v1alpha1
17+
kind: ZoneClass
18+
metadata:
19+
namespace: tenant-a-platform
20+
name: route53-private
21+
spec:
22+
allowedZones:
23+
namespaces:
24+
from: Selector
25+
selector:
26+
matchLabels:
27+
appthrust.io/tenant: tenant-a
28+
provider:
29+
name: route53.dns.appthrust.io
30+
version: v1alpha1
31+
controllerName: route53.dns.appthrust.io/controller
32+
identityRef:
33+
name: route53-dev
34+
parameters:
35+
zoneType: Private
36+
zoneCreationPolicy: Deny
37+
zoneDeletionPolicy: Retain
38+
---
39+
apiVersion: dns.appthrust.io/v1alpha1
40+
kind: Zone
41+
metadata:
42+
namespace: tenant-a-app
43+
name: internal-example-com
44+
spec:
45+
domainName: internal.example.com
46+
provider:
47+
name: route53.dns.appthrust.io
48+
version: v1alpha1
49+
zoneClassRef:
50+
namespace: tenant-a-platform
51+
name: route53-private
52+
adoption:
53+
hostedZoneId: Z10219583PPQMV0U1KGN2
54+
---
55+
apiVersion: dns.appthrust.io/v1alpha1
56+
kind: RecordSet
57+
metadata:
58+
namespace: tenant-a-app
59+
name: api
60+
spec:
61+
zoneRef:
62+
name: internal-example-com
63+
provider:
64+
name: route53.dns.appthrust.io
65+
version: v1alpha1
66+
type: CNAME
67+
name: api
68+
ttl: 300
69+
cname:
70+
target: control-plane.internal.example.com

0 commit comments

Comments
 (0)