blob: 128a24c80bfce128fcf64c59b544accf6f574ba9 [file] [log] [blame]
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +04001apiVersion: networking.k8s.io/v1
2kind: Ingress
3metadata:
4 name: ingress
5 namespace: {{ .Release.Namespace }}
Giorgi Lekveishvilid507be52023-05-21 11:33:50 +04006 annotations:
7 acme.cert-manager.io/http01-edit-in-place: "true"
8 cert-manager.io/cluster-issuer: {{ .Values.certificateIssuer}}
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +04009spec:
10 ingressClassName: {{ .Values.ingressClassName }}
11 tls:
12 - hosts:
Giorgi Lekveishvilice3c64d2023-05-30 13:28:08 +040013 - {{ .Values.domain }}
14 secretName: cert-{{ .Values.domain }}
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040015 rules:
Giorgi Lekveishvilice3c64d2023-05-30 13:28:08 +040016 - host: {{ .Values.domain }}
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040017 http:
18 paths:
19 - path: /
20 pathType: Prefix
21 backend:
22 service:
23 name: headscale
24 port:
25 name: http
Giorgi Lekveishvilib7691552023-05-31 18:13:19 +040026---
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040027apiVersion: v1
28kind: Service
29metadata:
30 name: headscale
31 namespace: {{ .Release.Namespace }}
Giorgi Lekveishvilic3b28862023-06-15 10:38:28 +040032 annotations:
33 metallb.universe.tf/address-pool: {{ .Values.ipAddressPool }}
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040034spec:
35 type: LoadBalancer
36 selector:
37 app: headscale
38 ports:
39 - name: http
40 port: 80
41 targetPort: http
42 protocol: TCP
43---
44apiVersion: v1
Giorgi Lekveishvili6e90bee2023-06-15 17:00:30 +040045kind: Service
46metadata:
47 name: headscale-api
48 namespace: {{ .Release.Namespace }}
49spec:
50 type: ClusterIP
51 selector:
52 app: headscale
53 ports:
54 - name: http
55 port: 80
56 targetPort: http-api
57 protocol: TCP
58---
59apiVersion: v1
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040060kind: PersistentVolumeClaim
61metadata:
62 name: data
63 namespace: {{ .Release.Namespace }}
64spec:
65 accessModes:
66 - ReadWriteOnce
67 resources:
68 requests:
69 storage: {{ .Values.storage.size }}
70---
Giorgi Lekveishvili6ae65d12023-12-04 15:37:53 +040071apiVersion: v1
72kind: PersistentVolumeClaim
73metadata:
74 name: acls
75 namespace: {{ .Release.Namespace }}
76spec:
77 accessModes:
78 - ReadWriteOnce
79 resources:
80 requests:
81 storage: 1Gi # TODO(gio): configurable
82---
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040083apiVersion: apps/v1
84kind: StatefulSet
85metadata:
86 name: headscale
87 namespace: {{ .Release.Namespace }}
88spec:
89 selector:
90 matchLabels:
91 app: headscale
92 serviceName: headscale
93 replicas: 1
94 template:
95 metadata:
96 labels:
97 app: headscale
98 spec:
99 volumes:
100 - name: data
101 persistentVolumeClaim:
102 claimName: data
Giorgi Lekveishvili6ae65d12023-12-04 15:37:53 +0400103 - name: acls
104 persistentVolumeClaim:
105 claimName: acls
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400106 - name: config
107 configMap:
108 name: config
Giorgi Lekveishvili37181d02023-06-15 19:00:41 +0400109 - name: api-socket
110 emptyDir: {}
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400111 containers:
112 - name: headscale
113 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
114 imagePullPolicy: {{ .Values.image.pullPolicy }}
115 ports:
116 - name: http
117 containerPort: 8080
118 protocol: TCP
Giorgi Lekveishvili620caa82023-05-21 19:36:58 +0400119 - name: grpc
120 containerPort: 50443
121 protocol: TCP
Giorgi Lekveishvili6e90bee2023-06-15 17:00:30 +0400122 command:
123 - headscale
124 - --config=/headscale/config/config.yaml
125 - serve
126 volumeMounts:
127 - name: data
128 mountPath: /headscale/data
129 readOnly: false
130 - name: config
131 mountPath: /headscale/config
132 readOnly: true
Giorgi Lekveishvili6ae65d12023-12-04 15:37:53 +0400133 - name: acls
134 mountPath: /headscale/acls
135 readOnly: true
Giorgi Lekveishvili37181d02023-06-15 19:00:41 +0400136 - mountPath: /headscale-api
137 name: api-socket
Giorgi Lekveishvili6e90bee2023-06-15 17:00:30 +0400138 - name: headscale-api
139 image: {{ .Values.api.image.repository }}:{{ .Values.api.image.tag }}
140 imagePullPolicy: {{ .Values.api.image.pullPolicy }}
141 ports:
142 - name: http-api
Giorgi Lekveishvili602479d2023-06-15 17:59:23 +0400143 containerPort: {{ .Values.api.port }}
Giorgi Lekveishvili6e90bee2023-06-15 17:00:30 +0400144 protocol: TCP
145 command:
146 - headscale-api
Giorgi Lekveishvili602479d2023-06-15 17:59:23 +0400147 - --port={{ .Values.api.port }}
Giorgi Lekveishvili6e90bee2023-06-15 17:00:30 +0400148 - --config=/headscale/config/config.yaml
Giorgi Lekveishvili6ae65d12023-12-04 15:37:53 +0400149 - --domain={{ .Values.api.rootDomain }}
150 - --acls=/headscale/acls/config.hujson
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400151 volumeMounts:
152 - name: data
153 mountPath: /headscale/data
154 readOnly: false
155 - name: config
156 mountPath: /headscale/config
157 readOnly: true
Giorgi Lekveishvili6ae65d12023-12-04 15:37:53 +0400158 - name: acls
159 mountPath: /headscale/acls
160 readOnly: false
Giorgi Lekveishvili37181d02023-06-15 19:00:41 +0400161 - mountPath: /headscale-api
162 name: api-socket