My Kubernetes cluster finally has Grafana Logging
Vložit
- čas přidán 21. 02. 2024
- My Products
📖 ProjectPlannerAI: projectplannerai.com
🤖 IconGeneratorAI: icongeneratorai.com
📝 ThumbnailCritique: thumbnailcritique.com
Useful Links
💬 Discord: / discord
🔔 Newsletter: newsletter.webdevcody.com/
📁 GitHub: github.com/webdevcody
📺 Twitch: / webdevcody
🤖 Website: webdevcody.com
🐦 Twitter: / webdevcody
For educational purposes, consider adding tracing as well. Setting up tracing with OpenTelemetry is not hard, and Grafana offers another service called Tempo for traces. Video about OpenTelemetry could be awesome
That could be useful I’ll look into it
OpenTelemetry is amazing. Built some POCs on it at work. Definitely integrate it into this. Sure, it’s a lot of ops/devops/cloudy related stuff but like you said, best way to learn it or at least know about it for the future is building something with it
I don't know what he'll be tracing. His sample app revolves around 2 services and one of them is RabbitMQ. You should deploy a whole microservice based app to appreciate tracing. I'd prioritize metrics first.
Hope you do it! I'm trying to setup something similar in my nodejs project with Jaeger
Nice! I'm also setting up Grafana for my docker swarm cluster
oh my god welcome cody, why do i say welcome?? 😂😂, you've poked the devil called "home lab", with all this bare metal stuff that you do nowadays, you have kubernetes now, you've got grafana for analytics, loki for log collection, FANTASTIC, now you also need traefik reverse proxy for your services and setup SSL certicates, go get an actual servers, a router/firewall combo, a switch, a fiber line, setup some subnets and vlans, do port mirroring to collect internet traefik for analysis, have a proxmox cluster and now you are done. 😂😂. This is amazing, idk what magician cast a spell on you to try out stuff like this because you swore you'll never touch baremetal!👋👋👋
Someone said I’m just a frontend engineer, so I have to spread my wings
@@WebDevCody you are very humble
Loki is great. You can do structured logging and filter by key-value. Pretty much what you'd get with ELK stack, but more efficient. There's also Grafana Tempo for tracing.
Your video is awesome, isn't it? I can see your progress and the curiosity you have to move to a broader level, not just focusing 'solely' on application development but also scaling to production on an IaaS. Are you also planning to implement Terraform soon, haha :)
Ha nah I won’t be implementing terraform 😂
You're along the right lines of using consistent hashing but atm your lookup logic is O(N) but this can be enhanced with something called the chord protocol which allows you to store like a table of lookup information to improve this. Next if you are using a lot of nodes you will experience a thing called hot and cold regions. Basically at this point you are reinventing dynamodb or Cassandra. Cassandra actually has some great docs on things like tombstoning, distributed writes etc.
Also I would like to add what you've managed to learn and build in a couple of nights is truly amazing and clearly shows you have a wealth of experience and arent just some "frontend" guy. Fair play cody you've earnt my respect
Thanks man, I want to keep exploring these concepts, it’s been fun. Right now I’m struggling to figure out node to node communication. I may look into write ahead logs as well instead of my current store .json file approach.
@@WebDevCody Node to node communication can be done by using kubernetes services
Cool!
hey cody, which ui libraries do you often use or is it just shadcn?
Just shad right now
In this world, too many smart people. I can’t even use docker 😩
CODY PLEASE TELL ME HOW YOU GOT GOOD AT THIS HARD DEV OPS STUFF I FIND IT SO HARD
Chatgpt and read docs
@@WebDevCody THANK YOU SO MUCH
It's not hard really, but it requires a lot of reading and can be quite tedious and boring. It's rather necessary though unless you have someone else on a team dedicated to cluster telemetry.
You should look up some consensus algorithms If you haven't done it yet
I read about PAXOS and Raft, they sound confusing 😂
@@WebDevCody you chose to do distributed storage not me 😭😉
@@hansiboy5348 😂 I was thinking of doing a primary - replica type of setup for my shards. I think that will be an easier first step. Would that still require a consensus algorithm? So user writes to cluster, cluster proxies to primary, primary writes to disk, primary also proxies to replica node, return response to user. Then I’d just need to add some type of failover strategy to promote the replica to primary if the primary can’t be reached. I’m not sure on that part 😂
@WebDevCody This is a reasonable approach. You can also make the primary db for writing and the other replicas for reading.
You might get into some trouble when the primary db dies and the rest of the cluster needs to have consensus about the new leader. The naive approach would be for every replica to speak with every other replica. This approach will work and could be cool to see implemented, but as you can imagine it won't scale that well.
Good luck!
Hello test
hello