Implementing Non-Trivial Containerized Systems (Part 2): Containerizing With Docker

This is the second part of a multi-part series on designing and building non-trivial containerized solutions. We're making a radio station using off-the-shelf components and some home-spun software, all on top of Docker, Docker Compose, and eventually, Kubernetes.

In this part, we're going to take the architecture we cooked up in the last part, and see if we can't get it running in containers, using nothing but Docker itself.

Today, we're going to build a radio station. We drew up the architecture in our last post:

Roll up your sleeves, we're gonna start building some containers.

Implementing Non-Trivial Containerized Systems, Part 1: Picking Components

So, you want to start a radio station, eh?

This is the first part of a multi-part series on designing and building non-trivial containerized solutions. We're making a radio station using off-the-shelf components and some home-spun software, all on top of Docker, Docker Compose, and eventually, Kubernetes.

In this part, we're going to explore how the different parts of the system interface with one another, to set the stage for our next post, where we Dockerize everything!

I first met Icecast (https://icecast.org/) when I worked at a web-hosting startup around the turn of the millennium. One night, one of my co-workers and I had the crazy idea to load a bunch of audio files on the networked file server and stream them to our workstations. We could listen to music while we worked 90+ hours a week. Strange times. After realizing it wasn't as simple as exporting .ogg files over HTTP, we found Icecast (and its pal, Ices2) and built a rudimentary, local-network broadcast radio station.

Silly Kubectl Trick #10: Cleaning Up After Yourself

If there's one thing that Kubernetes makes easy, it's creating resources – pods, deployments, volumes – before long you'll have tons of them lying around.

Eventually, you'll want to tear some of them down, to free up CPU, disk, and RAM for your next wild experiment.  This happens to us all the time in our research clusters, and we've picked up a few tricks:

Silly Kubectl Trick #8: Data Extraction With JSON Path

kubectl can pull a lot of data about our deployments and pod.  Most of the time, we humans are the recipients of that information, and kubectl obliges by nicely formatting things in pretty tables.

Shell
 




x


1
$ kubectl get pods
2
NAME                        READY   STATUS    RESTARTS   AGE
3
frontend-64d9f4f776-9fzp8   3/3     Running   0          14s
4
frontend-64d9f4f776-flx58   3/3     Running   0          15s
5
frontend-64d9f4f776-lftdc   3/3     Running   0          15s
6
frontend-64d9f4f776-mrhq6   3/3     Running   0          15s


Ah yes, I see the pod is now called "... FIXME ..."

In my experience, the very next command that I run  needs that auto-generated Pod ID, something like kubectl logs or kubectl exec.  The first couple of times, you'll use the pasteboard – highlight the pod name with your mouse, Cmd-C, and you're off to the races.  By the third, fourth, or fiftieth time, however, you'll be wishing for a better way.