@@ -15,37 +15,37 @@ Here is typical example of [CRD API type](https://github.com/kubernetes-sigs/ext
15
15
type TTL int64
16
16
type Targets []string
17
17
type ProviderSpecificProperty struct {
18
- Name string ` json:"name,omitempty"`
19
- Value string ` json:"value,omitempty"`
18
+ Name string ` json:"name,omitempty"`
19
+ Value string ` json:"value,omitempty"`
20
20
}
21
21
type ProviderSpecific []ProviderSpecificProperty
22
22
type Labels map [string ]string
23
23
24
24
type Endpoint struct {
25
- // The hostname of the DNS record
26
- DNSName string ` json:"dnsName,omitempty"`
27
- // The targets the DNS record points to
28
- Targets Targets ` json:"targets,omitempty"`
29
- // RecordType type of record, e.g. CNAME, A, SRV, TXT etc
30
- RecordType string ` json:"recordType,omitempty"`
31
- // TTL for the record
32
- RecordTTL TTL ` json:"recordTTL,omitempty"`
33
- // Labels stores labels defined for the Endpoint
34
- // +optional
35
- Labels Labels ` json:"labels,omitempty"`
36
- // ProviderSpecific stores provider specific config
37
- // +optional
38
- ProviderSpecific ProviderSpecific ` json:"providerSpecific,omitempty"`
25
+ // The hostname of the DNS record
26
+ DNSName string ` json:"dnsName,omitempty"`
27
+ // The targets the DNS record points to
28
+ Targets Targets ` json:"targets,omitempty"`
29
+ // RecordType type of record, e.g. CNAME, A, SRV, TXT etc
30
+ RecordType string ` json:"recordType,omitempty"`
31
+ // TTL for the record
32
+ RecordTTL TTL ` json:"recordTTL,omitempty"`
33
+ // Labels stores labels defined for the Endpoint
34
+ // +optional
35
+ Labels Labels ` json:"labels,omitempty"`
36
+ // ProviderSpecific stores provider specific config
37
+ // +optional
38
+ ProviderSpecific ProviderSpecific ` json:"providerSpecific,omitempty"`
39
39
}
40
40
41
41
type DNSEndpointSpec struct {
42
- Endpoints []*Endpoint ` json:"endpoints,omitempty"`
42
+ Endpoints []*Endpoint ` json:"endpoints,omitempty"`
43
43
}
44
44
45
45
type DNSEndpointStatus struct {
46
- // The generation observed by the external-dns controller.
47
- // +optional
48
- ObservedGeneration int64 ` json:"observedGeneration,omitempty"`
46
+ // The generation observed by the external-dns controller.
47
+ // +optional
48
+ ObservedGeneration int64 ` json:"observedGeneration,omitempty"`
49
49
}
50
50
51
51
// +genclient
@@ -56,13 +56,12 @@ type DNSEndpointStatus struct {
56
56
// +kubebuilder:resource:path=dnsendpoints
57
57
// +kubebuilder:subresource:status
58
58
type DNSEndpoint struct {
59
- metav1.TypeMeta ` json:",inline"`
60
- metav1.ObjectMeta ` json:"metadata,omitempty"`
59
+ metav1.TypeMeta ` json:",inline"`
60
+ metav1.ObjectMeta ` json:"metadata,omitempty"`
61
61
62
- Spec DNSEndpointSpec ` json:"spec,omitempty"`
63
- Status DNSEndpointStatus ` json:"status,omitempty"`
62
+ Spec DNSEndpointSpec ` json:"spec,omitempty"`
63
+ Status DNSEndpointStatus ` json:"status,omitempty"`
64
64
}
65
-
66
65
```
67
66
68
67
Refer to [ kubebuilder] ( https://github.com/kubernetes-sigs/kubebuilder ) to create and register the CRD.
@@ -99,7 +98,7 @@ dnsendpoint.externaldns.k8s.io "examplednsrecord" created
99
98
100
99
Run external-dns in dry-mode to see whether external-dns picks up the DNS record from CRD.
101
100
102
- ``` yaml
101
+ ``` sh
103
102
$ build/external-dns --source crd --crd-source-apiversion externaldns.k8s.io/v1alpha1 --crd-source-kind DNSEndpoint --provider inmemory --once --dry-run
104
103
INFO[0000] running in dry-run mode. No changes to DNS records will be made.
105
104
INFO[0000] Connected to cluster at https://192.168.99.100:8443
0 commit comments