This commit is contained in:
Morten Olsen
2025-08-18 08:02:48 +02:00
parent 295472a028
commit a27b563113
27 changed files with 499 additions and 64 deletions

View File

@@ -0,0 +1,3 @@
apiVersion: v2
version: 1.0.0
name: ByteStash

View File

@@ -0,0 +1,9 @@
apiVersion: homelab.mortenolsen.pro/v1
kind: AuthentikClient
metadata:
name: '{{ .Release.Name }}'
spec:
server: '{{ .Values.authentikServer }}'
redirectUris:
- url: https://localhost:3000/api/v1/authentik/oauth2/callback
matchingMode: strict

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: '{{ .Release.Name }}-headless'
labels:
app: '{{ .Release.Name }}'
spec:
clusterIP: None
ports:
- port: 5000
name: http
selector:
app: '{{ .Release.Name }}'

View File

@@ -0,0 +1,11 @@
apiVersion: homelab.mortenolsen.pro/v1
kind: HttpService
metadata:
name: '{{ .Release.Name }}'
spec:
environment: '{{ .Values.environment }}'
subdomain: '{{ .Values.subdomain }}'
destination:
host: '{{ .Release.Name }}'
port:
number: 80

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: '{{ .Release.Name }}'
labels:
app: '{{ .Release.Name }}'
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 5000
protocol: TCP
name: http
selector:
app: '{{ .Release.Name }}'

View File

@@ -0,0 +1,68 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: '{{ .Release.Name }}'
labels:
app: '{{ .Release.Name }}'
spec:
serviceName: '{{ .Release.Name }}-headless'
replicas: 1
selector:
matchLabels:
app: '{{ .Release.Name }}'
template:
metadata:
labels:
app: '{{ .Release.Name }}'
spec:
containers:
- name: '{{ .Release.Name }}'
image: ghcr.io/jordan-dalby/bytestash:latest
ports:
- containerPort: 5000
name: http
env:
- name: OIDC_ENABLED
value: 'true'
- name: OIDC_DISPLAY_NAME
value: Authentik
- name: OIDC_CLIENT_ID
valueFrom:
secretKeyRef:
name: authentik-client-{{ .Release.Name }}
key: clientId
- name: OIDC_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: authentik-client-{{ .Release.Name }}
key: clientSecret
- name: OIDC_ISSUER_URL
valueFrom:
secretKeyRef:
name: authentik-client-{{ .Release.Name }}
key: configuration
# !! IMPORTANT !!
# You MUST update this Redirect URI to match your external URL.
# This URI must also be configured in your Authentik provider settings for this client.
#- name: BS_OIDC_REDIRECT_URI
#value: 'https://bytestash.your-domain.com/login/oauth2/code/oidc'
volumeMounts:
- mountPath: /data/snippets
name: bytestash-data
# Defines security context for the pod to avoid running as root.
# securityContext:
# runAsUser: 1000
# runAsGroup: 1000
# fsGroup: 1000
volumeClaimTemplates:
- metadata:
name: bytestash-data
spec:
accessModes: ['ReadWriteOnce']
storageClassName: '{{ .Values.storageClassName }}'
resources:
requests:
storage: 5Gi

View File

@@ -0,0 +1,5 @@
environment: dev/dev
postgresCluster: dev/dev-postgres-cluster
authentikServer: dev/dev-authentik-server
storageClassName: dev-retain
subdomain: bytestash

View File

@@ -3,7 +3,7 @@
# Declare variables to be passed into your templates.
image:
repository: ghcr.io/morten-olsen/homelab-operator
repository: homelab-operator # ghcr.io/morten-olsen/homelab-operator
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: main