Usactar Soccer World Cup Real-Time System with Linkerd and Kubernetes | Cloud Native Now 2023
In this session, Sergio Méndez demonstrates how students can learn about service meshes and cloud-native technologies using Linkerd in a university setting. During the session, Sergio showcases a university project that used Linkerd for observability and multi-cluster interconnection. The real-time system simulates the comments and analytics for soccer matches in an event called Usactar based on the last World Cup in Qatar. During the demonstration, Sergio will show how this system works, how to observe message queues in Kafka and how Linkerd uses a multi-cloud configuration to distribute components and data around different cloud providers.
Transcript
Welcome to Cloud Native. Now, uh, 2023, I am going to talk a little bit about what we are doing in the university, some break that I want to show you. So my topic is, uh, UAR Soccer World Cup realtime system with Linker and Kubernetes.
Uh, a little bit about me. Well, I am a systems engineer. I am from Guatemala.
I am a operating system professor at the public university here, uh, U S A C. I am also a cloud native Guatemala organizer meetup. Um, I work as a dev engineer at Jello and also a LINKER ambassador and a C N C F ambassador.
And I am the author of age computing system with Kubernetes book with BTI editorial. Uh, let's see a little bit about my university. This is how it looks.
This is my University of Guatemala, a little bit of my students, uh, some, uh, an old picture here, old photo with my students teaching there that I was doing like a test in that moment because let's say that in our country, in Guatemala, like we don't have like a lot of resources in the university and most in the public university to expand in technology or experiments and in the laboratories. So we can take advantage about, uh, the freedom of using open source software. Uh, in this way we can create like pretty awesome brakes without using or paying zero or consuming something that we don't have like, or something that could be so expensive to, to use to create brakes.
So we are getting advantage of open source. My course in the university, in the engineering faculty is like operating systems course. I teach, well distribute systems, uh, processes, the basics of operating systems, virtualization, um, concurrent programming, that kind of stuff.
Uh, that's the content of my course to have a little bit of context about cloud native product use, cloud native technologies. But as you know, uh, there are like four main topics around cloud native, like could be like C I C D containers that maybe the technologies use APIs, 12 factor apps and that things around. So we use cloud native technologies, the ones that empowers organizations to build scalable applications, uh, that use fully and private clouds, containers, service measures, microservices and a lot of things.
That's all the things that cloud native means, the technologies around that and how the application is structured. What, let me explain you about my project. Well, I am the professor of that course.
So let me explain you that the project is collect, collect usar. Well, this is like a fictitious name doesn't exist. It's more based on the past Qatar words, word soccer cup.
It's based on that. The idea is to create a realtime system that gets some information about the different soccer matches. Um, how I can simulate that predictions get information around this tournament.
So that's the idea. Create a real time system. What we are doing, going to use Kubernetes and the concepts of distribute systems, concurrence programming and that kind of stuff.
The main goal, as I mentioned it, is to create a dis root system where the students can explore new technology, new technologies, learn cloud native technologies. During this process of, of working on the project, the technologies, as I mentioned, use open source cloud native technologies. The ones that are around the C N C F ecosystem.
Let's say that C N C F uh, looks, this organization looks for the cloud native technologies around in a specific Kubernetes and technologies that run around Kubernetes. But what kind of technologies we are using in our break around the C NCF ecosystem. Of course we are using Kubernetes, but let me explain you this one.
In this slides world, you are going to look like not a copy paste information is more like what the students canons understanding a easier way. So Kubernetes, KU be like, or platform to create the distributed system. So we are not using Kubernetes as a tool to implement CI I C d, uh, pipelines of that kind of storms.
We are looking to Kubernetes to create that system, uh, how to scale a system. So we are using Kubernetes, use their declarative, uh, definitions to create, um, or somewhere running on the cluster. We are using G R P C, uh, as some of of you could remember that maybe you learn about how the process communicate inside the computer and the things and was like an old style of communication.
Call it R P C. So G R P C is more like a kind of evolution and a model where that evolves from R P C communication in, in the old days, let's say. Uh, so we are using G R P C as a way to communicate containers and pos and that kind of things.
We are using, of course, Docker. Let's say that we turning a little bit here, like Docker is a, is our way to create like a small piece piece of software that is running. But Docker explained you like or gives you the ability to create like a kind of virtual environment that you can use and Kubernetes.
Uh, let's say, uh, let me give you this example is more like, let's say that you have an orchestra and you have different musicians. So these musicians play like a specific instrument, like a Hornet or something like that. And, but you have to organize all, all the musicians in order to hear that beautiful and, uh, harmony in the song.
So you need an orchestrator to organize that musicians. So Kubernetes is the orchestrator, let's call it, uh, the orchestrator. So Kubernetes is going to organize the musician in order to play the song.
If they need more musicians. Kubernetes is going to add more musician or reduce the quantity of musicians. So that's Kubernetes and Dr.
So the students are going to learn about it. As I was mentioned, will G R P C will be like, or wrong way to communicate the processes around the network? A pretty, pretty fast way to communicate.
Linker d will be another concept like using a service mesh, a way to to interact with the networking traffic and do something around this traffic, like maybe communicate multi clusters, uh, get some observability or some metrics around the older metrics like Rico per per second success rate and that kind of stuff. So link this going to help us with that and the students are going to learn around it. Locus is a simple tool to, uh, perform traffic load testing.
So Locus is, is more Python oriented. So you are going to create like kind of script around PI using Python, and you're going to create that load test with Python. So Locus is really, really nice.
It's also open source because, uh, let's say when you are learning concurrent programming or operating systems, you are going to tackle a little bit with Q messages and how to manage messages and that kind of stuff. So Stringency could be like an easy way to install Kafka. That is a software that can manage messages and that kind of stuff.
So Stringency is a, uh, Kubernetes operator that you can use to install Kafka in your cluster in an easier way. So for the students, that's great to simplify their lives. And the last piece is the NoSQL databases, because they are like the last thing or the new kind of stuff that right now is revolution in databases.
I am, we are using two kind of databases here, MongoDB as the document oriented database, and the red is a key value database in order to, to get information, get some metrics and everything. And because it's a realtime system, no SQL has their own space here. That's the reason to choose Mongo and Redis.
Here, I want to clarify that this parade is more like just an experimentation stuff to learn new technologies and concepts around cloud native and, and distribute systems. So for this parade, I I also love that the students can play with cloud providers, but the problem could be like, I don't have budget to to spend of cloud providers. So we choose Google Cloud because give us like free grades to play around in our product.
And Azure has a small trial trial, but it's enough to use be use it in our product. That consistent two clusters in different providers. So as I mentioned, no money.
So we use that free credit from the cloud providers. That's the reason to don't use right now AWS because doesn't have like a kind of free tire on the e ets, uh, service or at least it's too expensive. Orders us.
Well, so let's move to the distribute system design, how it's organized it the last year, this was like the arena break a little bit more complicated that the, that the break that we are working right now. So let's move to the new evolution, this break. So something that is pretty interesting, I was working on the break by myself, get my hands dirty on this break.
So what happens? I took this break and I got that kind of evolution here. This is the new way to create our break.
It's more simplified, more basic concepts and more easy to learn these new technologies. So let me explain you, what is this break about? We have two clusters.
The Kubernetes cluster on Google Cloud in the left side, in the right side are the service around Microsoft. Uh, we are basically using, uh, Kubernetes a k s, uh, Azure cluster and how it works. Let's say that there is a user in the step one, uh, that is, uh, performing some network traffic or simulating that somebody or a lot of users are writing to the system.
So Loki Locus is going to create this load testing simulation and is going to be received by a load answer in our Google Google cluster. And this load balance answer is forwarded traffic to the a, uh, rest a p i made using Go the result. A p i is going to get the information and is going to push the information on a Kafka queue call it matches.
Yeah. So we are going to produce the, uh, with this event at, uh, information that a queue or a topic in Kafka is going to receive in the step number two. In the step number three is going to be another services, another service that is going to be listened to the topic match.
Every time that this um, topic is going to receive the information, there will be a consumer made with Go with with Go, uh, Kafka consumer that is going to read the information here and is going to send the information information using the G R P C protocol, let's say. Or, or that's, that is going to be our way to send information this G r PC client that is going to send information captured. But inside this topic queue, uh, on Kafka is going to get information as is going to send information to a se uh, G R PC server in the other cluster, but is going, uh, in Kubernetes is going to mirror this service in the other cluster as we are working in the same cluster.
So they are like a multi cluster connection there. So it's going to send information to this G R PC server. And finally this G R PC server is going to serve the data already in parallel is going to send information to MongoDB two like, uh, log information.
And finally in the step number seven, that's maybe the same, same client or the student is going to, uh, check the graph dashboard that is going to check the information about Readis, right? So that's basically how the, the, the break was structured. Summarizing send information with Locus and A P R A P R REST is going to receive the information, is going to put information in the topic.
And another service is going to get the information from this PO topic and is going to send information using G R P C to the, to the other service in the other cluster. Li Li like the other service lives in the same cluster using that, that mirroring service that linker give us. At the same time, it's going to send information to MongoDB.
And finally we are going to show the information in a Grafana dashboard, uh, querying inside Ready. So let's is more, because the previous pro break was like more complicated using like different manager cloud provider service that cloud run and that kind of stuff. Here I want to mention that I am using the the Manager Service Cosmos db.
That is an Azure service service that deploys a MongoDB service and Ready cashion. That is basically a, a managed service of ready on Azure. So let's is more so the summary, what the students are going to learn in this project.
Let's list what they are going to learn. Containers, they are going to learn containers, docker, distribute systems with Kubernetes. They are going to learn how the, the process communication, uh, in the network using G R P C and go programming or the go programming language, Kafka message queues, service measures, and multi cluster communication using a service mesh, in this case linker db cause it's pretty, pretty easy to use.
And, um, no SQL database and low testing, low low testing using, uh, locus. So right now, well let's go, uh, a walkthrough around our EC is, okay, locus is running right now. Here is the, the GitHub repository that contains all the common lines or the c l i common lines that I am using here to run my stuff.
So the first step is run Locus to simulate the traffic. So once you have Locus is going to open you a dashboard, uh, with this information, how many users, um, uh, how, how many concurrent users, let's say, and an endpoint, uh, this endpoint, um, is part of the, of the services of Kubernetes is this endpoint that exposed the public a p i that is going to receive the information. And let's start with the traffic simulation.
Let me show you something here. Uh, let me see. Okay, here I have like, like the light log, let's say in this side is the log of the api.
In this side is the service that is consuming, consuming the, or receiving the, the rest a p i information and is going to insert in the, in the, in the Kafka tube and is going to send information using G R P C. And this one is going to receive the information in the other cluster, right? So let's run the simulation part.
So right now it's like sending information. As you can see, this thing is receiving the information and here is a Grafana dashboard that is changing on real time about the information that is receiving. Here are the different matches that is like getting right now on real, on real on real time.
How many matches are, are right now the messages, processes, processes to receive this information. And another way to show this, um, pie chart, but using some bar chart, let's say. So right now it's like receiving all the information using Locus.
And the cool stuff is like you can see the information real time. Well, the big challenge here is like you can simulate like hundreds of users at the same time, but because of of demo purposes, I am going to limit that simulation to, to assimilation. Not too heavy for my platform right now, but that's the goal.
The, the goal of my, my platform, let's say. So. But you can see Locus is doing its work right now.
It's like sending information and you can see some charts about how this thing has as is sending information and how the different services are receiving information here. Uh, how the Grafana dashboard is like showing information on real time. So it's like a kind of maybe a little bit complicated to understand how it's going to work.
Locus receiving is sending the traffic to one cluster that has some service that puts the information of Kafka. So let's say that the system doesn't have the enough capacity to, to read the information. So in order, or depending on the capacity of the PO to read the information inside the topic is going to process information.
For example, if I stop the Kafka tube, this thing is going to still receiving information because has some kind of lag or delay to process information because they have like a lot of messages there. But you have to process, uh, asynchronously, let's say, and there is some delay in on that information, but it's like showing close to real time information that is being processed in the Mongo site. You can see, uh, how many messages are processed here.
And let's say for example, right now there are 100 and and 61 messages here, and it's going to be still refreshing because some of the evaluation that I am doing, uh, right now, uh, some messages generated are discarded. So maybe it's not like some, sometimes the same information about the, the, the information that is granting on Mongo just for log purposes, let's say could be like more or less pretty similar than the information that is showing here in the, in the graph dashboard. And some data is discarded because of a prevent, uh, duplicate matches, let's say between Qatar, bs, Qatar.
And that doesn't make sense, right? So I am like removing, uh, duplicated or invalid kind of matches here. So let me show you a little bit the code or let's continue to, to with the simulation.
Maybe let's a, a little bit the the concurrence on the system. So you are going to still watch how the information is processed, right? And you are going to reflect, uh, the change here in the, in the matches, right?
Um, so this is how the things are moving here. So let me show you the, the code a little bit. So we have like, well we have Jamal configuration, the a p i, we have like the consumer configuration one for the, some of the deployments are configured on Azure and another ones on Google, right?
The consumer, how I implemented the Grafana dashboard. I am using the Redis, uh, plugin to read information on Redis. So you can see here, for example, if I edit, uh, the dashboard is going to check this team's counter variable using the HCA all command already.
And I have like different, uh, kind of values that I am querying on the dashboards, for example, I am querying here the messages and it's going to show this thing almost in real time, right? So, uh, another thing is like, well, the code, the deployments and everything that I have here, the, the go code here, the, the Locus configuration to simulate the matches on Python. So I just go on Python and, uh, the, the consumer of Kafka, all the code in this repository and also the, let me see the G R PC server, the G r PC server code that is going to insert the things already, right?
So all the things that you can see here, all the code is in the repository and you can experiment a little bit with with it. And finally, let me show you the, the Linker D dashboard. So Linker D is going to show you, um, now how the information is moving, like the success rate, the latency, um, under request per second.
It's not like, like too much. You can also install the, the Grafana plugin for this to get the information and it's going to show, you can also take a look. As you can see this information is changing or, or real time.
You can just grafana to visualize that information. And you can also use the linker c l I. So that's in general how the project, uh, works and the challenge for the students to learn new technologies.
But they are going to experiment, like create like car how concurrent systems like social networks are working inside. To end my presentation, I'm going to invite like people from Latin America while I speak Spanish. Um, I want to invite, uh, the people that speak Spanish to Clan Guatemala, part of the C N C F groups, the links of of the community that are we created there.
And we are like hosting the, the KC Guatemala that is a, uh, event around Kubernetes, but is hosted locally in Guatemala, is going to be online and one day online. And the second one will be a, a hybrid, uh, event. com.
You can register there it is for free and well, because I wrote that book here is the link if you want to explore my book a little bit. It is like explaining distribute systems, both oriented to h computing applications and using Kubernetes and running Kubernetes at the edge, let's say Kubernetes inside, uh, raspberry Pi. The repository of this, uh, demo is like, is this one cloud native now 2023, the repository that we use in the university.
Maybe if you want to contribute around this project or give ideas or to share different projects between universities, maybe you can contact me on this repository creating an issue or maybe you can, uh, contact me on social networks, the slides of this presentation or here and well, my personal contact is like Sgio, A G P L on Twitter, my website. And you can also check, let's say on LinkedIns, Sergio Menez and whatever social network that you have. So thank you very much for this opportunity.
And that was my presentation called, uh, USAR Soccer World Cup Realtime System with Linker and Kubernetes. So thank you very much.





