proxy.yaml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Copyright (c) Tailscale Inc & AUTHORS
  2. # SPDX-License-Identifier: BSD-3-Clause
  3. apiVersion: v1
  4. kind: Pod
  5. metadata:
  6. name: proxy
  7. spec:
  8. serviceAccountName: "{{SA_NAME}}"
  9. initContainers:
  10. # In order to run as a proxy we need to enable IP Forwarding inside
  11. # the container. The `net.ipv4.ip_forward` sysctl is not allowlisted
  12. # in Kubelet by default.
  13. - name: sysctler
  14. image: "ghcr.io/tailscale/tailscale:latest"
  15. securityContext:
  16. privileged: true
  17. command: ["/bin/sh"]
  18. args:
  19. - -c
  20. - sysctl -w net.ipv4.ip_forward=1 net.ipv6.conf.all.forwarding=1
  21. resources:
  22. requests:
  23. cpu: 1m
  24. memory: 1Mi
  25. containers:
  26. - name: tailscale
  27. imagePullPolicy: Always
  28. image: "ghcr.io/tailscale/tailscale:latest"
  29. env:
  30. # Store the state in a k8s secret
  31. - name: TS_KUBE_SECRET
  32. value: "{{TS_KUBE_SECRET}}"
  33. - name: TS_USERSPACE
  34. value: "false"
  35. - name: TS_AUTHKEY
  36. valueFrom:
  37. secretKeyRef:
  38. name: tailscale-auth
  39. key: TS_AUTHKEY
  40. optional: true
  41. - name: TS_DEST_IP
  42. value: "{{TS_DEST_IP}}"
  43. - name: TS_AUTH_ONCE
  44. value: "true"
  45. securityContext:
  46. capabilities:
  47. add:
  48. - NET_ADMIN