You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/cmd/k8s-operator
Tom Proctor f421907c38
all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572)
Adds a new reconciler for ProxyGroups of type kube-apiserver that will
provision a Tailscale Service for each replica to advertise. Adds two
new condition types to the ProxyGroup, TailscaleServiceValid and
TailscaleServiceConfigured, to post updates on the state of that
reconciler in a way that's consistent with the service-pg reconciler.
The created Tailscale Service name is configurable via a new ProxyGroup
field spec.kubeAPISserver.ServiceName, which expects a string of the
form "svc:<dns-label>".

Lots of supporting changes were needed to implement this in a way that's
consistent with other operator workflows, including:

* Pulled containerboot's ensureServicesUnadvertised and certManager into
  kube/ libraries to be shared with k8s-proxy. Use those in k8s-proxy to
  aid Service cert sharing between replicas and graceful Service shutdown.
* For certManager, add an initial wait to the cert loop to wait until
  the domain appears in the devices's netmap to avoid a guaranteed error
  on the first issue attempt when it's quick to start.
* Made several methods in ingress-for-pg.go and svc-for-pg.go into
  functions to share with the new reconciler
* Added a Resource struct to the owner refs stored in Tailscale Service
  annotations to be able to distinguish between Ingress- and ProxyGroup-
  based Services that need cleaning up in the Tailscale API.
* Added a ListVIPServices method to the internal tailscale client to aid
  cleaning up orphaned Services
* Support for reading config from a kube Secret, and partial support for
  config reloading, to prevent us having to force Pod restarts when
  config changes.
* Fixed up the zap logger so it's possible to set debug log level.

Updates #13358

Change-Id: Ia9607441157dd91fb9b6ecbc318eecbef446e116
Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
5 months ago
..
deploy all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
e2e cmd,tsnet,internal/client: create internal shim to deprecated control plane API 10 months ago
generate cmd/k8s-operator,k8s-operator: add ProxyGroup CRD (#13591) 1 year ago
api-server-proxy-pg.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
api-server-proxy-pg_test.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
api-server-proxy.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
connector.go cmd/k8s-operator: Allow configuration of login server (#16432) 5 months ago
connector_test.go cmd/k8s-operator: remove conffile hashing mechanism (#16335) 6 months ago
depaware.txt cmd/{k8s-operator,k8s-proxy}: add kube-apiserver ProxyGroup type (#16266) 5 months ago
dnsrecords.go cmd/k8s-operator: don't error for transient failures (#14073) 1 year ago
dnsrecords_test.go cmd/k8s-operator: configure proxies for HA Ingress to run in cert share mode (#15308) 9 months ago
egress-eps.go cmd/{k8s-operator,containerboot},kube: ensure egress ProxyGroup proxies don't terminate while cluster traffic is still routed to them (#14436) 10 months ago
egress-eps_test.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
egress-pod-readiness.go cmd/k8s-operator: configure proxies for HA Ingress to run in cert share mode (#15308) 9 months ago
egress-pod-readiness_test.go cmd/k8s-operator: configure proxies for HA Ingress to run in cert share mode (#15308) 9 months ago
egress-services-readiness.go cmd/{containerboot,k8s-operator}: use state Secret for checking device auth (#16328) 5 months ago
egress-services-readiness_test.go cmd/{containerboot,k8s-operator}: use state Secret for checking device auth (#16328) 5 months ago
egress-services.go cmd/{containerboot,k8s-operator}: use state Secret for checking device auth (#16328) 5 months ago
egress-services_test.go cmd/{k8s-operator,containerboot},kube: ensure egress ProxyGroup proxies don't terminate while cluster traffic is still routed to them (#14436) 10 months ago
ingress-for-pg.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
ingress-for-pg_test.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
ingress.go cmd/k8s-operator: Allow custom ingress class names (#16472) 5 months ago
ingress_test.go cmd/k8s-operator: Allow custom ingress class names (#16472) 5 months ago
metrics_resources.go cmd/k8s-operator: configure proxies for HA Ingress to run in cert share mode (#15308) 9 months ago
nameserver.go cmd/k8s-operator: ensure status update errors are displayed to users (#16251) 6 months ago
nameserver_test.go go.{mod,sum},cmd/{k8s-operator,derper,stund}/depaware.txt: bump kube deps (#14601) 11 months ago
nodeport-service-ports.go cmd/k8s-operator, k8s-operator: support Static Endpoints on ProxyGroups (#16115) 5 months ago
nodeport-services-ports_test.go cmd/k8s-operator, k8s-operator: support Static Endpoints on ProxyGroups (#16115) 5 months ago
operator.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
operator_test.go cmd/k8s-operator: Allow custom ingress class names (#16472) 5 months ago
proxyclass.go cmd/k8s-operator, k8s-operator: support Static Endpoints on ProxyGroups (#16115) 5 months ago
proxyclass_test.go cmd/k8s-operator, k8s-operator: support Static Endpoints on ProxyGroups (#16115) 5 months ago
proxygroup.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
proxygroup_specs.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
proxygroup_test.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
sts.go cmd/k8s-operator: allow letsencrypt staging on k8s proxies (#16521) 5 months ago
sts_test.go cmd/k8s-operator: allow letsencrypt staging on k8s proxies (#16521) 5 months ago
svc-for-pg.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
svc-for-pg_test.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
svc.go cmd/k8s-operator: Allow configuration of login server (#16432) 5 months ago
testutils_test.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
tsclient.go all-kube: create Tailscale Service for HA kube-apiserver ProxyGroup (#16572) 5 months ago
tsrecorder.go cmd/k8s-operator: Set login server on tsrecorder nodes (#16443) 5 months ago
tsrecorder_specs.go cmd/k8s-operator: Set login server on tsrecorder nodes (#16443) 5 months ago
tsrecorder_specs_test.go cmd/k8s-operator: Set login server on tsrecorder nodes (#16443) 5 months ago
tsrecorder_test.go cmd/k8s-operator: Set login server on tsrecorder nodes (#16443) 5 months ago