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
1. YAML Formatting:
- Use 2-space indentation
- Use snake_case for keys
- Keep line length under 100 characters
- Use 4-space indentation
2. Kubernetes Resources:
- Include resource limits/requests in all deployments
- Add appropriate labels and annotations
- Group related resources in the same file
- Use namespaces to organize resources by service

View File

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

View File

@ -3,6 +3,7 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: spacerace-api
namespace: spacerace
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
haproxy.org/path-rewrite: "/api(/)?(.*) /$2"
@ -10,10 +11,10 @@ spec:
ingressClassName: haproxy
tls:
- hosts:
- spacerace.strix.systems
secretName: spacerace-strix-systems-tls
- spacerace.ntwl.xyz
secretName: spacerace-ntwl-xyz-tls
rules:
- host: spacerace.strix.systems
- host: spacerace.ntwl.xyz
http:
paths:
- 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
apiVersion: v1
metadata:
name: spacerace-postgres-pvc
namespace: spacerace
spec:
volumeName: spacerace-postgres-pv
storageClassName: zfs-fast
accessModes:
- ReadWriteOnce
resources:
@ -46,6 +28,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: spacerace-postgres
namespace: spacerace
spec:
replicas: 1
selector:
@ -92,6 +75,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: spacerace-api
namespace: spacerace
spec:
replicas: 1
selector:
@ -104,7 +88,7 @@ spec:
spec:
containers:
- name: spacerace-api
image: registry.strix.systems/spacerace-api
image: registry.ntwl.xyz/spacerace-api
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
@ -124,6 +108,7 @@ apiVersion: v1
kind: Service
metadata:
name: spacerace-api
namespace: spacerace
spec:
selector:
app: spacerace-api
@ -135,6 +120,7 @@ spec:
apiVersion: v1
kind: Service
metadata:
namespace: spacerace
name: spacerace-postgres
spec:
selector: