spacerace

This commit is contained in:
Nathan Rashleigh 2025-04-12 22:20:42 +10:00
parent c8fb9598a6
commit 3136fdfc67
4 changed files with 167 additions and 183 deletions

View File

@ -9,12 +9,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Style Guidelines ## Style Guidelines
1. YAML Formatting: 1. YAML Formatting:
- Use 2-space indentation - Use 4-space indentation
- Use snake_case for keys
- Keep line length under 100 characters
2. Kubernetes Resources: 2. Kubernetes Resources:
- Include resource limits/requests in all deployments
- Add appropriate labels and annotations - Add appropriate labels and annotations
- Group related resources in the same file - Group related resources in the same file
- Use namespaces to organize resources by service - Use namespaces to organize resources by service

View File

@ -1,168 +1,168 @@
--- # ---
# ----------------------------------------------------------------------- # # -----------------------------------------------------------------------
# DEPLOYMENTS # # DEPLOYMENTS
# ----------------------------------------------------------------------- # # -----------------------------------------------------------------------
apiVersion: apps/v1 # apiVersion: apps/v1
kind: Deployment # kind: Deployment
metadata: # metadata:
name: pihole # name: pihole
namespace: networking # namespace: networking
spec: # spec:
replicas: 1 # replicas: 1
selector: # selector:
matchLabels: # matchLabels:
app: pihole # app: pihole
template: # template:
metadata: # metadata:
labels: # labels:
app: pihole # app: pihole
spec: # spec:
containers: # containers:
- name: pihole # - name: pihole
image: pihole/pihole:latest # image: pihole/pihole:latest
imagePullPolicy: IfNotPresent # imagePullPolicy: IfNotPresent
env: # env:
- name: TZ # - name: TZ
value: "Australia/Melbourne" # value: "Australia/Melbourne"
- name: FTLCONF_webserver_api_password # - name: FTLCONF_webserver_api_password
value: grepgrepgrep # value: grepgrepgrep
# allow it to respond to devices outside cluster # # allow it to respond to devices outside cluster
- name: FTLCONF_dns_listeningMode # - name: FTLCONF_dns_listeningMode
value: single # value: single
# resolve wildcards # # resolve wildcards
- name: FTLCONF_misc_dnsmasq_lines # - name: FTLCONF_misc_dnsmasq_lines
value: address=/nightowl.strix.systems/192.168.1.88 # value: address=/nightowl.strix.systems/192.168.1.88
ports: # ports:
- containerPort: 53 # - containerPort: 53
protocol: TCP # protocol: TCP
- containerPort: 53 # - containerPort: 53
protocol: UDP # protocol: UDP
- containerPort: 67 # - containerPort: 67
protocol: UDP # protocol: UDP
- containerPort: 80 # - containerPort: 80
protocol: TCP # protocol: TCP
- containerPort: 443 # - containerPort: 443
protocol: TCP # protocol: TCP
# volumeMounts: # # volumeMounts:
# - name: etc # # - name: etc
# mountPath: /etc/pihole # # mountPath: /etc/pihole
# - name: dnsmasq # # - name: dnsmasq
# mountPath: /etc/dnsmasq.d # # mountPath: /etc/dnsmasq.d
resources: # resources:
requests: # requests:
memory: 128Mi # memory: 128Mi
cpu: 100m # cpu: 100m
limits: # limits:
memory: 2Gi # memory: 2Gi
cpu: 1 # cpu: 1
# volumes: # # volumes:
# - name: etc # # - name: etc
# hostPath: # # hostPath:
# path: /data/pihole/etc # # path: /data/pihole/etc
# type: Directory # # type: Directory
# - name: dnsmasq # # - name: dnsmasq
# hostPath: # # hostPath:
# path: /data/pihole/dnsmasq.d # # path: /data/pihole/dnsmasq.d
# type: Directory # # type: Directory
# ----------------------------------------------------------------------- # # -----------------------------------------------------------------------
# SERVICES # # SERVICES
# ----------------------------------------------------------------------- # # -----------------------------------------------------------------------
--- # ---
kind: Service # kind: Service
apiVersion: v1 # apiVersion: v1
metadata: # metadata:
name: pihole # name: pihole
namespace: networking # namespace: networking
spec: # spec:
selector: # selector:
app: pihole # app: pihole
ports: # ports:
- name: web # - name: web
port: 80 # port: 80
targetPort: 80 # targetPort: 80
- name: dns-tcp # - name: dns-tcp
port: 53 # port: 53
targetPort: 53 # targetPort: 53
protocol: TCP # protocol: TCP
- name: dns-udp # - name: dns-udp
port: 53 # port: 53
targetPort: 53 # targetPort: 53
protocol: UDP # protocol: UDP
--- # ---
apiVersion: v1 # apiVersion: v1
kind: Service # kind: Service
metadata: # metadata:
name: pihole-dns-udp # name: pihole-dns-udp
namespace: networking # namespace: networking
spec: # spec:
selector: # selector:
app: pihole # app: pihole
ports: # ports:
- name: dns-udp # - name: dns-udp
port: 53 # port: 53
protocol: UDP # protocol: UDP
externalTrafficPolicy: Local # externalTrafficPolicy: Local
type: LoadBalancer # type: LoadBalancer
--- # ---
apiVersion: v1 # apiVersion: v1
kind: Service # kind: Service
metadata: # metadata:
name: pihole-dns-tcp # name: pihole-dns-tcp
namespace: networking # namespace: networking
spec: # spec:
selector: # selector:
app: pihole # app: pihole
ports: # ports:
- name: dns-tcp # - name: dns-tcp
port: 53 # port: 53
protocol: TCP # protocol: TCP
externalTrafficPolicy: Local # externalTrafficPolicy: Local
type: LoadBalancer # type: LoadBalancer
--- # ---
apiVersion: v1 # apiVersion: v1
kind: Service # kind: Service
metadata: # metadata:
name: pihole-web-debug # name: pihole-web-debug
namespace: networking # namespace: networking
spec: # spec:
selector: # selector:
app: pihole # app: pihole
ports: # ports:
- name: dns-tcp # - name: dns-tcp
port: 9980 # port: 9980
targetPort: 80 # targetPort: 80
protocol: TCP # protocol: TCP
externalTrafficPolicy: Local # externalTrafficPolicy: Local
type: LoadBalancer # type: LoadBalancer
--- # ---
apiVersion: networking.k8s.io/v1 # apiVersion: networking.k8s.io/v1
kind: Ingress # kind: Ingress
metadata: # metadata:
name: pihole # name: pihole
namespace: networking # namespace: networking
spec: # spec:
ingressClassName: haproxy # ingressClassName: haproxy
rules: # rules:
- host: "pihole.nightowl.strix.systems" # - host: "pihole.nightowl.strix.systems"
http: # http:
paths: # paths:
- path: / # - path: /
pathType: Prefix # pathType: Prefix
backend: # backend:
service: # service:
name: pihole # name: pihole
port: # port:
name: web # name: web

View File

@ -3,6 +3,7 @@ apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: spacerace-api name: spacerace-api
namespace: spacerace
annotations: annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod" cert-manager.io/cluster-issuer: "letsencrypt-prod"
haproxy.org/path-rewrite: "/api(/)?(.*) /$2" haproxy.org/path-rewrite: "/api(/)?(.*) /$2"
@ -10,10 +11,10 @@ spec:
ingressClassName: haproxy ingressClassName: haproxy
tls: tls:
- hosts: - hosts:
- spacerace.strix.systems - spacerace.ntwl.xyz
secretName: spacerace-strix-systems-tls secretName: spacerace-ntwl-xyz-tls
rules: rules:
- host: spacerace.strix.systems - host: spacerace.ntwl.xyz
http: http:
paths: paths:
- path: /api(/|$)(.*) - path: /api(/|$)(.*)

View File

@ -4,32 +4,14 @@
--- ---
apiVersion: v1
kind: PersistentVolume
metadata:
name: spacerace-postgres-pv
spec:
storageClassName: ""
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
claimRef:
namespace: default
name: spacerace-postgres-pvc
hostPath:
path: "/var/lib/rancher/k3s/storage/spacerace-postgres-pv"
type: DirectoryOrCreate
---
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: spacerace-postgres-pvc name: spacerace-postgres-pvc
namespace: spacerace
spec: spec:
volumeName: spacerace-postgres-pv volumeName: spacerace-postgres-pv
storageClassName: zfs-fast
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:
@ -46,6 +28,7 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: spacerace-postgres name: spacerace-postgres
namespace: spacerace
spec: spec:
replicas: 1 replicas: 1
selector: selector:
@ -92,6 +75,7 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: spacerace-api name: spacerace-api
namespace: spacerace
spec: spec:
replicas: 1 replicas: 1
selector: selector:
@ -104,7 +88,7 @@ spec:
spec: spec:
containers: containers:
- name: spacerace-api - name: spacerace-api
image: registry.strix.systems/spacerace-api image: registry.ntwl.xyz/spacerace-api
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
- containerPort: 80 - containerPort: 80
@ -124,6 +108,7 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: spacerace-api name: spacerace-api
namespace: spacerace
spec: spec:
selector: selector:
app: spacerace-api app: spacerace-api
@ -135,6 +120,7 @@ spec:
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
namespace: spacerace
name: spacerace-postgres name: spacerace-postgres
spec: spec:
selector: selector: