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/deploy/crds
David Bond 2cb86cf65e
cmd/k8s-operator,k8s-operator: Allow the use of multiple tailnets (#18344)
This commit contains  the implementation of multi-tailnet support within the Kubernetes Operator

Each of our custom resources now expose the `spec.tailnet` field. This field is a string that must match the name of an existing `Tailnet` resource. A `Tailnet` resource looks like this:

```yaml
apiVersion: tailscale.com/v1alpha1
kind: Tailnet
metadata:
  name: example  # This is the name that must be referenced by other resources
spec:
  credentials:
    secretName: example-oauth
```

Each `Tailnet` references a `Secret` resource that contains a set of oauth credentials. This secret must be created in the same namespace as the operator:

```yaml
apiVersion: v1
kind: Secret
metadata:
  name: example-oauth # This is the name that's referenced by the Tailnet resource.
  namespace: tailscale
stringData:
  client_id: "client-id"
  client_secret: "client-secret"
```

When created, the operator performs a basic check that the oauth client has access to all required scopes. This is done using read actions on devices, keys & services. While this doesn't capture a missing "write" permission, it catches completely missing permissions. Once this check passes, the `Tailnet` moves into a ready state and can be referenced. Attempting to use a `Tailnet` in a non-ready state will stall the deployment of `Connector`s, `ProxyGroup`s and `Recorder`s until the `Tailnet` becomes ready.

The `spec.tailnet` field informs the operator that a `Connector`, `ProxyGroup`, or `Recorder` must be given an auth key generated using the specified oauth client. For backwards compatibility, the set of credentials the operator is configured with are considered the default. That is, where `spec.tailnet` is not set, the resource will be deployed in the same tailnet as the operator. 

Updates https://github.com/tailscale/corp/issues/34561
1 day ago
..
tailscale.com_connectors.yaml cmd/k8s-operator,k8s-operator: Allow the use of multiple tailnets (#18344) 1 day ago
tailscale.com_dnsconfigs.yaml cmd/k8s-operator: allow pod tolerations on nameservers (#17260) 3 months ago
tailscale.com_proxyclasses.yaml cmd/k8s-operator/e2e: run self-contained e2e tests with devcontrol (#17415) 2 weeks ago
tailscale.com_proxygroups.yaml cmd/k8s-operator,k8s-operator: Allow the use of multiple tailnets (#18344) 1 day ago
tailscale.com_recorders.yaml cmd/k8s-operator,k8s-operator: Allow the use of multiple tailnets (#18344) 1 day ago
tailscale.com_tailnets.yaml cmd/k8s-operator,k8s-operator: Allow the use of multiple tailnets (#18344) 1 day ago