This commit is contained in:
Morten Olsen
2025-12-11 23:53:08 +01:00
parent 2b8766c634
commit 4220330245
8 changed files with 179 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,80 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Release.Name }}"
spec:
strategy:
type: Recreate
replicas: 1
revisionHistoryLimit: 0
selector:
matchLabels:
app: "{{ .Release.Name }}"
template:
metadata:
labels:
app: "{{ .Release.Name }}"
spec:
containers:
- name: "{{ .Release.Name }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
- name: tcp-tunnel-min
containerPort: {{ .Values.service.tcpPortMin }}
protocol: TCP
- name: tcp-tunnel-max
containerPort: {{ .Values.service.tcpPortMax }}
protocol: TCP
volumeMounts:
- mountPath: /app/data
name: data
env:
- name: TZ
value: UTC
- name: AUTH_TOKEN
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-secrets"
key: authtoken
- name: DOMAIN
value: "{{ .Values.subdomain }}.{{ .Values.globals.environment }}"
command:
- drip-server
- --domain
- "{{ .Values.subdomain }}.{{ .Values.globals.environment }}"
- --port
- "{{ .Values.service.port }}"
- --token
- "$(AUTH_TOKEN)"
- --tcp-port-min
- "{{ .Values.service.tcpPortMin }}"
- --tcp-port-max
- "{{ .Values.service.tcpPortMax }}"
livenessProbe:
exec:
command: {{ .Values.healthcheck.test }}
initialDelaySeconds: {{ .Values.healthcheck.startPeriod | default 0 | trimSuffix "s" | int }}
periodSeconds: {{ .Values.healthcheck.interval | default 10 | trimSuffix "s" | int }}
timeoutSeconds: {{ .Values.healthcheck.timeout | default 1 | trimSuffix "s" | int }}
failureThreshold: {{ .Values.healthcheck.retries | default 3 }}
readinessProbe:
exec:
command: {{ .Values.healthcheck.test }}
initialDelaySeconds: {{ .Values.healthcheck.startPeriod | default 0 | trimSuffix "s" | int }}
periodSeconds: {{ .Values.healthcheck.interval | default 10 | trimSuffix "s" | int }}
timeoutSeconds: {{ .Values.healthcheck.timeout | default 1 | trimSuffix "s" | int }}
failureThreshold: {{ .Values.healthcheck.retries | default 3 }}
resources:
limits:
cpu: "{{ .Values.resources.limits.cpu }}"
memory: "{{ .Values.resources.limits.memory }}"
volumes:
- name: data
persistentVolumeClaim:
claimName: "{{ .Release.Name }}-data"

View File

@@ -0,0 +1,11 @@
apiVersion: homelab.mortenolsen.pro/v1
kind: ExternalHttpService
metadata:
name: '{{ .Release.Name }}'
spec:
environment: '{{ .Values.globals.environment }}'
subdomain: '{{ .Values.subdomain }}'
destination:
host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local'
port:
number: {{ .Values.service.port }}

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "{{ .Release.Name }}-data"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: '{{ .Values.globals.environment }}'

View File

@@ -0,0 +1,9 @@
apiVersion: homelab.mortenolsen.pro/v1
kind: GenerateSecret
metadata:
name: "{{ .Release.Name }}-secrets"
spec:
fields:
- name: authtoken
encoding: hex
length: 64

View File

@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ .Release.Name }}"
spec:
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
- port: {{ .Values.service.tcpPortMin }}
targetPort: tcp-tunnel-min
protocol: TCP
name: tcp-tunnel-min
- port: {{ .Values.service.tcpPortMax }}
targetPort: tcp-tunnel-max
protocol: TCP
name: tcp-tunnel-max
selector:
app: "{{ .Release.Name }}"

View File

@@ -0,0 +1,18 @@
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: "{{ .Release.Name }}"
namespace: "{{ .Release.Namespace }}"
spec:
gateways:
- "{{ .Values.globals.istio.gateway }}"
- mesh
hosts:
- "{{ .Values.subdomain }}.{{ .Values.globals.domain }}"
- mesh
http:
- route:
- destination:
host: "{{ .Release.Name }}"
port:
number: 80

View File

@@ -0,0 +1,27 @@
image:
repository: ghcr.io/gouryella/drip
tag: latest
pullPolicy: IfNotPresent
subdomain: drip
service:
port: 443
tcpPortMin: 20000
tcpPortMax: 20100
resources:
limits:
cpu: 1
memory: 512Mi
healthcheck:
test:
- wget
- --no-verbose
- --tries=1
- --spider
- http://localhost:443/health
interval: 30s
timeout: 3s
retries: 3
startPeriod: 10s