DevOps dude, self-hoster, space nerd.

  • 0 Posts
  • 7 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle
  • You like deploying infrastructure, probably in a cloud environment, but you don’t want to push a bunch of buttons in their web interface, so you use Terraform to declaratively define the things you want, and it goes and builds them for you. Super useful for when you need to build resources often, to detect and correct config drift, and get started down the path of Infrastructure as Code.




  • rs5th@lemmy.scottlabs.iotoChat@beehaw.orgTest Post
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    Here’s a cronjob to clean up the useless activity table every day:

    
    apiVersion: batch/v1beta1
    kind: CronJob
    metadata:
      name: postgresql-cleanup
      namespace: lemmy
    spec:
      schedule: "0 0 * * *"
      jobTemplate:
        spec:
          template:
            spec:
              containers:
              - name: postgres-cleanup
                image: postgres:alpine
                command: ["psql", "--host=postgresql", "--dbname=postgres", "--username=postgres", "--command=DELETE FROM activity WHERE published < NOW() - INTERVAL '1 day';"]
                env:
                - name: PGPASSWORD
                  valueFrom:
                    secretKeyRef:
                      name: postgresql
                      key: postgres-password
              backoffLimit: 0
              ttlSecondsAfterFinished: 3600
    
    



  • I’m running a Kubernetes cluster on the Dell hardware, then another single node k8s cluster on the Lenovo, mostly to run Adguard home / DNS in case the big cluster goes down for whatever reason.

    Hardware:

    • Two Dell r610s, each with 12 cores and 96 GB of RAM, running ESXi 6.7
    • Lenovo M900, 4 core, 16 GB RAM, Ubuntu and k3s
    • Synology 1515 with 12 TB usable
    • Synology 1517 with 32 TB usable
    • Juniper SRX 220H (Firewall)
    • Juniper EX 2200 48 port switch
    • UnFi in-wall WiFi APs

    I run the following services, all in Kubernetes, with FluxCD doing GitOps from a repo in GitHub (for now, might move to Gitea later):

    • Authentik
    • Bookstack
    • Calibre
    • Flame (Homepage)
    • Frigate NVR
    • Home Assistant
    • Memos
    • Monica
    • Plex
    • Prowlarr
    • Radarr
    • Rocket Chat
    • Sonarr
    • Tandoor
    • Tautulli
    • Unifi
    • UptimeKuma
    • VS Code
    • Zigbee2MQTT