Skip to content

Commit 7db3b17

Browse files
authored
feat: add node selector (#194)
* pass through value * generate manifest
1 parent ce1e2dc commit 7db3b17

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

config/crd/bases/vpn.wireguard-operator.io_wireguards.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ spec:
180180
description: A string field that specifies the maximum transmission
181181
unit (MTU) size for Wireguard packets for all peers.
182182
type: string
183+
nodeSelector:
184+
additionalProperties:
185+
type: string
186+
type: object
183187
port:
184188
description: A field that specifies the value to use for a nodePort
185189
ServiceType

pkg/api/v1alpha1/wireguard_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ type WireguardSpec struct {
5454
// A boolean field that specifies whether to use the userspace implementation of Wireguard instead of the kernel one.
5555
UseWgUserspaceImplementation bool `json:"useWgUserspaceImplementation,omitempty"`
5656

57-
Agent WireguardPodSpec `json:"agent,omitempty"`
58-
Metric WireguardPodSpec `json:"metric,omitempty"`
57+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
58+
Agent WireguardPodSpec `json:"agent,omitempty"`
59+
Metric WireguardPodSpec `json:"metric,omitempty"`
5960
}
6061

6162
// WireguardPodSpec defines spec for respective containers created for Wireguard

pkg/api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/controllers/wireguard_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ func (r *WireguardReconciler) deploymentForWireguard(m *v1alpha1.Wireguard) *app
704704
Labels: ls,
705705
},
706706
Spec: corev1.PodSpec{
707+
NodeSelector: m.Spec.NodeSelector,
707708
SecurityContext: &corev1.PodSecurityContext{
708709
SeccompProfile: &corev1.SeccompProfile{
709710
Type: corev1.SeccompProfileType("RuntimeDefault"),

0 commit comments

Comments
 (0)