You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may implement this myself, so consider this a tracker.
Essentially I want to be able to locally access kubernetes services (in an already secured cluster) within the security of Tailscale. We have a ton of corporate services that are currently acessed with "kubectl port-forward", using tailscale would streamline this a lot (dns and no command line).
My preference goes to having a tailscale identity (IP) per services you wish to expose to the network. This can be achieved by having an operator that watches LoadBalancer Services. If they are labelled with "tailscale: true", the operator creates an identity and a proxy deployment that terminates the tailscale traffic for that identity, routing the traffic to the actual service.
What would be the best way to handle identity in this setup?
Reacted by Dmitri Fedotov, Justin Head, Anthony Dodd, Michael Davis, leowmjw, Bradley Wright, katia ⋆╶⃝⃤, Craig Weber, Nikolay Kolev, coffenbacher and 62 more
Reacted by Justin Tamblyn, Haris Sulaiman, mugi, Emre Kaşgür, Luis Eduardo Brito, Olanrewaju (Larry), Jonathan Yu, Tiago, Florian, Rafal Skolasinski and 6 more
Reacted by Em Karisch, Devin Buhl, Justin Tamblyn, Luis Eduardo Brito, Tiago, Le Anh Duc, Vlad Ionescu, Rafal Skolasinski, James Qualls and Srikanth
We're not going to work on this just yet, blocked on #504. The questions you're asking are exactly the ones we need to answer before building a Kubernetes operator, and we haven't thought about it at all yet. If you're interested in building this yourself, you're welcome to experiment with the tradeoffs and see what works best in the k8s ecosystem.
Can you perhaps provide a bit more detail in #504 at the issues that you are facing with containerization, the potential solutions and why they are not immediately solveable?
This feature would be absolutely amazing, imagine using Tailscale for cross-cluster resource access 🥇
There is money to be made here Tailscale, please take my money.
Reacted by Michael Cristina, Aaron Janse, Christopher Blanchard, Florian Forster, Ahmet Alp Balkan, Holegots, James Qualls, rbq, Spencer Nelson and kwekewk
We recently deployed Tailscale on our k8s cluster, we had to tweak our CoreDNS config a bit, but right now, when DNS is enabled, you can do something like curl http://<svc name.<namespace>.svc.osig.lan.
It's pretty minimal and doesn't come with cross-cluster connection or per-service settings like requested above. My colleague @alex-richman-onesignal is writing a blog post on it, pinging him to share the story once published.
Reacted by Cory Jacobsen, Joel Small, Aiman Ismail, James Qualls and kwekewk
I'd be very interested to learn exactly how you did it and if there were any issues. I'm currently working through an implementation myself @niels-s@alex-richman-onesignal
@niels-s how did you get your pods to talk to the MagicDNS Server in first place?
My bad, I must have been doing something weird last time I tried it, I can totally hit IP Addresses from inside Kubernetes if the host is running Tailscale.
So I got MagicDNS working inside Kubernetes(K3S, Ubuntu 20.04), all I did was a simple edit to the ConfigMap for CoreDNS to prepend a new server just for beta.tailscale.net forwarding everything to 100.100.100.100(the nameserver IP of all users in the Beta) like this:
beta.tailscale.net:53 {
loop
cache 10
forward . 100.100.100.100
}
// ... the rest of the CoreDNS config file...
And that's all I did, I was able to use MagicDNS from any pod in the cluster.
Now that with this setup, you can use MagicDNS only with FQDN such as <hostname>.<tailscale-domain>.beta.tailscale.net.
If you want to use just the hostname and have it resolve to tailscale MagicDNS, one approach would be to just use forward . 100.100.100.1000 in your .:53 server but I wouldn't recommend that since it may mess with the resolution of other services in the networking your cluster might depend on.
Reacted by Wesley Fantinel, Emre Kaşgür, Dan Miller, Jake Edgington and gruberdev
Activity
danderson commentedon Jun 24, 2020
We're not going to work on this just yet, blocked on #504. The questions you're asking are exactly the ones we need to answer before building a Kubernetes operator, and we haven't thought about it at all yet. If you're interested in building this yourself, you're welcome to experiment with the tradeoffs and see what works best in the k8s ecosystem.
toonsevrin commentedon Jun 24, 2020
Once I do need this, I'll implement it myself :)
Can you perhaps provide a bit more detail in #504 at the issues that you are facing with containerization, the potential solutions and why they are not immediately solveable?
Thank you very much!
zfogg commentedon Jun 9, 2021
i really want to see this. please do it
bithavoc commentedon Jul 8, 2021
This feature would be absolutely amazing, imagine using Tailscale for cross-cluster resource access 🥇
There is money to be made here Tailscale, please take my money.
niels-s commentedon Aug 5, 2021
We recently deployed Tailscale on our k8s cluster, we had to tweak our CoreDNS config a bit, but right now, when DNS is enabled, you can do something like
curl http://<svc name.<namespace>.svc.osig.lan.It's pretty minimal and doesn't come with cross-cluster connection or per-service settings like requested above. My colleague @alex-richman-onesignal is writing a blog post on it, pinging him to share the story once published.
enigmatix commentedon Aug 9, 2021
I'd be very interested to learn exactly how you did it and if there were any issues. I'm currently working through an implementation myself @niels-s @alex-richman-onesignal
bithavoc commentedon Aug 9, 2021
@niels-s how did you get your pods to talk to the MagicDNS Server in first place?My bad, I must have been doing something weird last time I tried it, I can totally hit IP Addresses from inside Kubernetes if the host is running Tailscale.
bithavoc commentedon Aug 9, 2021
So I got MagicDNS working inside Kubernetes(K3S, Ubuntu 20.04), all I did was a simple edit to the ConfigMap for CoreDNS to prepend a new server just for
beta.tailscale.netforwarding everything to100.100.100.100(the nameserver IP of all users in the Beta) like this:So my config map now looks as follows:
Once I saved the config file, I reloaded the CoreDNS pods so they pick the new config map:
And that's all I did, I was able to use MagicDNS from any pod in the cluster.
Now that with this setup, you can use MagicDNS only with FQDN such as
<hostname>.<tailscale-domain>.beta.tailscale.net.If you want to use just the
hostnameand have it resolve to tailscale MagicDNS, one approach would be to just useforward . 100.100.100.1000in your.:53server but I wouldn't recommend that since it may mess with the resolution of other services in the networking your cluster might depend on.231 remaining items
cmd/containerboot: reapply known args on restart
cmd/k8s-operator: handle changes to services w/o teardown
cmd/containerboot: add support for setting ServeConfig
cmd/k8s-operator: support being the default loadbalancer controller
cmd/k8s-operator: put Tailscale IPs in Service ingress status
cmd/k8s-operator: update RBAC to allow creating events
cmd/k8s-operator: add matching family addresses to status
cmd/k8s-operator,ipn/store/kubestore: patch secrets instead of updating
cmd/containerboot: fix broken tests
cmd/k8s-operator: add metrics to track usage
cmd/k8s-operator: rename egress annotation
cmd/k8s-operator: fix egress service name (tailscale#9494)
cmd/containerboot: add iptables based MSS clamping for ingress/egress…
cmd/k8s-operator: fix reconcile filters (tailscale#9533)
cmd/k8s-operator: operator can create subnetrouter (tailscale#9505)