Big Update

- basic webapps
- no more cpu limits
This commit is contained in:
Ariel Sosnovsky committed 2023-12-21 10:16:55 -05:00
1 parent 9608dce3d4
commit 5b6d0c9e71
15 files changed
+156 -18

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
apiVersion: v2
name: basic-webapps
description: An applications service for homelab
type: application
version: 0.1.0
dependencies: []
@@ -0,0 +1,100 @@
{{ range $k, $v := .Values.services }}
---
kind: Service
apiVersion: v1
metadata:
name: {{ $k }}
spec:
selector:
app: {{ $k }}
type: ClusterIP
ports:
{{ range $portName, $portValue := $v.ports.tcp }}
- port: {{ $portValue }}
targetPort: {{ $portValue }}
name: "{{ $portName }}"
protocol: TCP
{{ end }}
{{- if $v.ports.udp -}}
{{ range $portName, $portValue := $v.ports.udp }}
- port: {{ $portValue }}
targetPort: {{ $portValue }}
name: "{{ $portName }}-udp"
protocol: UDP
{{ end }}
{{- end }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{$k}}
spec:
selector:
matchLabels:
app: {{$k}}
replicas: 1
revisionHistoryLimit: 2
updateStrategy:
rollingUpdate:
partition: 1
type: RollingUpdate
template:
metadata:
labels:
app: {{$k}}
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: homelab/capacity
operator: In
values:
{{ $v.capacity | toYaml | nindent 20 }}
containers:
- name: {{$k}}
image: "{{ $v.repo }}:{{ $v.tag }}"
imagePullPolicy: Always
resources:
{{- $v.podResources | toYaml | nindent 12 }}
ports:
{{ range $portName, $portValue := $v.ports.tcp }}
- containerPort: {{ $portValue }}
protocol: TCP
name: "tcp-{{ $portName }}"
{{ end }}
{{- if $v.ports.udp -}}
{{ range $portName, $portValue := $v.ports.udp }}
- containerPort: {{ $portValue }}
protocol: UDP
{{ end }}
{{ end }}
{{- if $v.health.liveness }}
livenessProbe:
httpGet:
path: {{$v.health.liveness}}
port: tcp-web
scheme: HTTP
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
{{ end -}}
{{- if $v.health.readiness }}
readinessProbe:
httpGet:
path: {{$v.health.readiness}}
port: tcp-web
scheme: HTTP
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
{{ end }}
startupProbe:
tcpSocket:
port: tcp-web
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
{{ end }}
Whitespace-only changes.
Whitespace-only changes.
+1
View File
@@ -0,0 +1 @@
app: {}
-2
View File
@@ -33,14 +33,12 @@ resources:
cpu: "2"
limits:
memory: "4Gi"
cpu: "3"
go2rtc:
requests:
memory: "100Mi"
cpu: "500m"
limits:
memory: "500Mi"
cpu: "1"
scrypted:
homekit:
@@ -21,7 +21,6 @@ spec:
image: nginxdemos/hello
resources:
limits:
cpu: 1
memory: 1Gi
ports:
- containerPort: 80
-3
View File
@@ -17,7 +17,6 @@ nextcloud:
memory: "1Gi"
ephemeral-storage: "40Ki"
limits:
cpu: "1"
memory: 5Gi
ephemeral-storage: "40Mi"
@@ -74,7 +73,6 @@ nextcloud:
memory: "1Gi"
ephemeral-storage: "20Mi"
limits:
cpu: "8"
memory: 10Gi
ephemeral-storage: "200Mi"
@@ -92,6 +90,5 @@ nextcloud:
memory: "256Mi"
ephemeral-storage: "100Ki"
limits:
cpu: "250m"
memory: 1Gi
ephemeral-storage: "100Mi"
-1
View File
@@ -41,7 +41,6 @@ spec:
cpu: "20m"
memory: "55M"
limits:
cpu: "20m"
memory: "55M"
env:
- name: "SMTP_PASSWORD"
+1 -8
View File
@@ -10,10 +10,9 @@ plex:
tag: "1.32.7.7621-871adbd44"
resources:
limits:
cpu: 8
memory: "14Gi"
requests:
cpu: 750m
cpu: 1
memory: "4Gi"
arrs:
@@ -26,7 +25,6 @@ arrs:
usePostgres: true
podResources:
limits:
cpu: 2
memory: "8Gi"
requests:
cpu: 250m
@@ -50,7 +48,6 @@ arrs:
usePostgres: true
podResources:
limits:
cpu: 2
memory: "8Gi"
requests:
cpu: 250m
@@ -74,7 +71,6 @@ arrs:
usePostgres: true
podResources:
limits:
cpu: 2
memory: "8Gi"
requests:
cpu: 250m
@@ -98,7 +94,6 @@ arrs:
usePostgres: true
podResources:
limits:
cpu: 2
memory: "8Gi"
requests:
cpu: 50m
@@ -121,7 +116,6 @@ services:
AUTO_UPDATE: "true"
podResources:
limits:
cpu: 500m
memory: "1Gi"
requests:
cpu: 250m
@@ -148,7 +142,6 @@ services:
6881: 6881
podResources:
limits:
cpu: 2
memory: "6Gi"
requests:
cpu: 800m
@@ -0,0 +1,21 @@
app:
quirky:
ingress:
middleware: apps-ingresses-https-redirect
repo: ghcr.io/asosnovsky/quirky
tag: "latest"
podResources:
limits:
memory: "250Mi"
requests:
cpu: 250m
memory: "250Mi"
health:
readiness: "/"
liveness: "/"
ports:
tcp:
web: 80
capacity:
- med
- low
+13
View File
@@ -106,4 +106,17 @@ services:
port: {{ $v.ports.tcp.web }}
middleware: "apps-ingresses-chain-authentik"
group: "Video Hosting"
{{- end }}
# basic-webapp services
{{- range $k, $v := .Values.basic-webapps.apps }}
- prefix: "{{ $k }}.wa"
service: "{{ $k }}"
namespace: "apps-basic-webapps"
port: {{ $v.ports.tcp.web }}
{{ if $.ingress }}
middleware: {{ $.ingress.middleware | default "apps-ingresses-chain-authentik" }}
{{ else }}
middleware: "apps-ingresses-chain-authentik"
{{ end }}
group: "Basic Webapps"
{{- end }}
@@ -44,4 +44,8 @@ spec:
destination:
server: https://kubernetes.default.svc
namespace: {{ $appProps.namespace | default $genNamespace }}
{{ if $appProps.syncPolicy }}
syncPolicy:
{{$appProps.syncPolicy | toYaml | nindent 4 }}
{{ end }}
{{ end }}
+1 -3
View File
@@ -5,9 +5,7 @@ metadata:
name: cpu-limit-range
spec:
limits:
- default:
cpu: 50m
defaultRequest:
- defaultRequest:
cpu: 10m
type: Container
---
+9
View File
@@ -40,6 +40,14 @@ videohosting:
6881: 6881
apps:
basic-webapps:
valuesFile: basic-webapp.yaml
syncPolicy:
automated:
selfHeal: true
syncOptions:
- ServerSideApply=true
photos:
values: |-
immich:
@@ -52,6 +60,7 @@ apps:
nfs:
path: {{ .Values.global.nfs.additionalShares.familyphotos }}
server: {{ .Values.global.nfs.server }}
videohosting:
values: |-
{{ .Values.videohosting | toYaml }}