diff --git a/charts/headscale/Chart.lock b/charts/headscale/Chart.lock new file mode 100644 index 0000000..e8ed071 --- /dev/null +++ b/charts/headscale/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: replicated-library + repository: https://replicatedhq.github.io/helm-charts + version: 0.13.7 +digest: sha256:04bbecac57159b26db8a6e677f6a226408592c52b78210fbb1ac85982f40ed61 +generated: "2023-07-22T12:07:47.139232276-05:00" diff --git a/charts/headscale/Chart.yaml b/charts/headscale/Chart.yaml new file mode 100644 index 0000000..8d64b33 --- /dev/null +++ b/charts/headscale/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v2 +appVersion: 1 +name: headscale +version: 0.0.1-beta.1 +description: headscale open source tailscale implementation +dependencies: +- name: replicated-library + #repository: file://../../../helm-charts-library/charts/replicated-library + repository: https://replicatedhq.github.io/helm-charts + version: '^0.13.7' +kubeVersion: '>=1.25.0-0' diff --git a/charts/headscale/templates/replicated-library.tpl b/charts/headscale/templates/replicated-library.tpl new file mode 100644 index 0000000..1a17a49 --- /dev/null +++ b/charts/headscale/templates/replicated-library.tpl @@ -0,0 +1,22 @@ +{{/* Make sure all variables are set properly */}} +{{- include "replicated-library.values.setup" . }} + +{{- define "hardcodedValues" -}} +apps: + headscale: + containers: + headscale: + image: + repository: {{ .Values.image.repository }} + tag: {{ .Values.image.tag }} + +configmaps: + headscale: + data: +{{- $headscaleConfig := .Values.headscale.config | toYaml | trim }} + etc: | +{{ $headscaleConfig | indent 8 }} +{{ end }} +{{ $_ := mergeOverwrite .Values (include "hardcodedValues" . | fromYaml) }} + +{{ include "replicated-library.all" . }} diff --git a/charts/headscale/values.yaml b/charts/headscale/values.yaml new file mode 100644 index 0000000..ada4c1f --- /dev/null +++ b/charts/headscale/values.yaml @@ -0,0 +1,88 @@ +global: + fullNameOverride: "net1" +apps: + headscale: + enabled: true + type: statefulset + containers: + headscale: + command: + - headscale + args: + - serve + volumeMounts: + - name: data + mountPath: /vol/data + - name: config + mountPath: /etc/headscale/config.yaml + subPath: etc + readOnly: true + volumes: + - name: data + persistentVolumeClaim: + claimName: data + - name: config + configMap: + name: net1-headscale + +services: + headscale: + enabled: true + appName: ["headscale"] + ports: + http: + enabled: true + port: 8080 + protocol: HTTP + targetPort: 8080 + grpc: + enabled: true + port: 50443 + protocol: TCP + targetPort: 50443 + derp: + enabled: true + port: 3478 + protocol: UDP + targetPort: 3478 + +persistence: + data: + enabled: true + type: persistentVolumeClaim + persistentVolumeClaim: + #existingClaimName: existing-claim-name + spec: + accessModes: + - ReadWriteOnce + volumeMode: Filesystem + persistentvolumeReclaimPolicy: Retain + resources: + requests: + storage: 1Gi + +configmaps: + headscale: + enabled: true + +# Setting at the top level for convenience +image: + repository: ghcr.io/juanfont/headscale + tag: 0.22.3 + +# headscale config +headscale: + # See https://github.com/replicatedhq/helm-charts/blob/main/charts/replicated-library/values-example.yaml + config: + server_url: http://127.0.0.1:8080 + listen_addr: 0.0.0.0:8080 + grpc_listen_addr: 0.0.0.0:50443 + grpc_allow_insecure: true + private_key_path: /vol/data/private.key + noise: + private_key_path: /vol/data/noise_private.key + ip_prefixes: + - fd7a:115c:a1e0::/48 + - 100.64.0.0/10 + db_type: sqlite3 + db_path: /vol/data/db.sqlite