Skip to content

Commit 3a0d8a1

Browse files
committed
make LocalDNS as all-or-nothing property under AKSNodeClassSpec
1 parent 9b4a93b commit 3a0d8a1

File tree

7 files changed

+425
-160
lines changed

7 files changed

+425
-160
lines changed

charts/karpenter-crd/templates/karpenter.azure.com_aksnodeclasses.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,15 @@ spec:
244244
for more information.
245245
pattern: ^([0-9]+(s|m|h))+$
246246
type: string
247+
required:
248+
- cacheDuration
249+
- forwardDestination
250+
- forwardPolicy
251+
- maxConcurrent
252+
- protocol
253+
- queryLogging
254+
- serveStale
255+
- serveStaleDuration
247256
type: object
248257
description: KubeDNS overrides apply to DNS traffic from pods
249258
with dnsPolicy:ClusterFirst (referred to as KubeDNS traffic).
@@ -313,11 +322,24 @@ spec:
313322
for more information.
314323
pattern: ^([0-9]+(s|m|h))+$
315324
type: string
325+
required:
326+
- cacheDuration
327+
- forwardDestination
328+
- forwardPolicy
329+
- maxConcurrent
330+
- protocol
331+
- queryLogging
332+
- serveStale
333+
- serveStaleDuration
316334
type: object
317335
description: VnetDNS overrides apply to DNS traffic from pods
318336
with dnsPolicy:default or kubelet (referred to as VnetDNS traffic).
319337
maxProperties: 100
320338
type: object
339+
required:
340+
- kubeDNSOverrides
341+
- mode
342+
- vnetDNSOverrides
321343
type: object
322344
maxPods:
323345
description: |-
@@ -720,6 +742,15 @@ spec:
720742
for more information.
721743
pattern: ^([0-9]+(s|m|h))+$
722744
type: string
745+
required:
746+
- cacheDuration
747+
- forwardDestination
748+
- forwardPolicy
749+
- maxConcurrent
750+
- protocol
751+
- queryLogging
752+
- serveStale
753+
- serveStaleDuration
723754
type: object
724755
description: KubeDNS overrides apply to DNS traffic from pods
725756
with dnsPolicy:ClusterFirst (referred to as KubeDNS traffic).
@@ -788,10 +819,23 @@ spec:
788819
for more information.
789820
pattern: ^([0-9]+(s|m|h))+$
790821
type: string
822+
required:
823+
- cacheDuration
824+
- forwardDestination
825+
- forwardPolicy
826+
- maxConcurrent
827+
- protocol
828+
- queryLogging
829+
- serveStale
830+
- serveStaleDuration
791831
type: object
792832
description: VnetDNS overrides apply to DNS traffic from pods
793833
with dnsPolicy:default or kubelet (referred to as VnetDNS traffic).
794834
type: object
835+
required:
836+
- kubeDNSOverrides
837+
- mode
838+
- vnetDNSOverrides
795839
type: object
796840
maxPods:
797841
description: |-

pkg/apis/crds/karpenter.azure.com_aksnodeclasses.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,15 @@ spec:
244244
for more information.
245245
pattern: ^([0-9]+(s|m|h))+$
246246
type: string
247+
required:
248+
- cacheDuration
249+
- forwardDestination
250+
- forwardPolicy
251+
- maxConcurrent
252+
- protocol
253+
- queryLogging
254+
- serveStale
255+
- serveStaleDuration
247256
type: object
248257
description: KubeDNS overrides apply to DNS traffic from pods
249258
with dnsPolicy:ClusterFirst (referred to as KubeDNS traffic).
@@ -313,11 +322,24 @@ spec:
313322
for more information.
314323
pattern: ^([0-9]+(s|m|h))+$
315324
type: string
325+
required:
326+
- cacheDuration
327+
- forwardDestination
328+
- forwardPolicy
329+
- maxConcurrent
330+
- protocol
331+
- queryLogging
332+
- serveStale
333+
- serveStaleDuration
316334
type: object
317335
description: VnetDNS overrides apply to DNS traffic from pods
318336
with dnsPolicy:default or kubelet (referred to as VnetDNS traffic).
319337
maxProperties: 100
320338
type: object
339+
required:
340+
- kubeDNSOverrides
341+
- mode
342+
- vnetDNSOverrides
321343
type: object
322344
maxPods:
323345
description: |-
@@ -720,6 +742,15 @@ spec:
720742
for more information.
721743
pattern: ^([0-9]+(s|m|h))+$
722744
type: string
745+
required:
746+
- cacheDuration
747+
- forwardDestination
748+
- forwardPolicy
749+
- maxConcurrent
750+
- protocol
751+
- queryLogging
752+
- serveStale
753+
- serveStaleDuration
723754
type: object
724755
description: KubeDNS overrides apply to DNS traffic from pods
725756
with dnsPolicy:ClusterFirst (referred to as KubeDNS traffic).
@@ -788,10 +819,23 @@ spec:
788819
for more information.
789820
pattern: ^([0-9]+(s|m|h))+$
790821
type: string
822+
required:
823+
- cacheDuration
824+
- forwardDestination
825+
- forwardPolicy
826+
- maxConcurrent
827+
- protocol
828+
- queryLogging
829+
- serveStale
830+
- serveStaleDuration
791831
type: object
792832
description: VnetDNS overrides apply to DNS traffic from pods
793833
with dnsPolicy:default or kubelet (referred to as VnetDNS traffic).
794834
type: object
835+
required:
836+
- kubeDNSOverrides
837+
- mode
838+
- vnetDNSOverrides
795839
type: object
796840
maxPods:
797841
description: |-

pkg/apis/v1alpha2/aksnodeclass.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -120,51 +120,51 @@ const (
120120
// For more details see aka.ms/aks/localdns.
121121
type LocalDNS struct {
122122
// Mode of enablement for localDNS.
123-
// +optional
124-
Mode *LocalDNSMode `json:"mode,omitempty"`
123+
// +required
124+
Mode *LocalDNSMode `json:"mode"`
125125
// VnetDNS overrides apply to DNS traffic from pods with dnsPolicy:default or kubelet (referred to as VnetDNS traffic).
126126
// +kubebuilder:validation:MaxProperties=100
127-
// +optional
128-
VnetDNSOverrides map[string]*LocalDNSOverrides `json:"vnetDNSOverrides,omitempty"`
127+
// +required
128+
VnetDNSOverrides map[string]*LocalDNSOverrides `json:"vnetDNSOverrides"`
129129
// KubeDNS overrides apply to DNS traffic from pods with dnsPolicy:ClusterFirst (referred to as KubeDNS traffic).
130130
// +kubebuilder:validation:MaxProperties=100
131-
// +optional
132-
KubeDNSOverrides map[string]*LocalDNSOverrides `json:"kubeDNSOverrides,omitempty"`
131+
// +required
132+
KubeDNSOverrides map[string]*LocalDNSOverrides `json:"kubeDNSOverrides"`
133133
}
134134

135135
// LocalDNSOverrides specifies DNS override configuration
136136
type LocalDNSOverrides struct {
137137
// Log level for DNS queries in localDNS.
138-
// +optional
139-
QueryLogging *LocalDNSQueryLogging `json:"queryLogging,omitempty"`
138+
// +required
139+
QueryLogging *LocalDNSQueryLogging `json:"queryLogging"`
140140
// Enforce TCP or prefer UDP protocol for connections from localDNS to upstream DNS server.
141-
// +optional
142-
Protocol *LocalDNSProtocol `json:"protocol,omitempty"`
141+
// +required
142+
Protocol *LocalDNSProtocol `json:"protocol"`
143143
// Destination server for DNS queries to be forwarded from localDNS.
144-
// +optional
145-
ForwardDestination *LocalDNSForwardDestination `json:"forwardDestination,omitempty"`
144+
// +required
145+
ForwardDestination *LocalDNSForwardDestination `json:"forwardDestination"`
146146
// Forward policy for selecting upstream DNS server. See [forward plugin](https://coredns.io/plugins/forward) for more information.
147-
// +optional
148-
ForwardPolicy *LocalDNSForwardPolicy `json:"forwardPolicy,omitempty"`
147+
// +required
148+
ForwardPolicy *LocalDNSForwardPolicy `json:"forwardPolicy"`
149149
// Maximum number of concurrent queries. See [forward plugin](https://coredns.io/plugins/forward) for more information.
150150
// +kubebuilder:validation:Minimum=0
151-
// +optional
152-
MaxConcurrent *int32 `json:"maxConcurrent,omitempty"`
151+
// +required
152+
MaxConcurrent *int32 `json:"maxConcurrent"`
153153
// Cache max TTL. See [cache plugin](https://coredns.io/plugins/cache) for more information.
154154
// +kubebuilder:validation:Pattern=`^([0-9]+(s|m|h))+$`
155155
// +kubebuilder:validation:Type="string"
156156
// +kubebuilder:validation:Schemaless
157-
// +optional
158-
CacheDuration karpv1.NillableDuration `json:"cacheDuration,omitempty"`
157+
// +required
158+
CacheDuration karpv1.NillableDuration `json:"cacheDuration"`
159159
// Serve stale duration. See [cache plugin](https://coredns.io/plugins/cache) for more information.
160160
// +kubebuilder:validation:Pattern=`^([0-9]+(s|m|h))+$`
161161
// +kubebuilder:validation:Type="string"
162162
// +kubebuilder:validation:Schemaless
163-
// +optional
164-
ServeStaleDuration karpv1.NillableDuration `json:"serveStaleDuration,omitempty"`
163+
// +required
164+
ServeStaleDuration karpv1.NillableDuration `json:"serveStaleDuration"`
165165
// Policy for serving stale data. See [cache plugin](https://coredns.io/plugins/cache) for more information.
166-
// +optional
167-
ServeStale *LocalDNSServeStale `json:"serveStale,omitempty"`
166+
// +required
167+
ServeStale *LocalDNSServeStale `json:"serveStale"`
168168
}
169169

170170
// +kubebuilder:validation:Enum:={Error,Log}

0 commit comments

Comments
 (0)