mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-11 20:00:28 +01:00
OAuth Provider + Tailscale Kubernetes operator compatibility #422
Closed
opened 2025-12-29 01:28:45 +01:00 by adam
·
12 comments
No Branch/Tag Specified
main
update_flake_lock_action
gh-pages
kradalby/release-v0.27.2
dependabot/go_modules/golang.org/x/crypto-0.45.0
dependabot/go_modules/github.com/opencontainers/runc-1.3.3
copilot/investigate-headscale-issue-2788
copilot/investigate-visibility-issue-2788
copilot/investigate-issue-2833
copilot/debug-issue-2846
copilot/fix-issue-2847
dependabot/go_modules/github.com/go-viper/mapstructure/v2-2.4.0
dependabot/go_modules/github.com/docker/docker-28.3.3incompatible
kradalby/cli-experiement3
doc/0.26.1
doc/0.25.1
doc/0.25.0
doc/0.24.3
doc/0.24.2
doc/0.24.1
doc/0.24.0
kradalby/build-docker-on-pr
topic/docu-versioning
topic/docker-kos
juanfont/fix-crash-node-id
juanfont/better-disclaimer
update-contributors
topic/prettier
revert-1893-add-test-stage-to-docs
add-test-stage-to-docs
remove-node-check-interval
fix-empty-prefix
fix-ephemeral-reusable
bug_report-debuginfo
autogroups
logs-to-stderr
revert-1414-topic/fix_unix_socket
rename-machine-node
port-embedded-derp-tests-v2
port-derp-tests
duplicate-word-linter
update-tailscale-1.36
warn-against-apache
ko-fi-link
more-acl-tests
fix-typo-standalone
parallel-nolint
tparallel-fix
rerouting
ssh-changelog-docs
oidc-cleanup
web-auth-flow-tests
kradalby-gh-runner
fix-proto-lint
remove-funding-links
go-1.19
enable-1.30-in-tests
0.16.x
cosmetic-changes-integration
tmp-fix-integration-docker
fix-integration-docker
configurable-update-interval
show-nodes-online
hs2021
acl-syntax-fixes
ts2021-implementation
fix-spurious-updates
unstable-integration-tests
mandatory-stun
embedded-derp
prtemplate-fix
v0.28.0-beta.1
v0.27.2-rc.1
v0.27.1
v0.27.0
v0.27.0-beta.2
v0.27.0-beta.1
v0.26.1
v0.26.0
v0.26.0-beta.2
v0.26.0-beta.1
v0.25.1
v0.25.0
v0.25.0-beta.2
v0.24.3
v0.25.0-beta.1
v0.24.2
v0.24.1
v0.24.0
v0.24.0-beta.2
v0.24.0-beta.1
v0.23.0
v0.23.0-rc.1
v0.23.0-beta.5
v0.23.0-beta.4
v0.23.0-beta3
v0.23.0-beta2
v0.23.0-beta1
v0.23.0-alpha12
v0.23.0-alpha11
v0.23.0-alpha10
v0.23.0-alpha9
v0.23.0-alpha8
v0.23.0-alpha7
v0.23.0-alpha6
v0.23.0-alpha5
v0.23.0-alpha4
v0.23.0-alpha4-docker-ko-test9
v0.23.0-alpha4-docker-ko-test8
v0.23.0-alpha4-docker-ko-test7
v0.23.0-alpha4-docker-ko-test6
v0.23.0-alpha4-docker-ko-test5
v0.23.0-alpha-docker-release-test-debug2
v0.23.0-alpha-docker-release-test-debug
v0.23.0-alpha4-docker-ko-test4
v0.23.0-alpha4-docker-ko-test3
v0.23.0-alpha4-docker-ko-test2
v0.23.0-alpha4-docker-ko-test
v0.23.0-alpha3
v0.23.0-alpha2
v0.23.0-alpha1
v0.22.3
v0.22.2
v0.23.0-alpha-docker-release-test
v0.22.1
v0.22.0
v0.22.0-alpha3
v0.22.0-alpha2
v0.22.0-alpha1
v0.22.0-nfpmtest
v0.21.0
v0.20.0
v0.19.0
v0.19.0-beta2
v0.19.0-beta1
v0.18.0
v0.18.0-beta4
v0.18.0-beta3
v0.18.0-beta2
v0.18.0-beta1
v0.17.1
v0.17.0
v0.17.0-beta5
v0.17.0-beta4
v0.17.0-beta3
v0.17.0-beta2
v0.17.0-beta1
v0.17.0-alpha4
v0.17.0-alpha3
v0.17.0-alpha2
v0.17.0-alpha1
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.16.0-beta7
v0.16.0-beta6
v0.16.0-beta5
v0.16.0-beta4
v0.16.0-beta3
v0.16.0-beta2
v0.16.0-beta1
v0.15.0
v0.15.0-beta6
v0.15.0-beta5
v0.15.0-beta4
v0.15.0-beta3
v0.15.0-beta2
v0.15.0-beta1
v0.14.0
v0.14.0-beta2
v0.14.0-beta1
v0.13.0
v0.13.0-beta3
v0.13.0-beta2
v0.13.0-beta1
upstream/v0.12.4
v0.12.4
v0.12.3
v0.12.2
v0.12.2-beta1
v0.12.1
v0.12.0-beta2
v0.12.0-beta1
v0.11.0
v0.10.8
v0.10.7
v0.10.6
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.1
v0.8.0
v0.7.1
v0.7.0
v0.6.1
v0.6.0
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.2
v0.2.1
v0.2.0
v0.1.1
v0.1.0
Labels
Clear labels
CLI
DERP
DNS
Nix
OIDC
SSH
bug
database
documentation
duplicate
enhancement
faq
good first issue
grants
help wanted
might-come
needs design doc
needs investigation
no-stale-bot
out of scope
performance
policy 📝
pull-request
question
regression
routes
stale
tags
tailscale-feature-gap
well described ❤️
wontfix
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/headscale#422
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @almereyda on GitHub (Feb 3, 2023).
Feature request
Tailscale have recently released a Kubernetes operator for Tailscale clients.
This issue is a about potential compatibility with its feature set. From a video published alongside the announcement, we learn that this makes use of Tailscale's OAuth provider at their upstream login server implementation.
Here we could elaborate, how Headscale could make the jump to compatibility by providing an OAuth provider implementation, and how to raise the need upstream (in the operator code base) for support of custom login servers in
tailscale/k8s-operator, and passing those to thetailscale/tailscalecontainers.0e1403ec39/cmd/k8s-operator/operator.go (L89-L93)@almereyda commented on GitHub (Feb 4, 2023):
Increased support for an OAuth provider, bolstered with the already existing support for an OIDC client into an OIDC Relaying Party, could also help in providing short-lived access tokens for third-party Headscale API clients, such as the example of a Web UI #234, which in return would allow to refrain from creating static API tokens.
@madjam002 commented on GitHub (Feb 14, 2023):
The operator uses the Tailscale API which appears to be unrelated to the control plane API that Headscale mimics.
I think the only way to support Headscale with the operator is a complete fork or ground up implementation that uses the Headscale gRPC API instead, or for Headscale to also mimic the Tailscale REST API. https://tailscale.com/kb/1101/api/
@kradalby commented on GitHub (May 10, 2023):
This is out of scope for this project.
@samcday commented on GitHub (Apr 10, 2024):
It seems to me that if such an API were to be contributed to the project, it would potentially eat into the moat that Tailscale is attempting to create with their proprietary control plane.
That is, if enough of the Tailscale.com Control Plane API and OAuth provider flow was implemented to support use-cases such as the Kubernetes operator, or the Terraform provider, it might pose a risk to Tailscale.com's bottom line.
I find it quite problematic (ethically, morally) that a salaried Tailscale employee has made the executive decision that this project cannot have such an API implementation.
It seems to me that Tailscale is attempting something of a "embrace, extend, extinguish" approach here. I'd like to know to what extent @juanfont still maintains and oversees this project?
I'm not trying to start a flame war here, I'm just observing what appears to be somewhat bad-faith behaviour from a commercial entity...
More pointedly, why can there not be an open issue in headscale that keeps the door open to folks contributing the bits necessary to implement the Tailscale API that the k8s-operator needs (all two methods)?
I get that Tailscale.com is unlikely to be eager to contribute such a thing, given the points I made earlier. But my understanding is stuff like the OIDC integration in headscale was contributed by kind strangers, who's to say such a thing couldn't happen here?
Just in case this comment gets deleted, if anyone is out there reading this and observes any further suspicious behavior, drop me a line at
me@samcday.com- perhaps it's time to fork this project further from Tailscale.com control and conflict of interest.@almereyda commented on GitHub (Apr 10, 2024):
Yes and no. While I can follow the concern to double the API surface, as highlighted by me in https://github.com/juanfont/headscale/issues/582#issuecomment-2021516764 and someone else in https://github.com/tailscale/tailscale/pull/11627#discussion_r1556230490, I am very confident in and grateful for the resources that Tailscale provide to the Headscale project.
I'm historically not involved enough to understand why the approach of a gRPC API was chosen; maybe just because someone wanted to learn something, but it's hard to argue for more features of a (not-only) voluntary project that is already compatible with the Tailscale FLOSS client to a certain degree.
I'm left wondering under which circumstances and conditions community contributions would likely be able to be accepted. The Vaultwarden SSO PR + temporary fork shows that a long time can go into a soft-fork, before it is of considerable quality for merging to a non-hesitant upstream. Maybe this is a good way to move forward with such feature-ladden work proposals anyway?
Let's not do the soft-fork before 0.23 is released, please ;) Else there's so much backporting work. Watching LXD and Incus dance around each other feature-wise is already rather enticing enough!
@majst01 commented on GitHub (May 15, 2024):
Another possibility would be to write a small api which serves the endpoints the tailscale operator expects, and talks to the headscale grpc api. Still a PR to the tailscale operator is required to make the tokenURL configurable. But as this would be a minimal change without adding extra dependencies, the chances to get this merged are there.
@Lite5h4dow commented on GitHub (Mar 5, 2025):
or we could fork the operator and modify how it auths itself to align with headscale's capabilities, i may be wrong, but i think its just using the oauth provider to authenticate itself and those using it correct? if so, we could just add the auth checks to headscale in some fashion, and re-impliment the self authentication no?
@almereyda commented on GitHub (Mar 8, 2025):
Good analysis. Eventually they would even allow a PR against the operator to support for both operation modes, given that Headscale is an officially sancitonned project by Tailscale Inc.
@Lite5h4dow commented on GitHub (Mar 8, 2025):
While it's sanctioned, they said they won't provide any resources to maintenance, so I doubt they would merge it in, especially since the source project is a mono repo of clients.
@Julien-Delavisse commented on GitHub (Mar 28, 2025):
Hello,
I'd be interested to see this feature in headscale.
If I understand correctly, the tailscale project doesn't want to integrate headscale related code (which makes sense) but would accept to add a parameter to have another authentication server in the kubernetes operator. https://github.com/tailscale/tailscale/pull/11627#issuecomment-2043378813
So headscale would probably have to provide the endpoints expected by the tailscale operator, as proposed by @majst01.
@kradalby why do you say it's out of the scope of the project? Do you want to limit headscale support to tailscale and not to other tailscale-related projects like the operator?
@majst01 @kradalby can you estimate the complexity of the task?
Tailscale and Headcale are good projects, and I can donate 200/300 dollars to fund the work. It's not much but I'm willing to pay 😉
@plsnotracking commented on GitHub (Jun 10, 2025):
I'm kind of interested in a
headscaleoperator, I'm trying to work around it, and see if it's possible.But seems like the missing components to get to a headscale operator is:
It's a long shot, and maybe I'm missing some other components, but could someone educate me on what else could be missing?
More importantly, if a patch of that magnitude
@antoniolago commented on GitHub (Jun 11, 2025):
Also interested in this, tried to use tailscale sidecars but wasn't productive (if anyone got real world working examples I would appreciate), then I tried blindly building the PR mentioned https://github.com/tailscale/tailscale/pull/11627 but it shows empty logs on pod and don't do anything, so 80% of our infra is currently not supported by headscale.
I understand the lack of resources, but just closing this issue shuts the door for people implementing a solution in-tree...
Well, I would use any working headscale instance/operator even if not by official repositories if they integrate our k8s clusters properly.
Edit:
I was able to make sidecar work, it's what I'll be doing now on, but operator would be much better
This allow my service-ms to access subnet routers via IP, but DNS doesn't work properly: