This post is the fifth part of the series about Kubernetes for beginners. In the fourth part , I started to write about the Kubernetes Swiss army knife: kubectl . I covered ways how to find the components you are looking for. In this episode, I’ll show you how you can gather more information about Kubernetes components, focusing on status and logs. This can be useful when debugging your…
This post is the fourth part of the series about Kubernetes for beginners. In the third part , I wrote about services(SVC) and horizontal pod autoscaler(HPA). This post will introduce you to the Kubernetes tool: kubectl . Also, all examples were shallow so far; to get you started with Kubernetes, you need to get a feeling of the K8s and their components. In this episode, I explain the connections…
This post is the third part of the series about Kubernetes for beginners. In the second part , I introduced the K8s and its basic components. In the second part, I discussed containers, pods, and deployments. This post will discuss services(SVC) and horizontal pod autoscaler(HPA). In this short post, I will discuss how to expose your services to the outside world and scale your applications based…
This post is the second part of the series about Kubernetes. In the first part , we introduced the K8s and its basic concepts. Before you start creating services or scaling apps, it’s essential to understand the core components of Kubernetes. This post walks you through pods, containers, and deployments—what they are, how they work, and how they come together to keep your apps running…
Diving into the world of Kubernetes doesn’t need to be intimidating. This post will explain Kubernetes, why it matters, and how it fits into the modern application landscape. By the end, you’ll understand its core purpose and how it can make your development life more manageable. The target audience for this post is developers who are new to Kubernetes or those who work on a product…
Motivation If you are a developer, you know how much time you spend on pull request reviews. We all try to write the best code we can. When we are done, we ask our team members to review our code. Sometimes, making a pull request is more complex than it sounds. Over time, teams learn that pull requests need to be standardized to speed things up and improve communication. That is why we have a pull…
This post is the fourth part of the series about using Terraform to manage GCP resources. In the first part , I did a basic setup of the project: remote state file, state file encryption, a bucket creation. In the second part , I created VPC and subnets and added some basic firewall rules and VMs. In the third part , I added more VPC, subnets, firewall rules, and VMs. In this part, I will refactor…
This topic is nothing new. There are many articles and tutorials on the internet about this. I’ll be setting up a Terraform project to explore GCP. I cover the basics of Terraform and GCP. Warning
So, after spending time moving from Make to Task , I decided. I’m going with Task in my future projects. Make will not be removed from my projects immediately, but I will not use it in the future. Let me tell you why. All this is my personal opinion. I’m not saying that Task is better than Make . I think that Task is better for me. Global Taskfile I have a global Task in my home…
Recently, I stumbled upon a tool called Taskfile . It is a task runner, similar to Makefile, but with many improvements. I decided to try it and see if it can replace my Makefiles. Why Taskfile? First of all, Makefile is a good tool. Today, you can use it on any platform, not just Linux. It is a standard tool for running tasks. It is flexible and powerful. My relation with it is love/hate. It can…
I set the stage for learning eBPF . As mentioned in the previous post, eBPF is a technology that allows us to run code in the kernel. This is a compelling technology, but it comes with a few limitations. One of them is that we can’t use the standard output to print messages. At least not directly. Let’s explore how we can do this. Why can’t I use the standard input/output?…
For a while, I’ve been following stuff around eBPF, and it is very promising. What I just wrote is an understatement. At first glance, eBPF is bringing many new possibilities to our toolbox. You can start with performance profiling, tracing, security, networking, etc. But let’s start from the beginning. By the way, I’m doing this on OSX. For eBPF, you need Linux kernel 4.1 or…
Recently Docker brought some new stuff that I found very useful for developers. They are still in the experimental phase but are already very useful. Try them and give your feedback to the Docker team. The code I’m using for this is available here . Let’s start… Init Writing a Dockerfile when starting with a new application is tedious. Why? Because we are repeating most of the…
I live and work in one of the Balkan countries, Belgrade, Serbia. After the sad ’90s, all countries in the region try to catch up with the rest of the world. That led to a boom in IT. A large portion of IT is outsourcing companies. Some companies are domestic, and some are foreign. Also, some companies opened their R&D centers in the region. Small and big as well. There was and still is a…
After building a Docker image faster , I wanted to build it for the K8s cluster. Running the container on the local machine isn’t the same as running it on a cluster. I’m packaging a Go application in my example. But the same principles apply to any other language. Starting Dockerfile I’m starting with the following Dockerfile(Dockerfile_1): ARG GO_VERSION = 1 .20.3 FROM…
During building services, we often need to build docker images. We do it multiple times a day. It can be a time-consuming task. Locally we only notice it a little, but in CI/CD pipelines, it can be a problem. In this post, I will show you how to speed up the process. I will show you how to use a cache, layer your Dockerfile, and use multi-stage builds, to make your builds faster.
As a developer, when working on a service, you face a problem with the working environment. And when I say working environment, I do not think about IDEs, stacks, OS, libraries, etc. I’m thinking about the environment where our services live. These days, our services are usually packed inside some container and put in some kind of distributed system. Most containers and other moving parts are…
This post is a follow-up to the previous posts on designing metrics for event-driven systems . This humble post is a practical example of how to implement the metrics API and how to use it to create a dashboard in Grafana. I’m not using Kubernetes but Docker Compose; the concepts are the same. The reason is simplicity. The code is available on this GitHub repository . The Scenario The setup…
This is the third part of a series about designing metrics for event-driven systems. You can check the first part and the second part of this series before proceeding. While I discussed the general principles of designing metrics in the first part, I explained Prometheus metric types in the second part. I applied them as the RED method in the second part. In this article, I’ll explain the…
This is the second part of a series about designing metrics for event-driven systems. You can check the first part of this series. Prometheus is open source system for monitoring and alerting. It is a part of CNCF (Cloud Native Computing Foundation) and it is one of the most popular monitoring systems. You can say it is a de facto standard for monitoring in Kubernetes. To design metrics with…
Event-driven systems at the moment are dominating when it comes to software system design. Some of the characteristics of event-driven systems are asynchronous actions and eventual consistency . In traditional systems, each call will produce an immediate response. While in event-driven systems(EDS) the response is not immediate but it is made when the system is ready to process a call. The EDS is…
A Pod would be the smallest deployable unit one can create and manage inside Kubernetes(K8s). In practice, rarely you create a Pod directly. Instead, one would create a Deployment, a StatefulSet, a DaemonSet, a Job, or a CronJob. These are higher-level constructs that would create Pods for you. Here I’m covering common tasks that one would do with a Pod in daily work, like getting logs,…
When a service works with a database its core is tied with the database schema. Usually, that means that service models are represented in the database. Usually as tables, but not necessary. Anyway, from that comes a requirement to update database schema when the core of service is changed. If you version your service then you should version your database schema as well. For this purpose, the…
While developing application and using docker-compose one question quickly arise: How to properly rebuild application? Once an image is built new one will not be built with the same tag as long it exists in a local cache. The compose builds an image it names it with the pattern <context>_<service_name>:latest . Where: Context is directory name where compose YAML is Service is service name in…
If you are developing microservices, docker-compose(compose), can be a very powerful tool. Think of a case with an API service and database. Creating and maintaining a database with the use of the Liquibase . Initial plan …would be: start DB run the Liquibase to make changes start an app Adding docker-compose as a driver to utilize this process: sequenceDiagram autonumber Docker -->>…
Working with containers is a necessity today for developers. You will likely need to work with some kind of storage or interact with some external service, like Solr or Postgres. You can install the required service on your local machine, which comes with the burden of choosing the correct installation, configuration, etc… Nothing too complicated but takes time. Docker and Containers In…
Everyone wants to play with the Kubernetes(K8s). There are many options from Google, AWS, Heroku, etc. They offer free tiers that anyone can play with. But what if you want to have your K8s. On your laptop, for fun or to learn something new, without any restrictions. What is k3s The K3s is lightweight k8s by the rancher for Linux. K3s is intended to work with low resources and IoT devices. So, it…
I’m keeping notes in simple text files. Imho, this is a straightforward solution that I can control. I need to be able to version my changes and to keep backup as well. For that, I’m using git. But I have to make commits and push changes periodically. I’m delegating this simple, dull, and repetitive toil to the crontab . Crontab ..is a file used by cron . It is a time-based job…
A simple problem: Rename files with extension xyz which names ends with file . They need to start with document- and have extension txt For example if a file is 1-file.xyz it should be renamed to document-1.txt From this: > ls -al total 0 drwxr-xr-x 12 owner staff 384 Jan 1 19:26 . drwxr-xr-x 7 owner staff 224 Oct 23 11:32 .. -rw-r--r-- 1 owner staff 0 Jan 1 19:26 1-file.xyz -rw-r--r-- 1 owner…
Hello friend, I’m a simple guy who loves computers and technology. Here I’m spilling all my thought about software, computers, technology, and work culture. I’m sharing things that I worked on. If you are interested subscribe to not miss new posts in the newsletter and on my website. If you like it please share and let me know. If you do not like it let me know why. I am especially passionate…