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: {}