Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A few years ago, while helping build a platform on Google Cloud & GKE for a client, we found the same issues.

At that point we already had a CRD used by most of out tenant apps, which deployed an opinionated (but generally flexible enough) full app stack (Deployment, Service, PodMonitor, many sane defaults for affinity/anti-affinity, etc, lots of which configurable, and other things).

Because we didn't have an opinion on what tenant apps would use in their containers, we needed a way to make the pre-stop sleep small but OS-agnostic.

We ended up with a 1 LOC (plus headers) C app that compiled to a tiny static binary. This was put in a ConfigMap, which the controller mounted on the Pod, from where it could be executed natively.

Perhaps not the most elegant solution, but a simple enough one that got the job done and was left alone with zero required maintenance for years - it might still be there to this day. It was quite fun to watch the reaction of new platform engineers the first time they'd come across it in the codebase. :D



An executable in a ConfigMap? That's interesting.

I realized somewhat recently I could put my Nginx and PHP ini in a config map, that seems to work ok. Even that seems a bit dirty though, doesn't it base64 it and save it with all the other yaml configs? Doesn't seem like it's made for files


> doesn't it base64 it and save it with all the other yaml configs

It does! It's mountable in the filesystem though. In this case, the data key is the filename, and its un-base64'd data, the file contents.

> Even that seems a bit dirty though

As I mentioned in the previous comment, "Perhaps not the most elegant solution" :D

It's been maintenance-free for years though, and since its introduction there were 0 rollout-related 502s.


Yeah, it's been working for me too! Feels weird but if it works it works I guess




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: