project-management-only/home-tv-station#7: Kubernetes Manifest



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.1
Created: 03-Aug-24 16:25



Description

I think I'm about ready to set up an instance which isn't running on my laptop.

The intention has always been to drop it into my k8s cluster, so it's probably time to define what that should look like.

As we haven't published a public image yet, I'll temporarily push one into my local registry



Toggle State Changes

Activity


assigned to @btasker

mentioned in commit sysconfigs/bumblebee-kubernetes-charts@e45a277cf445be21a6aec62545d82701a55e8ca6

Commit: sysconfigs/bumblebee-kubernetes-charts@e45a277cf445be21a6aec62545d82701a55e8ca6 
Author: ben                            
                            
Date: 2024-08-03T17:38:29.000+01:00 

Message

feat: initial manifest for tvstation (project-management-only/home-tv-station#7)

+83 -0 (83 lines changed)

The first implementation looks like this

---

apiVersion: v1
kind: Namespace
metadata:
    name: tv-station

---

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: tvstation
  name: tvstation
  namespace: tv-station
spec:
  selector:
    matchLabels:
      app: tvstation
  template:
    metadata:
      labels:
        app: tvstation
    spec:
      containers:
        - name: tvstation
          image: registry.bentasker.co.uk/project-management-only/home-tv-station:0.1b
          imagePullPolicy: IfNotPresent
          env:
          - name: INFLUXDB_URL
            value: "http://192.168.3.84:8086"
          - name: INFLUXDB_BUCKET
            value: "Systemstats"
          ports:
            - containerPort: 80
              name: http-hlsport
              protocol: TCP
            - containerPort: 1935
              name: rtmp-tvport
              protocol: TCP
          resources:
            requests:
              cpu: 500m
              memory: 750Mi
          volumeMounts:
            - mountPath: /media
              name: media
      volumes:
      - name: media
        nfs:
          server: 192.168.3.233
          path: "/volume1/Series"
          readOnly: true

---


apiVersion: v1
kind: Service
metadata:
  name: tvstation
  namespace: tv-station
spec:
  ports:
    - port: 8082
      protocol: TCP
      targetPort: http-hlsport
      name: "hls"
    - port: 1935
      protocol: TCP
      targetPort: rtmp-tvport
      name: "rtmp"
  externalIPs:
     - 192.168.3.23
     - 192.168.3.22
  selector:
    app: tvstation
  sessionAffinity: None
  type: LoadBalancer


---

The resource allocation is entirely arbitrary - figured I'd let it run a bit and look at actual usage in my dashboards

mentioned in commit sysconfigs/bumblebee-kubernetes-charts@56c3d1d3a45c1616cee8e99a0dc00be29baa5ee8

Commit: sysconfigs/bumblebee-kubernetes-charts@56c3d1d3a45c1616cee8e99a0dc00be29baa5ee8 
Author: ben                            
                            
Date: 2024-08-03T17:48:43.000+01:00 

Message

feat: add configmap to control allow and blocklist (project-management-only/home-tv-station#7)

+24 -2 (26 lines changed)

I've defined both allow and blocklists as a config map:

apiVersion: v1
kind: ConfigMap
metadata:
  name: tv-station-config
  namespace: tv-station  
data:
  allowlist.txt:
  blocklist.txt: |
    Prison_School

Those are then mounted in place (commit 68b20fe23dedc98a9bb23b59f807065f81d25e2d adjusts so we check whether these files have >0 lines in them before enabling the associated mode)

It's worth noting, for avoidance of doubt: if the pod rolls, it's not going to be streaming the same episode when it comes back up.

We could potentially maintain some kind of state so that we can pick back up where we left off, but that's not for the initial release.

mentioned in commit sysconfigs/bumblebee-kubernetes-charts@471022b58ff0451bc77b4c45a612990721b8c331

Commit: sysconfigs/bumblebee-kubernetes-charts@471022b58ff0451bc77b4c45a612990721b8c331 
Author: ben                            
                            
Date: 2024-08-03T17:56:35.000+01:00 

Message

chore: set resource requests based on usage (project-management-only/home-tv-station#7)

+4 -1 (5 lines changed)

Based on a quick look at resources, I'm going with

            requests:
              cpu: 1
              memory: 750Mi
            limits:
              cpu: 2
              memory: 1.5Gi

I think those can actually come down quite a bit, but it's obviously going to vary a bit based on what's being processed/streamed. I'll check back on it tomorrow to see what's been used overnight