From fa0b70739dba1228094d573a473c3cc06a06ec2b Mon Sep 17 00:00:00 2001 From: Tom Proctor Date: Fri, 4 Oct 2024 14:30:32 +0100 Subject: [PATCH] Review feedback * Document that default ProxyClass does not currently apply to CRDs * Remove stateful filtering Signed-off-by: Tom Proctor --- cmd/k8s-operator/deploy/chart/values.yaml | 3 ++- cmd/k8s-operator/proxygroup.go | 17 +++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/cmd/k8s-operator/deploy/chart/values.yaml b/cmd/k8s-operator/deploy/chart/values.yaml index 43ed382c61..de003f1490 100644 --- a/cmd/k8s-operator/deploy/chart/values.yaml +++ b/cmd/k8s-operator/deploy/chart/values.yaml @@ -79,7 +79,8 @@ proxyConfig: defaultTags: "tag:k8s" firewallMode: auto # If defined, this proxy class will be used as the default proxy class for - # service and ingress resources that do not have a proxy class defined. + # service and ingress resources that do not have a proxy class defined. It + # does not apply to Connector and ProxyGroup resources. defaultProxyClass: "" # apiServerProxyConfig allows to configure whether the operator should expose diff --git a/cmd/k8s-operator/proxygroup.go b/cmd/k8s-operator/proxygroup.go index 3f0358cd40..fdf2fa9343 100644 --- a/cmd/k8s-operator/proxygroup.go +++ b/cmd/k8s-operator/proxygroup.go @@ -400,24 +400,17 @@ func (r *ProxyGroupReconciler) ensureConfigSecretsCreated(ctx context.Context, p func pgTailscaledConfig(pg *tsapi.ProxyGroup, class *tsapi.ProxyClass, idx int32, authKey string, oldSecret *corev1.Secret) (tailscaledConfigs, error) { conf := &ipn.ConfigVAlpha{ - Version: "alpha0", - AcceptDNS: "false", - AcceptRoutes: "false", // AcceptRoutes defaults to true - Locked: "false", - Hostname: ptr.To(fmt.Sprintf("%s-%d", pg.Name, idx)), - NoStatefulFiltering: "false", + Version: "alpha0", + AcceptDNS: "false", + AcceptRoutes: "false", // AcceptRoutes defaults to true + Locked: "false", + Hostname: ptr.To(fmt.Sprintf("%s-%d", pg.Name, idx)), } if pg.Spec.HostnamePrefix != "" { conf.Hostname = ptr.To(fmt.Sprintf("%s%d", pg.Spec.HostnamePrefix, idx)) } - // For egress proxies only, we need to ensure that stateful filtering is - // not in place so that traffic from cluster can be forwarded via - // Tailscale IPs. - if pg.Spec.Type == tsapi.ProxyGroupTypeEgress { - conf.NoStatefulFiltering = "true" - } if shouldAcceptRoutes(class) { conf.AcceptRoutes = "true" }