Skip to content

thetillhoff/infra

Repository files navigation

infra

The vision One place to rule them all

This repository contains several subfolders - each for its own tool:

  • .github: Contains Github actions, which call terraform and ansible with their respective folders.
  • pulumi: Contains IaC code for DNS, and infrastructure workloads like VMs. It also contains a base setup for Kubernetes on Talos, up to the point where FluxCD starts.
  • ansible: Contains additional configuration management which terraform is not intended for.
  • kubernetes: Contains kubernetes manifests like helm charts and kustomizations.

The tools

Pulumi

Pulumi configures the whole cloud setup. There are some tasks around its usage in the Taskfile.yml of this repo.

Ansible

Ansible is currently configured to run from the target system itself. So clone this repo, and check the ansible/README.md.

It can also be run from another machine in the same network via SSH. Check out the config in ansible/blackhole.yaml for insights on what needs to be adjusted.

Packer

Packer is used to create the images for the cloud. Check out the packer/README.md.

Kubernetes

The Kubernetes distro of choice is talos. Some prerequisites are installed directly via pulumi, but the actual Kubernetes manifests are deployed/synced by FluxCD.

FluxCD

FluxCD directly syncs with this repo and deploys what's configured to that specific k8s cluster under kubernetes/<clustername>/.

Secrets

Secrets are always stored in files. These files are encrypted with SOPS. FluxCD has an integration with it and there's a nice cli-tool for it. The underlying encryption is using AGE.

The encryption is configured in the .sops.yaml. Use sops edit <filename> to view and edit it in plaintext. To encrypt/decript in place use sops encrypt -i <filename> and sops decrypt -i <filename>, respectively.

Default keys can be configured in ~/.config/sops/age/keys.txt with one private age key per line. A private key can be set temporarily with export SOPS_AGE_KEY=<value> or SOPS_AGE_KEY=<value> sops ....

Storage

Rook was too complex and had too harsh requirements for a homelab. Longhorn is used for storage in kubernetes. Bare-metal ZFS is used and configured via ansible for the snowflake-storage-server blackhole.

The hostpath provider could be used to integrate zfs with k8s if needed.

Apps

  • tailscale as vpn
  • samba as file-share provider
  • stash as on-prem movie UI

Logs

Metrics

Tracing

Backup

Certificates

VPN / Auth

TODO

Maintenance

  • Ansible modules
    • tailscale
  • System -> manual apt-update && apt-upgrade -y
  • Kubernetes
    • infra
      • flux
      • ingress-nginx
      • cert-manager
    • apps
      • link-shortener caddy version
      • umami, umami-mariadb -> currently latest, but never pulled again
      • vaultwarden
  • Pulumi
    • Provider
  • Secret rotation TBD

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •