Skip to content

Latest commit

 

History

History
130 lines (104 loc) · 3.57 KB

README.org

File metadata and controls

130 lines (104 loc) · 3.57 KB

My new infrastructure repository

In this repository resides the configuration for my new homelab and some of my VPS hosts.

Technologies used:

  • NixOS for the declarative OS and service configuration
  • deploy-rs to deploy my NixOS configuration
  • Terraform for the automated DNS and OVH configuration
  • Backblaze for the cheap object storage
  • Ansible for imperative configuration management with tasks, roles, etc.
  • OKD is an OpenShift (Kubernetes) distribution without license requirements
  • Ovirt and Ovirt Node is used on my single server to host my Kubernetes deployment

TODO: https://plantuml.com/nwdiag

Table of contents

Initial configuration

Configuring the VPS

  • Create a VPS at $HOSTING_PROVIDER
  • nixos-infect the VPS

Configuring Terraform

Enter the shell with nix run .#terraform-fhs to get access to all the required variables and to be able to use the terraform-provider-b2.

All required secrets keys are public in the appropriate SOPS file in secrets/ (but not their values).

  • cd terraform && terraform init

SOPS Cheatsheet

$ sops -i secrets/cloudflare.yaml
edit stuff in $EDITOR
:wq

File is encrypted inline
$ sops exec-env secrets/some-file bash
bash-4.4$

Terraform

The Terraform state is managed outside of the repository in a B2 bucket.

Terraform needs to be run from the FHS provided in the flake default package because the Backblaze B2 provider extracts a binary embedded in its binary and the paths needs to be =patchelf=d.

nix-shell will spawn you in the FHS with the required packages for the Terraform B2 plugin to work.

Backblaze

Documentation about capabilities: https://www.backblaze.com/b2/docs/application_keys.html

Retention settings for the dovecot email bucket: 30 days

Kubernetes

Applications

This requires the kustomize-sops plugin. This plugin is automatically exposed in the flake shell.

To encrypt a secret: sops -i -e k8s/something/overlays/prod/secrets/some-secret for instance.

NixOS

Deployment

Using deploy-rs, deploy .#mouse --auto-rollback=false for instance.

Modules

I host different services on my NixOS VMs.