| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 1 | apiVersion: dodo.cloud.dodo.cloud/v1 |
| 2 | kind: ResourceRenderer |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 3 | metadata: |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 4 | name: config-renderer |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 5 | namespace: {{ .Release.Namespace }} |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 6 | spec: |
| 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 17 | # |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 18 | # - `/etc/headscale` |
| 19 | # - `~/.headscale` |
| 20 | # - current working directory |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 21 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 22 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 28 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 29 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 34 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 35 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 41 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 42 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 51 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 52 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 57 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 58 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 65 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 66 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 77 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 78 | # 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. |
| gio | 2aa289c | 2025-04-09 08:13:40 +0400 | [diff] [blame] | 81 | prefixes: |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 82 | # - fd7a:115c:a1e0::/48 |
| gio | 2aa289c | 2025-04-09 08:13:40 +0400 | [diff] [blame] | 83 | v4: 100.64.0.0/10 |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 84 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 85 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 96 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 97 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 101 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 102 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 105 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 106 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 111 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 112 | # List of externally available DERP maps encoded in JSON |
| 113 | urls: |
| 114 | - https://controlplane.tailscale.com/derpmap/default |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 115 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 116 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 125 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 126 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 130 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 131 | # How often should we check for DERP updates? |
| 132 | update_frequency: 24h |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 133 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 134 | # Disables the automatic check for headscale updates on startup |
| 135 | disable_check_updates: true |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 136 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 137 | # Time before an inactive ephemeral node is deleted? |
| 138 | ephemeral_node_inactivity_timeout: 30m |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 139 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 140 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 145 | |
| gio | 2aa289c | 2025-04-09 08:13:40 +0400 | [diff] [blame] | 146 | 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 158 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 159 | ### 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 168 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 169 | # Email to register with ACME provider |
| 170 | acme_email: "" |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 171 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 172 | # Domain name to request a TLS certificate for: |
| 173 | tls_letsencrypt_hostname: "" |
| Giorgi Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 174 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 175 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 180 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 181 | # 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 Lekveishvili | 08a1941 | 2023-02-04 22:36:01 +0400 | [diff] [blame] | 189 | |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 190 | ## 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/ |
| gio | 2aa289c | 2025-04-09 08:13:40 +0400 | [diff] [blame] | 202 | policy: |
| 203 | mode: file |
| 204 | path: "/headscale/acls/config.hujson" # TODO(gio): mount path must be configurable |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 205 | |
| 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 | # |
| gio | 2aa289c | 2025-04-09 08:13:40 +0400 | [diff] [blame] | 215 | dns: |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 216 | # List of DNS servers to expose to clients. |
| 217 | nameservers: |
| gio | 2aa289c | 2025-04-09 08:13:40 +0400 | [diff] [blame] | 218 | global: |
| 219 | - 8.8.8.8 |
| 220 | - 1.1.1.1 |
| 221 | split: {} |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 222 | |
| 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. |
| gio | 2aa289c | 2025-04-09 08:13:40 +0400 | [diff] [blame] | 246 | search_domains: [] |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 247 | |
| 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_). |
| gio | 2aa289c | 2025-04-09 08:13:40 +0400 | [diff] [blame] | 256 | base_domain: devices.p.{{ .Values.publicBaseDomain }} |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 257 | |
| 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 Lekveishvili | 37181d0 | 2023-06-15 19:00:41 +0400 | [diff] [blame] | 261 | unix_socket: /headscale-api/headscale.sock |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 262 | 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 Lekveishvili | 6ae65d1 | 2023-12-04 15:37:53 +0400 | [diff] [blame] | 269 | only_start_if_oidc_is_available: true |
| Giorgi Lekveishvili | 0c6b324 | 2024-03-14 15:31:08 +0400 | [diff] [blame] | 270 | issuer: {{ .Values.oauth2.issuer }} |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 271 | 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 Lekveishvili | 54498c7 | 2023-06-21 11:04:25 +0400 | [diff] [blame] | 277 | - {{ .Values.publicBaseDomain }} |
| Giorgi Lekveishvili | 4a853bd | 2023-06-15 11:46:46 +0400 | [diff] [blame] | 278 | # 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 |