I've seen a few comments in some PRs or issues about switching to a configuration block for loading tailscale configuration. Since it's come up multiple times I figured a GitHub issue would help track potential approaches. I had some thoughts and will include them here but we can always drop it if you've already a potential approach
Global Configuration
Anything that needs to be global across all tailscale servers would end up in a global configuration block. This lets the plugin also implement setup and teardown functionality (but only when the global options are specified). Anything that sets up a bare listener without specifying any tailscale block would not get the plugin teardown called on it.
Some examples could be:
- whether servers should be ephemeral
- External storage for tailscale server state
- a global auth key
Per server/listener configuration
The bigger question that I might have is where to store per listener configuration (such as auth keys) particularly when http servers declare conflicting configuration. My thought is to include individual server configuration as individual blocks inside the global configuration.
The final configuration would look something like this:
tailscale {
authkey = "TS_AUTHKEY_global"
state {
kubestore "secret_name"
}
a { # this matches tailscale/a
authkey = "TS_AUTHKEY"
ephemeral = true
}
}
:80 {
bind tailscale/a
}
:80 {
bind tailscale/b #tailscale/b inherits global configuration
}
Please let me know your thoughts
I've seen a few comments in some PRs or issues about switching to a configuration block for loading tailscale configuration. Since it's come up multiple times I figured a GitHub issue would help track potential approaches. I had some thoughts and will include them here but we can always drop it if you've already a potential approach
Global Configuration
Anything that needs to be global across all tailscale servers would end up in a global configuration block. This lets the plugin also implement setup and teardown functionality (but only when the global options are specified). Anything that sets up a bare listener without specifying any tailscale block would not get the plugin teardown called on it.
Some examples could be:
Per server/listener configuration
The bigger question that I might have is where to store per listener configuration (such as auth keys) particularly when http servers declare conflicting configuration. My thought is to include individual server configuration as individual blocks inside the global configuration.
The final configuration would look something like this:
Please let me know your thoughts