Posts tagged: kubernetes

All posts with the tag "kubernetes"

33 posts latest post 2026-03-23
Publishing rhythm
Mar 2026 | 2 posts

Today I learned that docker creates an empty /.dockerenv file to indicate that you are running in a docker container. Other runtimes like podman commonly use /run/.containerenv. kubernetes uses neither of these, the most common way to detect if you are running in kubernetes is to check for the presence of the KUBERNETES_SERVICE_HOST environment variable. There will also be a directory at /var/run/secrets/kubernetes.io/serviceaccount that contains the service account credentials if you are running in kubernetes.

Like a dufus this morning I did a hard reset on a git repo for getting I was working on a manifest for. You see I generally use argo, but occasionally I have no idea what I am doing or want yet and I start raw doggin it, fully aware that I’m going to just nuke this namespace before getting it into a proper argocd.

I was overjoyed when I found out that you can diff your manifests with live production using the kubectl diff command. It uses standard diff so you can bring all your fancy diff viewers you like.

# regular manifest kubectl diff -f k8s/shots -n shot # kustomize kubectl diff -k k8s -n go-waylonwalker-com # using a fancy diff viewer kubectl diff -f k8s/shots -n shot | delta # using an even fancier diff viewer # pinkies out for this one kubectl diff -f k8s/shots -n shot | delta --diff-so-fancy

Now I can get those changes back that I thought I lost, and apply updates with confidence knowing what is about to change.

Kelsey has a really good lightbulb moment here about platform engineering.

“if you had to do all the deployments for the entire company what questions would you ask of the development team?”

That’s your api, your platform, this is your product as a platform engineer. It’s not images, docker, terraform, hcl, yaml, kubernetes, It’s building out the right api for your company to deploy its products effectively.

https://www.youtube.com/watch?v=HdUbTyvrfKo&t=429s

...

I learned to today that setting MEMORY on your minecraft server causes the JVM to egregiously allocate all of that memory. Not setting it causes slow downs and potential crashes, but setting INIT_MEMORY and MAX_MEMORY gives us the best of both worlds. It is allowed to use more, but does not gobble it all up on startup.

In this economy we need to save all the memory we can!

Here is a non-working snippet for a minecraft server deployment in kubernetes.

containers: - name: dungeon image: itzg/minecraft-server env: - name: EULA value: "true" - name: INIT_MEMORY value: "512M" - name: MAX_MEMORY value: "3G"

and in docker compose

The k3s system-upgrade controller is a fantastic tool for upgrading k3s automatically. It has done a fantastic job for me every time I’ve used it. Today I ran it on a cluster that needed to upgrade several minors and I learned that the controller does not pick up on changes to the channel url if you change from minor to minor.

The solution I came up with was to name the plan with the version it supports. Then on each patch upgrade, change both the plan name and the channel. I use gitops with argocd, it automcatically cleaned up old plans, created new plans, and the system-upgrade-controller picked up the plan and started applying immediately.

# Server plan apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: name: server-plan-v1.33 # <- This is important if you want to change the channel name namespace: system-upgrade spec: concurrency: 1 cordon: true nodeSelector: matchExpressions: - key: node-role.kubernetes.io/control-plane operator: In values: - "true" serviceAccountName: system-upgrade upgrade: image: rancher/k3s-upgrade channel: https://update.k3s.io/v1-release/channels/v1.33 --- # Agent plan apiVersion: upgrade.cattle.io/v1 kind: Plan metadata: name:...

Should I kubernetes My Homelab

Yes

Ok we should probably dive deeper into this, but good chance if you are here and have made it this far you it would probably be a fine choice. The choice is quite time and skill dependant.

First thing up, if you like copy pasting thing into your homelab, changing a few config options, but mostly running it as the docs instructed, kubernetes is not for you. The homelab/self hosting space is heavily reliant on docker compose, 90% of the things you want to run will likely have a docker command, and likely a docker compose example that you can copy paste and get running right away. Maybe 5% of projects have something for kubernetes, you Will have to do it yourself.

...

Sometimes, all you need is a mindset shift, a blocker in your mind that holds you back from doing certain things. And for me, I have consumed enough tutorials and posts about Kubernetes, that I need to put to use and create. I have been stuck in the learning cycle, lets push to prod with kubernetes.

This hurts. I know others with this learning style that need to see the full picture before actually doing something with new tech. The way I first got into kubernetes I was looking for the easy route and somehow k8s came up several times as a suggested route Looking for a Heroku replacement, What I found was shocking!, So I dove in head first with k3s and

...

This post feels like it was written by someone who has never tried kubernetes, someone who reads twitter, listens to t3.gg and thePrimeagen (who cant even container let alone kubernetes). If you cant run linux, use bash, build your own docker images, run docker comfortably. If infra is not your thing kubernetes is probably not for you.

Kubernetes Was Built for Google

Just like how react was built for facebook to solve facebook problems with many teams contributing effectively to the same interactive interfaces. Turns out that react is actually a pretty good product if you have a highly interactive page, and if this is your bread and butter, you can make overly heavy static sites with too much build very effectively. It works and runs much of the internet now.

We are getting serious. We need serious tools. Big companies use Kubernetes. We should too. It feels more professional. It sounds like we know what we are doing.

...

just fucking use kubernetes

You want to run containers?

JUST FUCKING USE KUBERNETES.

Shut up. Close twitter and fucking do something. Life is complicated. You know what else is complicated? Email. DNS. Life. Kubernetes is the least painful way to orchestrate containers at scale. Docker Compose is for your laptop.

...

If you need to target a specific k8s node in the cluster, you can use labels. You want to treat your nodes as much like cattle as you can, but sometimes budgets get in the way. You might be like me and just run any free hardware you can get in your cluster, or you might have some large storage or gpu needs that you can’t afford to put on every node in the cluster.

kubectl get nodes --show-labels # add the bigpool label kubectl label node k8s-1 bigpool=true kubectl get nodes --show-labels # remove the bigpool label kubectl label node k8s-1 bigpool-

To use the label in a pod set spec.nodeSelector to the label that you applied.

Kelsey says several times in this interview, you don’t need kubernetes. If you are running one node you don’t need kubernetes. My question though is, would you use kubernetes? Ya I get it if you are a web developer, data scientist, backend dev, but if you are looking to bee a whole ass engineer, or infrastructure engineer, you know kubernetes, Should you use kubernetes on single node?

After first setting up a new k3s instance your kubeconfig file will be located in /etc/rancher/k3s/k3s.yaml.

You cans use it from here by setting $KUBECONFIG to that file.

export KUBECONFIG=/etc/rancher/k3s/k3s.yaml

Or you can copy it to ~/.kube/config

cp /etc/rancher/k3s/k3s.yaml ~/.kube/config

If you have installed k3s on a remote server and need the config on your local machine then you will need to modify the server address to reflect the remote server.

...

I’ve started leaning in on kubernetes kustomize to customize my manifests per deployment per environment. Today I learned that it comes with a diff command.

kubectl diff -k k8s/overlays/local

You can enable color diffs by using an external diff provider like colordiff.

export KUBECTL_EXTERNAL_DIFF="colordiff -N -u"

You might need to install colordiff if you don’t already have it.

sudo pacman -S colordiff sudo apt install colordiff

Now I can try out kustomize changes and see the change with kustomize diff.

kubectl dash k

Kubernetes ships with a feature called kustomize that allows you to customize your manifests in a declarative way. It's a bit like helm, but easier to use. I...

1 min