added db to vh
This commit is contained in:
1 parent
d753715d1f
commit
aa7678e9ac
6 files changed
+194
-11
No files matched your search
@@ -0,0 +1,125 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: db-envs
|
||||
data:
|
||||
PGDATA: {{ .Values.database.pgdata }}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
type: Opaque
|
||||
metadata:
|
||||
name: db-cred
|
||||
annotations:
|
||||
secret-generator.v1.mittwald.de/autogenerate: "POSTGRES_PASSWORD"
|
||||
stringData:
|
||||
POSTGRES_USER: "postgres"
|
||||
|
||||
---
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: db
|
||||
spec:
|
||||
selector:
|
||||
app: db
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
name: "pg"
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: db
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: db
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 2
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
finalizers:
|
||||
- kubernetes.io/pvc-protection
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
limits:
|
||||
storage: 100Gi
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: db
|
||||
spec:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
preference:
|
||||
matchExpressions:
|
||||
- key: homelab/capacity
|
||||
operator: In
|
||||
values:
|
||||
- low
|
||||
- med
|
||||
containers:
|
||||
- name: db
|
||||
image: "{{ .Values.database.repo }}:{{ .Values.database.tag }}"
|
||||
imagePullPolicy: "Always"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: db-envs
|
||||
- secretRef:
|
||||
name: db-cred
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: db
|
||||
resources:
|
||||
{{- .Values.database.resources | toYaml | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: {{ .Values.database.pgdata }}
|
||||
startupProbe:
|
||||
tcpSocket:
|
||||
port: db
|
||||
initialDelaySeconds: 10
|
||||
failureThreshold: 10
|
||||
timeoutSeconds: 30
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- '-c'
|
||||
- exec pg_isready -U "postgres" -h 127.0.0.1 -p 5432
|
||||
failureThreshold: 6
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- '-c'
|
||||
- '-e'
|
||||
- >
|
||||
exec pg_isready -U "postgres" -h 127.0.0.1 -p 5432
|
||||
|
||||
[ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f
|
||||
/bitnami/postgresql/.initialized ]
|
||||
failureThreshold: 6
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 5
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ range $k, $v := .Values.linuxserverServices }}
|
||||
{{ range $k, $v := .Values.services }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@@ -48,6 +48,8 @@ spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 2
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
partition: 0
|
||||
type: RollingUpdate
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
@@ -101,6 +103,32 @@ spec:
|
||||
mountPath: /config
|
||||
- name: torrents
|
||||
mountPath: /torrents
|
||||
{{- if $v.health.liveness }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: {{$v.health.liveness}}
|
||||
port: http
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 10
|
||||
failureThreshold: 10
|
||||
timeoutSeconds: 30
|
||||
{{ end -}}
|
||||
{{- if $v.health.readiness }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: {{$v.health.readiness}}
|
||||
port: http
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 10
|
||||
failureThreshold: 10
|
||||
timeoutSeconds: 30
|
||||
{{ end }}
|
||||
startupProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
initialDelaySeconds: 10
|
||||
failureThreshold: 10
|
||||
timeoutSeconds: 30
|
||||
volumes:
|
||||
- name: torrents
|
||||
nfs:
|
||||
|
||||
@@ -135,13 +135,8 @@ spec:
|
||||
- containerPort: 32414
|
||||
protocol: UDP
|
||||
- containerPort: 32469
|
||||
resources:
|
||||
limits:
|
||||
cpu: 8
|
||||
memory: "10Gi"
|
||||
requests:
|
||||
cpu: 4
|
||||
memory: "4Gi"
|
||||
resources:
|
||||
{{- .Values.plex.resources | toYaml | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
@@ -155,6 +150,12 @@ spec:
|
||||
subPath: movies
|
||||
- name: family-videos
|
||||
mountPath: /family-videos
|
||||
startupProbe:
|
||||
tcpSocket:
|
||||
port: plex
|
||||
initialDelaySeconds: 10
|
||||
failureThreshold: 10
|
||||
timeoutSeconds: 30
|
||||
volumes:
|
||||
- name: torrents
|
||||
nfs:
|
||||
|
||||
@@ -8,8 +8,27 @@ global:
|
||||
plex:
|
||||
repo: "plexinc/pms-docker"
|
||||
tag: "latest"
|
||||
resources:
|
||||
limits:
|
||||
cpu: 8
|
||||
memory: "10Gi"
|
||||
requests:
|
||||
cpu: 4
|
||||
memory: "4Gi"
|
||||
|
||||
linuxserverServices:
|
||||
database:
|
||||
repo: postgres
|
||||
tag: 16.0-alpine
|
||||
pgdata: /var/lib/postgresql/data
|
||||
resources:
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: "800Mi"
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: "256Mi"
|
||||
|
||||
services:
|
||||
sonarr:
|
||||
repo: lscr.io/linuxserver/sonarr
|
||||
tag: "latest"
|
||||
@@ -25,6 +44,9 @@ linuxserverServices:
|
||||
storage: 10Gi
|
||||
limits:
|
||||
storage: 100Gi
|
||||
health:
|
||||
readiness: "/ping"
|
||||
liveness: "/ping"
|
||||
ports:
|
||||
tcp:
|
||||
web: 8989
|
||||
@@ -38,6 +60,9 @@ linuxserverServices:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: "500M"
|
||||
health:
|
||||
readiness: "/ping"
|
||||
liveness: "/ping"
|
||||
configVolumesResources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
@@ -58,6 +83,9 @@ linuxserverServices:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: "500M"
|
||||
health:
|
||||
readiness: "/health"
|
||||
liveness: "/health"
|
||||
configVolumesResources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
@@ -82,6 +110,7 @@ linuxserverServices:
|
||||
requests:
|
||||
cpu: 800m
|
||||
memory: "4Gi"
|
||||
health: {}
|
||||
configVolumesResources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
|
||||
@@ -74,7 +74,7 @@ services:
|
||||
port: 3000
|
||||
group: "Core"
|
||||
# vh services
|
||||
{{- range $k, $v := .Values.videohosting.linuxserverServices }}
|
||||
{{- range $k, $v := .Values.videohosting.services }}
|
||||
- prefix: "{{ $k }}.vh"
|
||||
service: "{{ $k }}"
|
||||
namespace: "apps-videohosting"
|
||||
|
||||
@@ -26,7 +26,7 @@ global:
|
||||
host: 192.168.0.23
|
||||
|
||||
videohosting:
|
||||
linuxserverServices:
|
||||
services:
|
||||
sonarr:
|
||||
ports:
|
||||
tcp:
|
||||
|
||||
Reference in new issue
Block a user