apiVersion: apps/v1
kind: Deployment
metadata:
  name: tailscale-subnet-router
  namespace: tailscale
  labels:
    app.kubernetes.io/name: tailscale-subnet-router
    app.kubernetes.io/part-of: foxhunt
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: tailscale-subnet-router
  template:
    metadata:
      labels:
        app.kubernetes.io/name: tailscale-subnet-router
    spec:
      nodeSelector:
        k8s.scaleway.com/pool-name: infra
      serviceAccountName: tailscale
      containers:
        - name: tailscale
          image: ghcr.io/tailscale/tailscale:latest
          env:
            - name: TS_AUTHKEY
              valueFrom:
                secretKeyRef:
                  name: tailscale-auth
                  key: TS_AUTHKEY
            - name: TS_KUBE_SECRET
              value: tailscale-state
            - name: TS_USERSPACE
              value: "false"
            - name: TS_ROUTES
              value: "10.42.0.0/16"
            - name: TS_HOSTNAME
              value: foxhunt-kapsule
            - name: TS_ACCEPT_DNS
              value: "false"
          securityContext:
            capabilities:
              add:
                - NET_ADMIN
                - NET_RAW
          resources:
            requests:
              cpu: 50m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi
