(Justin)

Tech nerd from Sweden

Matrix: @jlh:jlh.name

  • 0 Posts
  • 101 Comments
Joined 2 years ago
cake
Cake day: June 10th, 2023

help-circle





  • Yeah, what you’re talking about is called GitOps. Using git as the single source of truth for your infrastructure. I have this set up for my home servers.

    https://codeberg.org/jlh/h5b

    nodes has NixOS configuration for my 5 kubernetes servers and a script that builds a flash drive for each of them to use as a boot drive (same setup for porygonz, but that’s my dedicated DHCP/DNS/NTP mini server)

    mikrotik has a dump of my Mikrotik router config and a script that deploys the config from the git repo.

    applications has all my kubernetes config: containers, proxies, load balancers, config files, certificate renewal, databases, clustered raid, etc. It’s all super automated. A pretty typical “operator” container to run in Kubernetes is ArgoCD, which watches a git repo and automatically deploys any changes or desyncs back to the Kubernetes API so it’s always in sync with git. I don’t use any GUI or console commands to deploy or update a container, I just edit git and commit.

    The kubernetes cluster runs about 400 containers, most of them just automatic replicas of services for high-availability. Of course there’s always some manual setup steps outside of git, like partitioning drives, joining the nodes to the cluster, writing hardware-specific config, and bootstrapping Argocd to watch git. But overall, my house could burn down tomorrow and I would have everything I need to redeploy using this git repo, the secrets git repo, and my backups of my databases and container /data dirs.

    I think Portainer supports doing GitOps on Docker compose? Never used it.

    https://docs.portainer.io/user/docker/stacks/add

    Argocd is really the gold standard for GitOps though. I highly recommend trying out k3s on a server and running ArgoCD on it, it’s super easy to use.

    https://argo-cd.readthedocs.io/en/stable/getting_started/

    Kubernetes is definitely different than Docker Compose, and tutorials are usually written for Docker compose.yml, not Kubernetes Deployments, but It’s super powerful and automated. Very hard to crash once you have it running. I don’t think it’s as scary as a lot of people think, and you definitely don’t need more than one server to run it.





  • Yeah, my main concern is visiting US customs as a US citizen, there they can’t (legally) punish US citizens for not unlocking their phones, aside from a few hours dentention/“enhanced interrogation”.

    Not sure what the laws are in Sweden and Denmark, where I usually fly into the EU from, but usually they don’t search phones at borders. Swedish police are more inclined to just look you up in the residence database and get a warrant for a home visit, I believe.

    Other countries would risk a diplomatic incident from Sweden if they used force to make me unlock my phone 🤷











  • Yeah, I think you pick up things from all over the place as a consultant. I see lots of different environments and learn from them.

    Ah yeah, external-dns operator is great! it’s maybe a bit basic at times but its super convenient to just have A/AAAA records appear for all your loadbalancer svcs and HTTPRoutes. Saves a ton of time.

    That’s super unfortunate that the certs are siloed off. Maybe they can give you a NS record for a subdomain for you to use ACME on? I’ve seen that at some customers. Super important that all engineers have access to self-service certs, imo.

    Rook is great! It definitely can be quite picky about hardware and balancing, as I’ve learned from trying to set it up with two nodes at home with spare hdds and ssds 😅 Very automated once it’s all set up and you understand its needs, though. NFS provisioner is also a good option for a storageclass as a first step, that’s what I used in my homelab from 2021 to 2023.

    Heres my rook config:
    https://codeberg.org/jlh/h5b/src/branch/main/argo/external_applications/rook-ceph-helm.yaml
    https://codeberg.org/jlh/h5b/src/branch/main/argo/custom_applications/rook-ceph

    Up to 3 nodes and 120TiB now and I’m about to add 4 more nodes. I probably would recommend just automatically adding disks instead of manually adding them, I’m just a bit more cautious and manual with my homelab “pets”.

    I’m not very far on my RHCE yet tbh 😅 Red hat courses are a bit hard to follow 😅 But hopefully will make some progress before the summer.

    The CKA and CKS certs are great! Some really good courses for those on udemy and acloudguru, there’s a good lab environment on killer.sh, and the practice exams are super useful. I definitely recommend those certs, you learn a lot and it’s a good way to demonstrate your expertise.