Skip to content

Instantly share code, notes, and snippets.

View yuchaoran2011's full-sized avatar
🏠
Working from home

Chaoran Yu yuchaoran2011

🏠
Working from home
View GitHub Profile
@jdegoes
jdegoes / DynamoDB.scala
Created April 24, 2020 16:58
ZIO DynamoDB
package zio.dynamodb
import java.io.IOException
import zio.{ Chunk, Task, ZLayer }
import zio.blocking.Blocking
/*
~~GetItem~~
WriteItem

We together covered a handful of concepts in the last three posts about knowing, conceptualizing, and understanding pod eviction. As I said, in my first post that it's a complicated topic, and I would like to suggest that if you are reading this post first, please read all the below-listed posts before reading this one.

Although I highly recommend to go through the posts as mentioned earlier but still, for the time-sake or as a refresher, we are going to revisit the concepts quickly; please feel free to skip the section if you already went over the posts or have a fai

Again, like last time, I am starting this post by acknowledging & thanking the appreciation for my previous posts on pod-eviction. This post is the third one on pod eviction.

In this post, we are going to cover the pod priority class, pod disruption budget, DaemonSet and the relationship of these constructs with pod eviction. Okay, enough of talking, let’s start with pod priority class.

PriorityClass and Preemption

PriorityClass is a stable Kubernetes object from version 1.14, and it is a part of the scheduling group used for defining a mapping between priority class name, and the integer value of the

I will start this post by acknowledging the appreciation for my last post; This post is in continuation to my previous post, here is the list of post.

Let's first quickly revisit the understanding from the last post; pod QoS class determines which pod will remove first from a node in-case of eviction by Kubelet. There are three types of QoS classes, i.e. Best Effort, Burstable & Guaranteed and among them Best Effort pods will evict first, following Burstable pods second and at last the Guaranteed one.

In this post, we are going to cover node resources, what causes eviction, what are soft and hard threshold signals. Let's start with node resources.

Node resources

It was the second day of the long weekend; I was watching Money Heist on Netflix (a good one to watch, free recommendation by a human), and in-between, I got the slack notification on one channel, "Is something wrong with our application?" By the time I will start my MacBook to check, another slack message "application is not running, pod status says Evicted." Luckily, the application was in a pre-prod environment, but we want pod up & running. It looks like an effortless task; restart the pod, right? We did, pod evicted again in some time. The application code was simple and shouldn't be consuming many resources of the K8s cluster. Frankly, before this, we haven't encountered such an issue, and we weren't sure about the solution, and there start a saga of pod eviction resolution. Eviction is a complex topic, many factors, objects and policies involved; Let's get started with basics and slowly building the related corresponding concepts. In this first post, I am targeting to cover the pod phase, status,

@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x