Skip to content

Commit 9908d5c

Browse files
authored
feat: adds external-dns (#2)
1 parent 4a414ed commit 9908d5c

File tree

8 files changed

+478
-1
lines changed

8 files changed

+478
-1
lines changed

modules/envoy-gateway/blueprint.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: "1.0"
22
project: {
3-
name: "envoy-gateway"
3+
name: "external-dns"
44
release: {
55
kcl: {
66
on: tag: {}

modules/external-dns/Earthfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
VERSION 0.8
2+
3+
IMPORT ../../earthly/kcl AS kcl
4+
5+
deps:
6+
FROM debian:bookworm-slim
7+
8+
RUN apt-get update && apt-get install -y curl wget
9+
10+
DO kcl+INSTALL
11+
12+
src:
13+
FROM +deps
14+
15+
WORKDIR /work
16+
17+
COPY --dir crd v1alpha1 .
18+
COPY kcl.mod kcl.mod.lock README.md .
19+
20+
generate:
21+
FROM +src
22+
23+
RUN kcl import -m crd -o . -s crd/crd.yaml
24+
RUN kcl doc generate
25+
26+
SAVE ARTIFACT models/v1alpha1 AS LOCAL v1alpha1
27+
SAVE ARTIFACT docs/external-dns.md AS LOCAL README.md
28+
29+
check:
30+
FROM +generate
31+
32+
WORKDIR /work
33+
34+
RUN diff -r models/v1alpha1 v1alpha1
35+
RUN diff -r docs/external-dns.md README.md

modules/external-dns/README.md

Lines changed: 194 additions & 0 deletions
Large diffs are not rendered by default.

modules/external-dns/blueprint.cue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: "1.0"
2+
project: {
3+
name: "envoy-gateway"
4+
release: {
5+
kcl: {
6+
on: tag: {}
7+
}
8+
}
9+
}

modules/external-dns/crd/crd.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: dnsendpoints.externaldns.k8s.io
5+
annotations:
6+
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/external-dns/pull/2007
7+
spec:
8+
group: externaldns.k8s.io
9+
names:
10+
kind: DNSEndpoint
11+
listKind: DNSEndpointList
12+
plural: dnsendpoints
13+
singular: dnsendpoint
14+
scope: Namespaced
15+
versions:
16+
- name: v1alpha1
17+
schema:
18+
openAPIV3Schema:
19+
properties:
20+
apiVersion:
21+
description: |-
22+
APIVersion defines the versioned schema of this representation of an object.
23+
Servers should convert recognized schemas to the latest internal value, and
24+
may reject unrecognized values.
25+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
26+
type: string
27+
kind:
28+
description: |-
29+
Kind is a string value representing the REST resource this object represents.
30+
Servers may infer this from the endpoint the client submits requests to.
31+
Cannot be updated.
32+
In CamelCase.
33+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
34+
type: string
35+
metadata:
36+
type: object
37+
spec:
38+
description: DNSEndpointSpec defines the desired state of DNSEndpoint
39+
properties:
40+
endpoints:
41+
items:
42+
description:
43+
Endpoint is a high-level way of a connection between
44+
a service and an IP
45+
properties:
46+
dnsName:
47+
description: The hostname of the DNS record
48+
type: string
49+
labels:
50+
additionalProperties:
51+
type: string
52+
description: Labels stores labels defined for the Endpoint
53+
type: object
54+
providerSpecific:
55+
description: ProviderSpecific stores provider specific config
56+
items:
57+
description:
58+
ProviderSpecificProperty holds the name and value
59+
of a configuration which is specific to individual DNS providers
60+
properties:
61+
name:
62+
type: string
63+
value:
64+
type: string
65+
type: object
66+
type: array
67+
recordTTL:
68+
description: TTL for the record
69+
format: int64
70+
type: integer
71+
recordType:
72+
description:
73+
RecordType type of record, e.g. CNAME, A, AAAA,
74+
SRV, TXT etc
75+
type: string
76+
setIdentifier:
77+
description:
78+
Identifier to distinguish multiple records with
79+
the same name and type (e.g. Route53 records with routing
80+
policies other than 'simple')
81+
type: string
82+
targets:
83+
description: The targets the DNS record points to
84+
items:
85+
type: string
86+
type: array
87+
type: object
88+
type: array
89+
type: object
90+
status:
91+
description: DNSEndpointStatus defines the observed state of DNSEndpoint
92+
properties:
93+
observedGeneration:
94+
description: The generation observed by the external-dns controller.
95+
format: int64
96+
type: integer
97+
type: object
98+
type: object
99+
served: true
100+
storage: true
101+
subresources:
102+
status: {}

modules/external-dns/kcl.mod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "external-dns"
3+
edition = "v0.11.1"
4+
version = "0.16.1"
5+
6+
[dependencies]
7+
k8s = "1.31.2"

modules/external-dns/kcl.mod.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[dependencies]
2+
[dependencies.k8s]
3+
name = "k8s"
4+
full_name = "k8s_1.31.2"
5+
version = "1.31.2"
6+
sum = "xBZgPsnpVVyWBpahuPQHReeRx28eUHGFoaPeqbct+vs="
7+
reg = "ghcr.io"
8+
repo = "kcl-lang/k8s"
9+
oci_tag = "1.31.2"
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
"""
2+
This file was generated by the KCL auto-gen tool. DO NOT EDIT.
3+
Editing this file might prove futile when you re-run the KCL auto-gen generate command.
4+
"""
5+
import k8s.apimachinery.pkg.apis.meta.v1
6+
7+
8+
schema DNSEndpoint:
9+
r"""
10+
externaldns k8s io v1alpha1 DNS endpoint
11+
12+
Attributes
13+
----------
14+
apiVersion : str, default is "externaldns.k8s.io/v1alpha1", required
15+
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
16+
kind : str, default is "DNSEndpoint", required
17+
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
18+
metadata : v1.ObjectMeta, default is Undefined, optional
19+
metadata
20+
spec : ExternaldnsK8sIoV1alpha1DNSEndpointSpec, default is Undefined, optional
21+
spec
22+
status : ExternaldnsK8sIoV1alpha1DNSEndpointStatus, default is Undefined, optional
23+
status
24+
"""
25+
26+
27+
apiVersion: "externaldns.k8s.io/v1alpha1" = "externaldns.k8s.io/v1alpha1"
28+
29+
kind: "DNSEndpoint" = "DNSEndpoint"
30+
31+
metadata?: v1.ObjectMeta
32+
33+
spec?: ExternaldnsK8sIoV1alpha1DNSEndpointSpec
34+
35+
status?: ExternaldnsK8sIoV1alpha1DNSEndpointStatus
36+
37+
38+
schema ExternaldnsK8sIoV1alpha1DNSEndpointSpec:
39+
r"""
40+
DNSEndpointSpec defines the desired state of DNSEndpoint
41+
42+
Attributes
43+
----------
44+
endpoints : [ExternaldnsK8sIoV1alpha1DNSEndpointSpecEndpointsItems0], default is Undefined, optional
45+
endpoints
46+
"""
47+
48+
49+
endpoints?: [ExternaldnsK8sIoV1alpha1DNSEndpointSpecEndpointsItems0]
50+
51+
52+
schema ExternaldnsK8sIoV1alpha1DNSEndpointSpecEndpointsItems0:
53+
r"""
54+
Endpoint is a high-level way of a connection between a service and an IP
55+
56+
Attributes
57+
----------
58+
dnsName : str, default is Undefined, optional
59+
The hostname of the DNS record
60+
labels : {str:str}, default is Undefined, optional
61+
Labels stores labels defined for the Endpoint
62+
providerSpecific : [ExternaldnsK8sIoV1alpha1DNSEndpointSpecEndpointsItems0ProviderSpecificItems0], default is Undefined, optional
63+
ProviderSpecific stores provider specific config
64+
recordTTL : int, default is Undefined, optional
65+
TTL for the record
66+
recordType : str, default is Undefined, optional
67+
RecordType type of record, e.g. CNAME, A, AAAA, SRV, TXT etc
68+
setIdentifier : str, default is Undefined, optional
69+
Identifier to distinguish multiple records with the same name and type (e.g. Route53 records with routing policies other than 'simple')
70+
targets : [str], default is Undefined, optional
71+
The targets the DNS record points to
72+
"""
73+
74+
75+
dnsName?: str
76+
77+
labels?: {str:str}
78+
79+
providerSpecific?: [ExternaldnsK8sIoV1alpha1DNSEndpointSpecEndpointsItems0ProviderSpecificItems0]
80+
81+
recordTTL?: int
82+
83+
recordType?: str
84+
85+
setIdentifier?: str
86+
87+
targets?: [str]
88+
89+
90+
schema ExternaldnsK8sIoV1alpha1DNSEndpointSpecEndpointsItems0ProviderSpecificItems0:
91+
r"""
92+
ProviderSpecificProperty holds the name and value of a configuration which is specific to individual DNS providers
93+
94+
Attributes
95+
----------
96+
name : str, default is Undefined, optional
97+
name
98+
value : str, default is Undefined, optional
99+
value
100+
"""
101+
102+
103+
name?: str
104+
105+
value?: str
106+
107+
108+
schema ExternaldnsK8sIoV1alpha1DNSEndpointStatus:
109+
r"""
110+
DNSEndpointStatus defines the observed state of DNSEndpoint
111+
112+
Attributes
113+
----------
114+
observedGeneration : int, default is Undefined, optional
115+
The generation observed by the external-dns controller.
116+
"""
117+
118+
119+
observedGeneration?: int
120+
121+

0 commit comments

Comments
 (0)