blob: ac0a08cb2a46701835e19bf57a5f1740e95782e4 [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.
81 ip_prefixes:
82 # - fd7a:115c:a1e0::/48
83 - 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
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400146 # SQLite config
147 db_type: sqlite3
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400148
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400149 # For production:
150 # db_path: /var/lib/headscale/db.sqlite
151 db_path: /headscale/data/db.sqlite
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400152
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400153 # # Postgres config
154 # If using a Unix socket to connect to Postgres, set the socket path in the 'host' field and leave 'port' blank.
155 # db_type: postgres
156 # db_host: localhost
157 # db_port: 5432
158 # db_name: headscale
159 # db_user: foo
160 # db_pass: bar
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400161
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400162 # If other 'sslmode' is required instead of 'require(true)' and 'disabled(false)', set the 'sslmode' you need
163 # in the 'db_ssl' field. Refers to https://www.postgresql.org/docs/current/libpq-ssl.html Table 34.1.
164 # db_ssl: false
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400165
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400166 ### TLS configuration
167 #
168 ## Let's encrypt / ACME
169 #
170 # headscale supports automatically requesting and setting up
171 # TLS for a domain with Let's Encrypt.
172 #
173 # URL to ACME directory
174 acme_url: https://acme-v02.api.letsencrypt.org/directory
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400175
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400176 # Email to register with ACME provider
177 acme_email: ""
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400178
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400179 # Domain name to request a TLS certificate for:
180 tls_letsencrypt_hostname: ""
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400181
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400182 # Path to store certificates and metadata needed by
183 # letsencrypt
184 # For production:
185 # tls_letsencrypt_cache_dir: /var/lib/headscale/cache
186 tls_letsencrypt_cache_dir: ./cache
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400187
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400188 # Type of ACME challenge to use, currently supported types:
189 # HTTP-01 or TLS-ALPN-01
190 # See [docs/tls.md](docs/tls.md) for more information
191 tls_letsencrypt_challenge_type: HTTP-01
192 # When HTTP-01 challenge is chosen, letsencrypt must set up a
193 # verification endpoint, and it will be listening on:
194 # :http = port 80
195 tls_letsencrypt_listen: ":http"
Giorgi Lekveishvili08a19412023-02-04 22:36:01 +0400196
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400197 ## Use already defined certificates:
198 tls_cert_path: ""
199 tls_key_path: ""
200
201 log:
202 # Output formatting for logs: text or json
203 format: text
204 level: info
205
206 # Path to a file containg ACL policies.
207 # ACLs can be defined as YAML or HUJSON.
208 # https://tailscale.com/kb/1018/acls/
209 acl_policy_path: ""
210
211 ## DNS
212 #
213 # headscale supports Tailscale's DNS configuration and MagicDNS.
214 # Please have a look to their KB to better understand the concepts:
215 #
216 # - https://tailscale.com/kb/1054/dns/
217 # - https://tailscale.com/kb/1081/magicdns/
218 # - https://tailscale.com/blog/2021-09-private-dns-with-magicdns/
219 #
220 dns_config:
221 # Whether to prefer using Headscale provided DNS or use local.
222 override_local_dns: true
223
224 # List of DNS servers to expose to clients.
225 nameservers:
226 - 8.8.8.8
227 - 1.1.1.1
228
229 # NextDNS (see https://tailscale.com/kb/1218/nextdns/).
230 # "abc123" is example NextDNS ID, replace with yours.
231 #
232 # With metadata sharing:
233 # nameservers:
234 # - https://dns.nextdns.io/abc123
235 #
236 # Without metadata sharing:
237 # nameservers:
238 # - 2a07:a8c0::ab:c123
239 # - 2a07:a8c1::ab:c123
240
241 # Split DNS (see https://tailscale.com/kb/1054/dns/),
242 # list of search domains and the DNS to query for each one.
243 #
244 # restricted_nameservers:
245 # foo.bar.com:
246 # - 1.1.1.1
247 # darp.headscale.net:
248 # - 1.1.1.1
249 # - 8.8.8.8
250
251 # Search domains to inject.
252 domains: []
253
254 # Whether to use [MagicDNS](https://tailscale.com/kb/1081/magicdns/).
255 # Only works if there is at least a nameserver defined.
256 magic_dns: true
257
258 # Defines the base domain to create the hostnames for MagicDNS.
259 # `base_domain` must be a FQDNs, without the trailing dot.
260 # The FQDN of the hosts will be
261 # `hostname.namespace.base_domain` (e.g., _myhost.mynamespace.example.com_).
262 base_domain: {{ .Values.internalBaseDomain }}
263
264 # Unix socket used for the CLI to connect without authentication
265 # Note: for production you will want to set this to something like:
266 # unix_socket: /var/run/headscale.sock
Giorgi Lekveishvili37181d02023-06-15 19:00:41 +0400267 unix_socket: /headscale-api/headscale.sock
Giorgi Lekveishvili4a853bd2023-06-15 11:46:46 +0400268 unix_socket_permission: "0770"
269 #
270 # headscale supports experimental OpenID connect support,
271 # it is still being tested and might have some bugs, please
272 # help us test it.
273 # OpenID Connect
274 oidc:
275 only_start_if_oidc_is_available: false
276 issuer: {{ .Values.oauth2.hydraPublic }}
277 client_id: {{`{{ .client_id }}`}}
278 client_secret: {{`{{ .client_secret }}`}}
279 scope: ["openid", "profile", "email"]
280 extra_params:
281 domain_hint: {{ .Values.domain }}
282 allowed_domains:
283 - {{ .Values.domain }}
284 # allowed_groups:
285 # - /headscale
286 # allowed_users:
287 # - alice@example.com
288 strip_email_domain: true
289
290 # Logtail configuration
291 # Logtail is Tailscales logging and auditing infrastructure, it allows the control panel
292 # to instruct tailscale nodes to log their activity to a remote server.
293 logtail:
294 # Enable logtail for this headscales clients.
295 # As there is currently no support for overriding the log server in headscale, this is
296 # disabled by default. Enabling this will make your clients send logs to Tailscale Inc.
297 enabled: false
298
299 # Enabling this option makes devices prefer a random port for WireGuard traffic over the
300 # default static port 41641. This option is intended as a workaround for some buggy
301 # firewall devices. See https://tailscale.com/kb/1181/firewalls/ for more information.
302 randomize_client_port: true