Race Conditions In Golang

This post is the second in my series of articles on Concurrency in Go. In this post, we’ll understand what a race condition is, the why and how of it, and finally, we see some code that creates a race condition, and then we will learn to fix that race condition with the help of Mutexes. So let’s get started! The What, Why And How Of A Race Condition A race condition in Go occurs when two or more goroutines have shared data and interact with it at the same time....

May 24, 2021 · 6 min · Arsh Sharma

Concurrency In Golang

I recently started learning more about concurrency in golang and so as with other things I learn, I decided to write about it. This article will be a part of a short series I plan to write about concurrency in Go. So let’s get started! Concurrency Vs Parallelism Before we start looking at some code, I think it would be better to know what concurrency actually is. But even before we do that let us first talk about parallelism because it is a word that often comes up when talking about concurrency....

May 19, 2021 · 5 min · Arsh Sharma

Pod Health With Liveness Probes

Kubernetes relies on Probes to determine the health of a Pod container. A probe can be understood simply as a periodical diagnostic performed by the kubelet on the container. In this short article, I’m going to show you a liveness probe in action. Liveness probes are used to check if a Pod is healthy (running as expected) or not. It simply acts as a check for Kubernetes to know when it should restart the container....

May 13, 2021 · 3 min · Arsh Sharma

kubectl exec Is So Cool!

I recently learned about kubectl port-forward and kubectl exec, and I was amazed by what simple but cool stuff you could o with just these two commands when getting started with Kubernetes. So that’s what this post is going to be about. Running Our Pod I’m going to use minikube to launch my cluster but feel free to use whatever you like. Once you have your cluster up and running (using minikube start), create a nginx pod using:...

April 29, 2021 · 4 min · Arsh Sharma

Creating A CLI In Golang

This is technically the first post on my blog so I’m pretty excited to write this one 😄 For the last few months, I’ve been working on depstat, which is a command-line tool to analyze dependencies, as part of my CNCF Internship. I’ve had a blast working on this especially because of the welcoming community. depstat is going to be used to evaluate dependency updates to Kubernetes and has been written in Go so I thought about sharing some stuff I learned :D...

April 17, 2021 · 5 min · Arsh Sharma