Marcin Jasion - Pragmatic DevOps
  • Home
  • About
  • Skills
  • Experiences
  • Accomplishments
  • More
    Presentations Recent Posts
  • Posts
  • Notes
  • Dark Theme
    Light Theme Dark Theme System Theme
  • Posts
  • Cloud
    • Terraform Logs
    • Terraform Parallelism
    • VPN
  • Kubernetes
    • Golang Leader Example
    • Istio
  • Development
    • Cloudflare + TanStack
    • Blockchain
    • Gitlab
Hero Image
Implementing Leader Election in Golang using Kubernetes API

Introduction Leader election is a crucial pattern in distributed systems where multiple instances or nodes compete to perform certain tasks. In a Kubernetes cluster, leader election can be used to ensure that only one instance is responsible for executing leader-specific tasks at any given time. This blog post will explore how to implement a leader election mechanism in Kubernetes using lease locks. Overview The leader election mechanism implemented in Go code relies on Kubernetes coordination features, specifically Lease object in the coordination.k8s.io API Group. Lease locks provide a way to acquire a lease on a shared resource, which can be used to determine the leader among a group of nodes.

  • golang
  • kubernetes
  • distributed-systems
  • leader-election
Sunday, June 25, 2023 | 4 minutes Read
Hero Image
How to debug Istio Upstream Reset 502 UPE (old 503 UC)

Istio is a complex system. For the applications, the main component is the sidecar container Istio-Proxy, which proxies all traffic from all containers in Pod. And this can lead to some issues. This post describes one of the most complicated problems I have encountered in my career. The problem - Connection Reset 🐛 During Istio rollout on a huge system, with more than 40 different microservices, on a single endpoint, QA engineers found a bug. It was a POST endpoint, which was returning chunked data.

  • istio
  • kubernetes
  • debugging
  • networking
Monday, April 25, 2022 | 5 minutes Read
Navigation
  • About
  • Skills
  • Experiences
  • Accomplishments
  • Presentations
  • Recent Posts
Contact me:
  • hello@mjasion.pl
  • mjasion
  • Marcin Jasion

Toha Theme Logo Toha
© 2026 Copyright.
Powered by Hugo Logo