diff options
| author | David Bond <davidsbond93@gmail.com> | 2026-04-16 14:10:12 +0100 |
|---|---|---|
| committer | David Bond <davidsbond93@gmail.com> | 2026-04-16 14:10:12 +0100 |
| commit | bdb77000423efd70d37b7dd76d552457fff9a099 (patch) | |
| tree | 9c7436e644d729ccfee3eb8cc82c46ff1f98128d /k8s-operator | |
| parent | 4f47c3c93d71dd4436e9163d9aa4bb7fc82a1ae8 (diff) | |
| download | tailscale-davidb/dns-config-node-selector.tar.xz tailscale-davidb/dns-config-node-selector.zip | |
cmd/k8s-operator: add nodeSelector to `DNSConfig` resourcedavidb/dns-config-node-selector
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>
Diffstat (limited to 'k8s-operator')
| -rw-r--r-- | k8s-operator/api.md | 1 | ||||
| -rw-r--r-- | k8s-operator/apis/v1alpha1/types_tsdnsconfig.go | 3 | ||||
| -rw-r--r-- | k8s-operator/apis/v1alpha1/zz_generated.deepcopy.go | 7 |
3 files changed, 11 insertions, 0 deletions
diff --git a/k8s-operator/api.md b/k8s-operator/api.md index 7bd60ed5d..9101c95ca 100644 --- a/k8s-operator/api.md +++ b/k8s-operator/api.md @@ -484,6 +484,7 @@ _Appears in:_ | --- | --- | --- | --- | | `tolerations` _[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.3/#toleration-v1-core) array_ | If specified, applies tolerations to the pods deployed by the DNSConfig resource. | | | | `affinity` _[Affinity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.3/#affinity-v1-core)_ | If specified, applies affinity rules to the pods deployed by the DNSConfig resource. | | | +| `nodeSelector` _object (keys:string, values:string)_ | If specified, applies node selector rules to the pods deployed by the DNSConfig resource. | | | #### NameserverService diff --git a/k8s-operator/apis/v1alpha1/types_tsdnsconfig.go b/k8s-operator/apis/v1alpha1/types_tsdnsconfig.go index 3a44afbdc..529114c2e 100644 --- a/k8s-operator/apis/v1alpha1/types_tsdnsconfig.go +++ b/k8s-operator/apis/v1alpha1/types_tsdnsconfig.go @@ -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 { diff --git a/k8s-operator/apis/v1alpha1/zz_generated.deepcopy.go b/k8s-operator/apis/v1alpha1/zz_generated.deepcopy.go index 22e7b733b..b401c6d87 100644 --- a/k8s-operator/apis/v1alpha1/zz_generated.deepcopy.go +++ b/k8s-operator/apis/v1alpha1/zz_generated.deepcopy.go @@ -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. |
