cmd/k8s-operator: add nodeSelector to DNSConfig resource (#19429)
This commit modifies the `DNSConfig` resource to allow customisation of the `spec.nodeSelector` field in the nameserver pods. Closes: https://github.com/tailscale/tailscale/issues/19419 Signed-off-by: David Bond <davidsbond93@gmail.com>
This commit is contained in:
@@ -116,6 +116,9 @@ type NameserverPod struct {
|
||||
// If specified, applies affinity rules to the pods deployed by the DNSConfig resource.
|
||||
// +optional
|
||||
Affinity *corev1.Affinity `json:"affinity,omitzero"`
|
||||
// If specified, applies node selector rules to the pods deployed by the DNSConfig resource.
|
||||
// +optional
|
||||
NodeSelector map[string]string `json:"nodeSelector,omitzero"`
|
||||
}
|
||||
|
||||
type DNSConfigStatus struct {
|
||||
|
||||
@@ -474,6 +474,13 @@ func (in *NameserverPod) DeepCopyInto(out *NameserverPod) {
|
||||
*out = new(corev1.Affinity)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.NodeSelector != nil {
|
||||
in, out := &in.NodeSelector, &out.NodeSelector
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NameserverPod.
|
||||
|
||||
Reference in New Issue
Block a user