mirror of
https://github.com/tailscale/tailscale.git
synced 2026-12-01 06:02:32 -08:00
* cmd/k8s-operator,k8s-operator,ipn/store/kubestore: add per-proxy RBAC
Proxies for Services, Ingresses, Connectors and PeerRelays run as the
shared proxies ServiceAccount, whose Role allows every verb on every
Secret in the operator namespace, so each proxy can read and change the
Secrets of the operator and of other proxies. This fixes this by giving
each of those proxies its own ServiceAccount, Role and RoleBinding, where
the Role names only that proxy's state Secrets, and the chart no longer
installs the proxies Role. It also removes the list and watch on every
Secret from ProxyGroup Roles, and the Secret rule with no resourceNames
that ProxyGroup and Recorder Roles got at zero replicas, so kubestore
read replicas now get cert Secrets by name. Existing proxy Pods restart
once on upgrade.
Updates tailscale/corp#51011
* cmd/k8s-operator,k8s-operator,ipn/store/kubestore: test per-proxy RBAC
Adds tests for the ServiceAccount, Role and RoleBinding that each Service
proxy and PeerRelay gets, including copied imagePullSecrets, and for the
ProxyGroup Role rules, including zero replicas. Adds an e2e test that
uses SubjectAccessReviews to check that a Service proxy and a ProxyGroup
can get their own state Secret, but cannot get the operator's OAuth
Secret or each other's state Secret, and cannot list Secrets. Also adds
tests for reloading shared TLS certs by name on read replicas, including
a cert Secret that is deleted and then recreated, and removes the test
for the Secret list that read replicas no longer do.
Updates tailscale/corp#51011
* kubestore: fix test lint failure
Change-Id: Ia988256dfe611a64b46cdb81d4e1d68bd7873ca4
---------
Change-Id: I9dd176c3f171deb3d6c49b190c6f58cf72085857
(cherry picked from commit e3f1d5ccbd)
Signed-off-by: chaosinthecrd <[email protected]>
Signed-off-by: Mike Jensen <[email protected]>
Co-authored-by: Tom Meadows <[email protected]>
44 lines
1.4 KiB
YAML
44 lines
1.4 KiB
YAML
# This file is not a complete manifest, it's a skeleton that the operator embeds
|
|
# at build time and then uses to construct Tailscale proxy pods.
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata: {}
|
|
spec:
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
deletionGracePeriodSeconds: 10
|
|
spec:
|
|
initContainers:
|
|
- name: sysctler
|
|
securityContext:
|
|
privileged: true
|
|
command: ["/bin/sh", "-c"]
|
|
# Write to /proc/sys directly rather than shelling out to sysctl, which
|
|
# is not present in all base images (e.g. Red Hat's UBI).
|
|
args: ["echo 1 > /proc/sys/net/ipv4/ip_forward && if [ -e /proc/sys/net/ipv6/conf/all/forwarding ]; then echo 1 > /proc/sys/net/ipv6/conf/all/forwarding; fi"]
|
|
containers:
|
|
- name: tailscale
|
|
resources:
|
|
requests:
|
|
cpu: 1m
|
|
memory: 1Mi
|
|
imagePullPolicy: Always
|
|
env:
|
|
- name: TS_USERSPACE
|
|
value: "false"
|
|
- name: POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
- name: POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: POD_UID
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.uid
|
|
securityContext:
|
|
privileged: true
|