August 16, 2020 | 19:17

Deploy long-running tasks on Kubernetes

Whilst reading this extremly detailed and well written article about how graceful shutdowns work on Kubernetes. It touched on the subject of long running tasks. When we update the deployment inside of Kubernetes, it will start by deleting a pod with the old version of the image, and starts a new pod with the new version. The pod can be attached to a service it might be the case that the pod is removed from the service before the process/pod has finished. Read more

August 1, 2020 | 21:38

Docker Export vs Docker Save

Docker Export The export takes a snapshot of the container file system and export it’s as a tarball, all container layers are flattened. Any metadata about the entry point is lost, such as ENTRYPOINT and CMD. You can run docker import to create a Docker image from that tarball. Docker Save Creates a tarball on the image and not the container so all the layers are saved, and any metadata around it such as ENTRYPOINT. Read more
#TIL | #Go

July 21, 2020 | 20:03

Go Trace Shortcut

You can use the go trace tool to look at the CPU traces to see how your program is behaving for example. package main import ( "fmt" "os" "runtime/trace" ) func main() { f, err := os.Create("trace.out") if err != nil { panic(err) } defer f.Close() err = trace.Start(f) if err != nil { panic(err) } trace.Stop() fmt.Println("hello") } When you run the program you will see a new file trace. Read more

July 14, 2020 | 07:04

Systemd Drop In

At work, I was debugging an issue where it was failing to update the systemd configuration to the new installation path. By default, systemd service definitions go under /etc/systemd/system/name.service. There are cases where you as an administrator have no control over the service generated. So how do you override a service configuration without overriding the original service or the service definition from scratch? Systemd has a functionality called drop-in units where you can write parts of the service definition and it will override it. Read more