Last active
January 5, 2024 09:21
-
-
Save petrilli/22362ed3d83d72cd80f335fecd0c928e to your computer and use it in GitHub Desktop.
K8S Deployment resources for Tailscale golink
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The only thing missing below is the authkey you need. That is stored in Kubernetes Secret. | |
# It can be created at the command line, after you get one from https://login.tailscale.com/admin/settings/keys | |
# using the following `kubectl` command: | |
# | |
# $ kubectl create secret -n golink generic golink-ts \ | |
# --from-literal=TS_AUTHKEY="tskey-auth-aBcDeFgH-01234567891234567890123456789" | |
# | |
# The blogpost describe golink can be found here: https://tailscale.com/blog/golink/ | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: golink | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: golink-pvc | |
namespace: golink | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 1Gi | |
volumeMode: Filesystem | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: golink | |
namespace: golink | |
labels: | |
app: golink | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
name: golink | |
labels: | |
app: golink | |
spec: | |
containers: | |
- name: golink | |
image: ghcr.io/tailscale/golink:main | |
imagePullPolicy: Always | |
resources: | |
limits: | |
cpu: 100m | |
memory: 64Mi | |
volumeMounts: | |
- mountPath: /root | |
name: golink-vol | |
env: | |
- name: TS_AUTHKEY | |
valueFrom: | |
secretKeyRef: | |
name: golink-ts | |
key: TS_AUTHKEY | |
optional: false | |
restartPolicy: Always | |
volumes: | |
- name: golink-vol | |
persistentVolumeClaim: | |
claimName: golink-pvc | |
selector: | |
matchLabels: | |
app: golink |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PSA:
volumeMounts.mountPath
should be/home/nonroot
instead of/root
for current versions of golink 🙂