blob: c060af09dd23e8aa874cf93e6fff69e1b8e95d7f [file] [log] [blame]
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +04001apiVersion: dodo.cloud.dodo.cloud/v1
2kind: ResourceRenderer
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +04003metadata:
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +04004 name: config-renderer
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +04005 namespace: {{ .Release.Namespace }}
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +04006spec:
7 secretName: {{ .Values.oauth2.secretName }}
8 resourceTemplate: |
9 apiVersion: v1
10 kind: ConfigMap
11 metadata:
12 name: config
13 namespace: {{ .Release.Namespace }}
14 data:
15 config.yaml: |
16 # headscale will look for a configuration file named `config.yaml` (or `config.json`) in the following order:
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040017 #
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040018 # - `/etc/headscale`
19 # - `~/.headscale`
20 # - current working directory
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040021
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040022 # The url clients will connect to.
23 # Typically this will be a domain like:
24 #
25 # https://myheadscale.example.com:443
26 #
27 server_url: https://{{ .Values.domain }}
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040028
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040029 # Address to listen to / bind to on the server
30 #
31 # For production:
32 listen_addr: 0.0.0.0:8080
33 # listen_addr: 127.0.0.1:8080
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040034
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040035 # Address to listen to /metrics, you may want
36 # to keep this endpoint private to your internal
37 # network
38 #
39 metrics_listen_addr: 0.0.0.0:9090
40 # metrics_listen_addr: 127.0.0.1:9090
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040041
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040042 # Address to listen for gRPC.
43 # gRPC is used for controlling a headscale server
44 # remotely with the CLI
45 # Note: Remote access _only_ works if you have
46 # valid certificates.
47 #
48 # For production:
49 grpc_listen_addr: 0.0.0.0:50443
50 # grpc_listen_addr: 127.0.0.1:50443
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040051
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040052 # Allow the gRPC admin interface to run in INSECURE
53 # mode. This is not recommended as the traffic will
54 # be unencrypted. Only enable if you know what you
55 # are doing.
56 grpc_allow_insecure: false
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040057
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040058 # Private key used to encrypt the traffic between headscale
59 # and Tailscale clients.
60 # The private key file will be autogenerated if it's missing.
61 #
62 # For production:
63 # /var/lib/headscale/private.key
64 private_key_path: /headscale/data/private.key
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040065
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040066 # The Noise section includes specific configuration for the
67 # TS2021 Noise protocol
68 noise:
69 # The Noise private key is used to encrypt the
70 # traffic between headscale and Tailscale clients when
71 # using the new Noise-based protocol. It must be different
72 # from the legacy private key.
73 #
74 # For production:
75 # private_key_path: /var/lib/headscale/noise_private.key
76 private_key_path: /headscale/data/noise_private.key
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040077
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040078 # List of IP prefixes to allocate tailaddresses from.
79 # Each prefix consists of either an IPv4 or IPv6 address,
80 # and the associated prefix length, delimited by a slash.
gio2aa289c2025-04-09 08:13:40 +040081 prefixes:
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040082 # - fd7a:115c:a1e0::/48
gio2aa289c2025-04-09 08:13:40 +040083 v4: 100.64.0.0/10
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040084
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040085 # DERP is a relay system that Tailscale uses when a direct
86 # connection cannot be established.
87 # https://tailscale.com/blog/how-tailscale-works/#encrypted-tcp-relays-derp
88 #
89 # headscale needs a list of DERP servers that can be presented
90 # to the clients.
91 derp:
92 server:
93 # If enabled, runs the embedded DERP server and merges it into the rest of the DERP config
94 # The Headscale server_url defined above MUST be using https, DERP requires TLS to be in place
95 enabled: false
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +040096
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +040097 # Region ID to use for the embedded DERP server.
98 # The local DERP prevails if the region ID collides with other region ID coming from
99 # the regular DERP config.
100 region_id: 999
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400101
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400102 # Region code and name are displayed in the Tailscale UI to identify a DERP region
103 region_code: "headscale"
104 region_name: "Headscale Embedded DERP"
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400105
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400106 # Listens over UDP at the configured address for STUN connections - to help with NAT traversal.
107 # When the embedded DERP server is enabled stun_listen_addr MUST be defined.
108 #
109 # For more details on how this works, check this great article: https://tailscale.com/blog/how-tailscale-works/
110 stun_listen_addr: "0.0.0.0:3478"
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400111
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400112 # List of externally available DERP maps encoded in JSON
113 urls:
114 - https://controlplane.tailscale.com/derpmap/default
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400115
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400116 # Locally available DERP map files encoded in YAML
117 #
118 # This option is mostly interesting for people hosting
119 # their own DERP servers:
120 # https://tailscale.com/kb/1118/custom-derp-servers/
121 #
122 # paths:
123 # - /etc/headscale/derp-example.yaml
124 paths: []
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400125
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400126 # If enabled, a worker will be set up to periodically
127 # refresh the given sources and update the derpmap
128 # will be set up.
129 auto_update_enabled: true
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400130
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400131 # How often should we check for DERP updates?
132 update_frequency: 24h
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400133
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400134 # Disables the automatic check for headscale updates on startup
135 disable_check_updates: true
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400136
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400137 # Time before an inactive ephemeral node is deleted?
138 ephemeral_node_inactivity_timeout: 30m
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400139
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400140 # Period to check for node updates within the tailnet. A value too low will severely affect
141 # CPU consumption of Headscale. A value too high (over 60s) will cause problems
142 # for the nodes, as they won't get updates or keep alive messages frequently enough.
143 # In case of doubts, do not touch the default 10s.
144 node_update_check_interval: 10s
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400145
gio2aa289c2025-04-09 08:13:40 +0400146 database:
147 type: sqlite
148 debug: false
149 gorm:
150 prepare_stmt: true
151 parameterized_queries: true
152 skip_err_record_not_found: true
153 slow_threshold: 1000
154 sqlite:
155 path: /headscale/data/db.sqlite
156 write_ahead_log: true
157 wal_autocheckpoint: 1000
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400158
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400159 ### TLS configuration
160 #
161 ## Let's encrypt / ACME
162 #
163 # headscale supports automatically requesting and setting up
164 # TLS for a domain with Let's Encrypt.
165 #
166 # URL to ACME directory
167 acme_url: https://acme-v02.api.letsencrypt.org/directory
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400168
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400169 # Email to register with ACME provider
170 acme_email: ""
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400171
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400172 # Domain name to request a TLS certificate for:
173 tls_letsencrypt_hostname: ""
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400174
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400175 # Path to store certificates and metadata needed by
176 # letsencrypt
177 # For production:
178 # tls_letsencrypt_cache_dir: /var/lib/headscale/cache
179 tls_letsencrypt_cache_dir: ./cache
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400180
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400181 # Type of ACME challenge to use, currently supported types:
182 # HTTP-01 or TLS-ALPN-01
183 # See [docs/tls.md](docs/tls.md) for more information
184 tls_letsencrypt_challenge_type: HTTP-01
185 # When HTTP-01 challenge is chosen, letsencrypt must set up a
186 # verification endpoint, and it will be listening on:
187 # :http = port 80
188 tls_letsencrypt_listen: ":http"
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400189
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400190 ## Use already defined certificates:
191 tls_cert_path: ""
192 tls_key_path: ""
193
194 log:
195 # Output formatting for logs: text or json
196 format: text
197 level: info
198
199 # Path to a file containg ACL policies.
200 # ACLs can be defined as YAML or HUJSON.
201 # https://tailscale.com/kb/1018/acls/
gio2aa289c2025-04-09 08:13:40 +0400202 policy:
203 mode: file
204 path: "/headscale/acls/config.hujson" # TODO(gio): mount path must be configurable
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400205
206 ## DNS
207 #
208 # headscale supports Tailscale's DNS configuration and MagicDNS.
209 # Please have a look to their KB to better understand the concepts:
210 #
211 # - https://tailscale.com/kb/1054/dns/
212 # - https://tailscale.com/kb/1081/magicdns/
213 # - https://tailscale.com/blog/2021-09-private-dns-with-magicdns/
214 #
gio2aa289c2025-04-09 08:13:40 +0400215 dns:
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400216 # List of DNS servers to expose to clients.
217 nameservers:
gio2aa289c2025-04-09 08:13:40 +0400218 global:
219 - 8.8.8.8
220 - 1.1.1.1
221 split: {}
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400222
223 # NextDNS (see https://tailscale.com/kb/1218/nextdns/).
224 # "abc123" is example NextDNS ID, replace with yours.
225 #
226 # With metadata sharing:
227 # nameservers:
228 # - https://dns.nextdns.io/abc123
229 #
230 # Without metadata sharing:
231 # nameservers:
232 # - 2a07:a8c0::ab:c123
233 # - 2a07:a8c1::ab:c123
234
235 # Split DNS (see https://tailscale.com/kb/1054/dns/),
236 # list of search domains and the DNS to query for each one.
237 #
238 # restricted_nameservers:
239 # foo.bar.com:
240 # - 1.1.1.1
241 # darp.headscale.net:
242 # - 1.1.1.1
243 # - 8.8.8.8
244
245 # Search domains to inject.
gio2aa289c2025-04-09 08:13:40 +0400246 search_domains: []
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400247
248 # Whether to use [MagicDNS](https://tailscale.com/kb/1081/magicdns/).
249 # Only works if there is at least a nameserver defined.
250 magic_dns: true
251
252 # Defines the base domain to create the hostnames for MagicDNS.
253 # `base_domain` must be a FQDNs, without the trailing dot.
254 # The FQDN of the hosts will be
255 # `hostname.namespace.base_domain` (e.g., _myhost.mynamespace.example.com_).
gio2aa289c2025-04-09 08:13:40 +0400256 base_domain: devices.p.{{ .Values.publicBaseDomain }}
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400257
258 # Unix socket used for the CLI to connect without authentication
259 # Note: for production you will want to set this to something like:
260 # unix_socket: /var/run/headscale.sock
Giorgi Lekveishvili37181d02023-06-15 19:00:41 +0400261 unix_socket: /headscale-api/headscale.sock
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400262 unix_socket_permission: "0770"
263 #
264 # headscale supports experimental OpenID connect support,
265 # it is still being tested and might have some bugs, please
266 # help us test it.
267 # OpenID Connect
268 oidc:
Giorgi Lekveishvili6ae65d12023-12-04 15:37:53 +0400269 only_start_if_oidc_is_available: true
Giorgi Lekveishvili0c6b3242024-03-14 15:31:08 +0400270 issuer: {{ .Values.oauth2.issuer }}
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400271 client_id: {{`{{ .client_id }}`}}
272 client_secret: {{`{{ .client_secret }}`}}
273 scope: ["openid", "profile", "email"]
274 extra_params:
275 domain_hint: {{ .Values.domain }}
276 allowed_domains:
Giorgi Lekveishvili54498c72023-06-21 11:04:25 +0400277 - {{ .Values.publicBaseDomain }}
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400278 # allowed_groups:
279 # - /headscale
280 # allowed_users:
281 # - alice@example.com
282 strip_email_domain: true
283
284 # Logtail configuration
285 # Logtail is Tailscales logging and auditing infrastructure, it allows the control panel
286 # to instruct tailscale nodes to log their activity to a remote server.
287 logtail:
288 # Enable logtail for this headscales clients.
289 # As there is currently no support for overriding the log server in headscale, this is
290 # disabled by default. Enabling this will make your clients send logs to Tailscale Inc.
291 enabled: false
292
293 # Enabling this option makes devices prefer a random port for WireGuard traffic over the
294 # default static port 41641. This option is intended as a workaround for some buggy
295 # firewall devices. See https://tailscale.com/kb/1181/firewalls/ for more information.
296 randomize_client_port: true