Traefik is too complex and hard to understand... let us discuss
HTML-код
- Опубликовано: 10 сен 2024
- I discuss my journey learning Traefik in order to make a video about the topic. Every time I go back to docs I end up starting over again because I don’t know where to start and because of how many abstractions there are it makes the learning curve steep.
🏭 Backend Engineering Videos
• Backend Engineering (B...
💾 Database Engineering Videos
• Database Engineering
🛰 Network Engineering Videos
• Network Engineering
🏰 Load Balancing and Proxies Videos
• Proxies
🐘 Postgres Videos
• PostgresSQL
🚢Docker
• Docker
🧮 Programming Pattern Videos
• Programming Patterns
🛡 Web Security Videos
• Web Security
🦠 HTTP Videos
• HTTP
🐍 Python Videos
• Python by Example
🔆 Javascript Videos
• Javascript by Example
👾Discord Server / discord
Become a Member
/ @hnasr
Support me on PayPal
bit.ly/33ENps4
Become a Patreon
/ hnasr
Stay Awesome,
Hussein
My Traefik video is completed and uploaded check it out! (1 Hour worth of content) Traefik Crash Course - Architecture, L7 & L4 Proxying, Weighted Round Robin, Enabling TLS 1.2/1.3
ruclips.net/video/C6IL8tjwC5E/видео.html
I get that “I had to start all over again” feeling so hard when trying to learn Traefik.
The CEO of Treafik reached out on twitter and helped clarified some concepts to me, interesting thread really. He managed to summarize the product in a single tweet which is what the doc should have done. Still, they admit the doc needs work that is probably what caused my confusion. I gotta commend the efforts of Emile discussing and clarifying the product with me and admitting the doc needs work. You don't see many CEOs like this.
twitter.com/hnasr/status/1291162377392730115
I’m glad I’m not the only one who find Traefik difficult to use, I have spent a few months reading the docs, blogs and many examples and materials on the web trying to understand it, I’ve tried many of the examples but it just wouldn’t work, it’s just too damn complicated. I ended up not using it at the end, so I feel like I have wasted so much time on trying to make it work.
I think that all software development suffers from this problem. Someone sets out to solve a problem, but as they become more expert in the subject they see more and more opportunities for abstraction. The more they abstract the more opportunities for further abstraction arise. Perfection is finally achieved when the universe of people who can understand all the abstractions has been reduced to that perfect number of one -- themselves.
Well said
I tried to learn how to use Traefik and I actually said exactly the same thing in their IRC:
"I'm not sure I've understood what Traefik is for".
They assured me that I was at the right place but damn... 2h to make a simple Hello-World docker-compose on a local network. And I don't remember how I did it at all. So you're definitely not alone there. Nice video.
I like the honesty of this video and how clear you explain some of the struggles of making something work. Some of these tools are very abstract and seem way too complex for a simple use case.
It's not just you. I have been struggling with the most basic configuration of Traefik (shame emoji), and it's been an absolute waste of time. The doc being broken into very tiny pieces with few to no full and working examples for different use cases, means hammering so many random configurations together, praying for them to work out, and being to totally confused and disappointed. And because the version has changed it is very difficult to find a clear point of reference.
And . . it's such a simple goal. I'm going to try Caddy.
Love this rant. I thought something was wrong with me for not feeling Traefik. Keeping it simple (for my simple use case).
The biggest problem for me was the documentation. It assumes too much about your understanding of the system
I'm so glad for this video becauae I was starting to think I was crazy for not getting it. I'm just starting to dip my foot into hosting my own home server and have been struggling for weeks to try and get this to work. Even though everything else has been straight forward.
Traffic is easy. It's a bit to setup but once it's on it's amazing. Adding new services is a cinch. Just use docker container labels.
The power of traefik is auto config. If you have a services running in a docker or k8s environment, traefik is king ;-)
To add a docker service to traefik is just a couple labels to the service, and traefik is handling the rest. If you have a k8s running on a airbnb scale, you don't want to add all running instances manually to your reverse proxy, right?
With traefik, scaling a docker/k8s service, don't need any config to traefik, it will be automatically loadbalanced.
If you once setup right. (the hardest part of the job).
I've just gone through a couple days of trying to use Traefik, and I finally figured out why the documentation is so unusable. It comes down to two things: assumption and organization.
Assumptions are hard problem in writing documentation. Doc writers are usually those most familiar with the project, which unfortunately means they are likely to go without saying things that "go without saying". Imagine an intro to chess that shows all the ways to capture pieces but somehow never explains what happens when a piece is captured. That's what the Traefik docs are like. For example, the naming of objects (routers, services, etc.) is not mentioned until you get to the last section of the Routing & Load Balancing "chapter". So how is the first-time reader supposed to know which elements are keywords and which are user-defined names when show things like:
- "traefik.http.routers.api.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=[...]"
Why should it even cross the reader's mind that some of the left-hand substrings are user-defined? Things like "api" and "auth" could easily be predefined keys. Well, they're not, but "loadbalancer" and "basicauth" _are._ Yet there is no guidance to the reader which is which. It's simply _assumed_ the reader knows.
Organization is the other big issue. Information has to be where the reader _expects_ to find it. When the reader goes looking for something, the first place he or she will likely look is the table of contents. In this case, the side menu is the Traefik doc's TOC, and it is _horrible._ Every time the TOC is unclear means another step in a depth/breadth-first search, and every iteration is another instance of both confusion and frustration. Just look at the sections in that menu. Not _one_ of them maps directly to either static/dynamic config or to top-level keys. So if you're editing the static config file and want to check something in the serversTransport key, where do you look? What about hostResolvers? Or experimental? There's no way to tell, and it's a total fustercluck.
There's even a section called "User Guides". Mahfucka, _this whole thing_ is supposed to be a user guide. If it weren't, then it wouldn't have the "Getting Started" section, ffs. And that's the thing. Whoever is writing this can't decide what kind of thing it's supposed to be. Is it a reference manual? Is it a textbook? Is it an introduction to reverse proxies? What _is_ it? Make. Up. Your. Mind.
/rant
heh, I started to dig in to selfhosting and of course reverse proxy decision came and as traefik was often recommended I went for it. I am not really web or programmer guy, more like sysadmin, and I thought - "yeah, this shit is difficult, but I guess its all complicated subject..." so I started to write guide as I learn because no fucking way I am going to remember in 2 months what is what and how. Tiny steps.
github.com/DoTheEvo/Traefik-v2-examples
Then after feeling comfortable with my reverse proxy, literally the first serious thing I tried to setup was a ticketing system called Helpy. Instructions talked about dealing with caddy file, so I google wtf is caddy... bam simple reverse proxy written in go. I have quick look.. god damn, no more dynamic and static, no more labels polluting all my compose files, no more jumping through hoops to get https and redirects, no more traefik for me.. hello caddy... and thats how I integrated it in to my whole selfhosted setup guide
github.com/DoTheEvo/selfhosted-apps-docker
Still thanks for the repo man, saved me for my work
I agree.... I am now learning Traefik, but I am having a hard time "bending it to my will"
Sounds like Traefik is to Nginx as Kubernetes is to Swarm. In some ways, each solves problems similar to the other, but the first does a lot more...if and when you need to solve those different problems. (Like you, I'm open to being corrected by someone with experience with both...or in this case, all four, to gauge my comparison.)
I think Traefiks Scatter Brain logo also represents their documentation. I found it confusing but its starting to click. Its important to understand Kubernetes.. because traefik is stateless and derives its configuration from annotations in k8s.
I love this video, its hilarious and after 4 days banging my head against a wall with Kubernetes provider and Traefik and ingressroutes I can relate to all your comments in this video... Yaml, Toml, abstractions, providers, services, routers, hahaha, omg hilarious. Traefik rocks but it as you say its got a learning curve and the docs are a little too abstracted :-)
As someone who was new to nginx and trafic relitivly recently(2 year dev, new to both) , imo, all the points you bring up in traefik occur in nginx. The only difference is that the default nginx install has a good standard config to compare against, and more stack overflow questions and examples. Overall I still honestly prefer traefik. It feels simpler to me.
Please, record a video about envoy proxy
I'm using Traefik v2 and it felt a bit complex to deploy at first indeed although it seems to me so far pretty robust/solid stuff once it works but I kinda regret to haven't give a try to Caddy 2 before using Traefik v2... could it be "better" somehow ?
I had the same feeling with documentation, but I didn't had problems make the configuration using Docker, do you had experience using Traefik on production?
I totally agree with you about the complexity of Traefik! I have been struggling with it for more than 2 weeks to transfer a dev environment of Apache2 php mySQL in Docker containers managed by Traefik. Now it’s done, I just realize it’s such a pain to get the real IP address of the client passing trough Traefik! I am just wondering if I am about to start all over again and feel so discouraged about it!
You are a good speaker.
Hey, I can understand your struggels, but I think you approaching traefik from the wrong direction, you will mostly use it with dynamic configuration anyways,
thats why I think you should start with a simple docker-compose stack with a docker provider or if you understand the HashiStack well, you can get even more visual and from there build your self down to the file config level.
For the static config use command line arguments on your docker-compose/docker/nomad whatever file it is way easier at first.
For dynamic, use just labels in you docker environment or for example in nomad inside the service stanza use tags to let Consul find its way.
If you fucked up just do a compose down or nomad job stop and start it over, dont have to play around with mounts and stuff.
Thats just my oppinion, I am open for any criticism and discusson about this topic in any ways :D
I'm trying to do the nomad setup you have mentioned. Would you mind taking a look at my configuration in this ticket? github.com/traefik/traefik/issues/7591#issuecomment-733976793
@@MarvinBlum I'm gonna be honest with you pal, I never tried to use nomad+traefik without auto expose, yet I think the last comment (github.com/traefik/traefik/issues/7591#issuecomment-734275821) should be the cause, anyways the comment was posted literally right before I made mine :'DD
@@shikamaru676 Turns out I had to explicitly set an ACL token to make it work. As he said in the video: it always feels like you're starting over from the beginning.
Is Envoy in the same niche? Say Envoy much faster than traefik.
Watch this video at 2x to hear him speak in normal pace but move at 4x.
Thanks for being here and being continous 🙏
Yes seems too complicated. I'm very worried of going down the Traefik road.
Traefik is the opposite of KISS. The dashboard is so incredible useless. And when things are not working it's horrific to debug. It's sad really. The only thing it has going for itself is the "configure everything via labels".
I like caddy. A shame that the dynamic service discovery requires more work than it should.
Rancher might be a good follow up to this. No comment.
Textras interesting never heard of it. Added it to the list
@@hnasr They were just acquired, but essentially helps you deploy K8's cross-cloud. They have been *pushing Traefik the past year or so we've noticed, and they are promoting themselves as an easier container deployment and orchestration system, so relates to this video somewhat.
nginx rev proxy was a pain to try to get setup, but I got it working in a week. Primarily issue was with my network and port forwarding set up properly, so in part that is a fault of mine and not theirs (albeit the basic concepts of port forwarding in relation to server setup, that info should be more prominently taught somewhere), but once that was cleared up, it wasn't too hard to set up
traefik looks cool, but trying to switch has been a pain. It shouldn't be so hard to just set up a basic website + backend server. Most examples have letsencrypt cert, which is cool, but I have that cert and don't want to acme check everytime. I just want to use the cert letencrypt already created for me. It ~should be a simple here's my cert, here's my hostname, now work. It's quite annoying that this basic, basic use case is giving me the trouble it is. It's fine for software to be flexible and complex, but the basic use case shouldn't be so hard to set up. The complexities should be reserved and set far apart from a basic reverse proxy use case set up. Adoption of the tool is going to be hindered until these companies get better at this.
I have the certs, it's not picking it up. It's not even routing to the hostname.
my verdict is not complete, but so far it's been annoying trying to get traefik setup. That or better official tutorials. Copy paste tutorials and 'blackboxing' it too much is only useful if it works, every time, with little or no changes (acceptable changes include domain name, pws, etc). If not, then it fails whenever you have an issue, since the blackbox is a double edge sword for when bugs/issues arise.
Thank you for the video.
I am also struggeling with Traefik.
Can you recomment a reverse proxy for the use with docker-compose?
Traefik
Nginx Proxy Manager
If you thought this was tough, try envoy for a challenge.
Hi, so cool&perfect 👌🙏
I am fucking normal
Right.. junk lost of time...
GenX