Bossy Lobster

A blog by Danny Hermes; musing on tech, mathematics, etc.

Edit on GitHub

How Do Slices Gain Capacity in Go?

Looking Inside a Slice

The first thing to realize is that a slice in Go is really just a struct that wraps "header" information about (1) a pointer to the "real" underlying data, (2) the length and (3) the capacity without directly exposing those fields. We can use a struct …

Edit on GitHub

Difference Between localhost and 0.0.0.0

Note: In a docker container, a server can only be available outside of the container / pod if it is bound to the "any host" IP1. Binding a server to localhost / the loopback IP2 will mean the server is only reachable within the container / pod.

Consider the following Express …

Edit on GitHub

Isolating (Cordoning) a Misbehaving Pod

TL;DR: You can remove a misbehaving pod from a service without deleting it. Use kubectl label pod ... cyberdyne-service- ... to remove a label / labels. Once the labels are gone it will be removed from the Kubernetes service that routes traffic to pods.

When a Kubernetes node is misbehaving, it's common …

Edit on GitHub

ADDR vs. HOST

TL;DR: Prefer inclusion of the protocol in configurable environment variables

VAULT_ADDR=https://vault.sandbox.invalid:8200

over

VAULT_HOST=vault.sandbox.invalid

since this enables targeting a local server, e.g. http://localhost:8200 without any code changes.

We utilize sandbox, staging and other siloed environments to test changes before …