Skip to content

Commit 0b26dfa

Browse files
committed
Add support for configuring service per pod for DNS services
Adds support for using service overrides to configure a service per pod for mdns, bind9 and unbound. Also removes unbound forwarder template as it gets in the way of customizing configuration
1 parent 7fc73e6 commit 0b26dfa

21 files changed

+2159
-70
lines changed

api/bases/designate.openstack.org_designatebackendbind9s.yaml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,161 @@ spec:
125125
NodeSelector to target subset of worker nodes running this service. Setting here overrides
126126
any global NodeSelector settings within the Designate CR.
127127
type: object
128+
override:
129+
description: |-
130+
Allows services to be configured for accessing each designate bind pod. For best results, there should be
131+
an override for each replica.
132+
properties:
133+
services:
134+
items:
135+
description: |-
136+
OverrideSpec - service override configuration for the Service created to serve traffic to the cluster.
137+
Allows for the manifest of the created Service to be overwritten with custom configuration.
138+
properties:
139+
metadata:
140+
description: |-
141+
EmbeddedLabelsAnnotations is an embedded subset of the fields included in k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta.
142+
Only labels and annotations are included.
143+
properties:
144+
annotations:
145+
additionalProperties:
146+
type: string
147+
description: |-
148+
Annotations is an unstructured key value map stored with a resource that may be
149+
set by external tools to store and retrieve arbitrary metadata. They are not
150+
queryable and should be preserved when modifying objects.
151+
More info: http://kubernetes.io/docs/user-guide/annotations
152+
type: object
153+
labels:
154+
additionalProperties:
155+
type: string
156+
description: |-
157+
Map of string keys and values that can be used to organize and categorize
158+
(scope and select) objects. May match selectors of replication controllers
159+
and services.
160+
More info: http://kubernetes.io/docs/user-guide/labels
161+
type: object
162+
type: object
163+
spec:
164+
description: |-
165+
OverrideServiceSpec is a subset of the fields included in https://pkg.go.dev/k8s.io/[email protected]/core/v1#ServiceSpec
166+
Limited to Type, SessionAffinity, LoadBalancerSourceRanges, ExternalName, ExternalTrafficPolicy, SessionAffinityConfig,
167+
IPFamilyPolicy, LoadBalancerClass and InternalTrafficPolicy
168+
properties:
169+
externalName:
170+
description: |-
171+
externalName is the external reference that discovery mechanisms will
172+
return as an alias for this service (e.g. a DNS CNAME record). No
173+
proxying will be involved. Must be a lowercase RFC-1123 hostname
174+
(https://tools.ietf.org/html/rfc1123) and requires `type` to be "ExternalName".
175+
type: string
176+
externalTrafficPolicy:
177+
description: |-
178+
externalTrafficPolicy describes how nodes distribute service traffic they
179+
receive on one of the Service's "externally-facing" addresses (NodePorts,
180+
ExternalIPs, and LoadBalancer IPs). If set to "Local", the proxy will configure
181+
the service in a way that assumes that external load balancers will take care
182+
of balancing the service traffic between nodes, and so each node will deliver
183+
traffic only to the node-local endpoints of the service, without masquerading
184+
the client source IP. (Traffic mistakenly sent to a node with no endpoints will
185+
be dropped.) The default value, "Cluster", uses the standard behavior of
186+
routing to all endpoints evenly (possibly modified by topology and other
187+
features). Note that traffic sent to an External IP or LoadBalancer IP from
188+
within the cluster will always get "Cluster" semantics, but clients sending to
189+
a NodePort from within the cluster may need to take traffic policy into account
190+
when picking a node.
191+
type: string
192+
internalTrafficPolicy:
193+
description: |-
194+
InternalTrafficPolicy describes how nodes distribute service traffic they
195+
receive on the ClusterIP. If set to "Local", the proxy will assume that pods
196+
only want to talk to endpoints of the service on the same node as the pod,
197+
dropping the traffic if there are no local endpoints. The default value,
198+
"Cluster", uses the standard behavior of routing to all endpoints evenly
199+
(possibly modified by topology and other features).
200+
type: string
201+
ipFamilyPolicy:
202+
description: |-
203+
IPFamilyPolicy represents the dual-stack-ness requested or required by
204+
this Service. If there is no value provided, then this field will be set
205+
to SingleStack. Services can be "SingleStack" (a single IP family),
206+
"PreferDualStack" (two IP families on dual-stack configured clusters or
207+
a single IP family on single-stack clusters), or "RequireDualStack"
208+
(two IP families on dual-stack configured clusters, otherwise fail). The
209+
ipFamilies and clusterIPs fields depend on the value of this field. This
210+
field will be wiped when updating a service to type ExternalName.
211+
type: string
212+
loadBalancerClass:
213+
description: |-
214+
loadBalancerClass is the class of the load balancer implementation this Service belongs to.
215+
If specified, the value of this field must be a label-style identifier, with an optional prefix,
216+
e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users.
217+
This field can only be set when the Service type is 'LoadBalancer'. If not set, the default load
218+
balancer implementation is used, today this is typically done through the cloud provider integration,
219+
but should apply for any default implementation. If set, it is assumed that a load balancer
220+
implementation is watching for Services with a matching class. Any default load balancer
221+
implementation (e.g. cloud providers) should ignore Services that set this field.
222+
This field can only be set when creating or updating a Service to type 'LoadBalancer'.
223+
Once set, it can not be changed. This field will be wiped when a service is updated to a non 'LoadBalancer' type.
224+
type: string
225+
loadBalancerSourceRanges:
226+
description: |-
227+
If specified and supported by the platform, this will restrict traffic through the cloud-provider
228+
load-balancer will be restricted to the specified client IPs. This field will be ignored if the
229+
cloud-provider does not support the feature."
230+
More info: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/
231+
items:
232+
type: string
233+
type: array
234+
sessionAffinity:
235+
description: |-
236+
Supports "ClientIP" and "None". Used to maintain session affinity.
237+
Enable client IP based session affinity.
238+
Must be ClientIP or None.
239+
Defaults to None.
240+
More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
241+
type: string
242+
sessionAffinityConfig:
243+
description: sessionAffinityConfig contains the configurations
244+
of session affinity.
245+
properties:
246+
clientIP:
247+
description: clientIP contains the configurations
248+
of Client IP based session affinity.
249+
properties:
250+
timeoutSeconds:
251+
description: |-
252+
timeoutSeconds specifies the seconds of ClientIP type session sticky time.
253+
The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP".
254+
Default value is 10800(for 3 hours).
255+
format: int32
256+
type: integer
257+
type: object
258+
type: object
259+
type:
260+
description: |-
261+
type determines how the Service is exposed. Defaults to ClusterIP. Valid
262+
options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
263+
"ClusterIP" allocates a cluster-internal IP address for load-balancing
264+
to endpoints. Endpoints are determined by the selector or if that is not
265+
specified, by manual construction of an Endpoints object or
266+
EndpointSlice objects. If clusterIP is "None", no virtual IP is
267+
allocated and the endpoints are published as a set of endpoints rather
268+
than a virtual IP.
269+
"NodePort" builds on ClusterIP and allocates a port on every node which
270+
routes to the same endpoints as the clusterIP.
271+
"LoadBalancer" builds on NodePort and creates an external load-balancer
272+
(if supported in the current cloud) which routes to the same endpoints
273+
as the clusterIP.
274+
"ExternalName" aliases this service to the specified externalName.
275+
Several other fields do not apply to ExternalName services.
276+
More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
277+
type: string
278+
type: object
279+
type: object
280+
type: array
281+
x-kubernetes-list-type: atomic
282+
type: object
128283
passwordSelectors:
129284
default:
130285
service: DesignatePassword

0 commit comments

Comments
 (0)