Merge branch 'stable' of github.com:asosnovsky/homelab into stable

This commit is contained in:
ari committed 2024-03-10 16:13:08 -04:00
commit d3d1569804
23 files changed
+155 -103

No files matched your search

+4 -1
View File
@@ -1,4 +1,7 @@
{
"yaml.schemas": {},
"yaml.schemas": {
"file:///Users/asosnovsky/.vscode/extensions/docsmsft.docs-yaml-1.0.1/dist/toc.schema.json": "/toc\\.yml/i",
"https://json.schemastore.org/helmfile.json": "file:///Users/asosnovsky/git/personal/homelab/k8s/argoapps/apps-values/ingresses.yaml"
},
"git-blame.gitWebUrl": ""
}
+12 -3
View File
@@ -2,6 +2,8 @@
mkdir -p .tmp
deployment=${1:-dev}
keep_old=${2:-no}
keep_old=$(echo "${keep_old:0:1}" | tr '[:upper:]' '[:lower:]')
app=argocd
location=k8s/$app
full_path=$(realpath $location)
@@ -14,14 +16,21 @@ popd &> /dev/null
if [ -f "$tmp_path" ]; then
echo "Found existing file"
echo " -> Renaming old file to "$tmp_path".old"
mv $tmp_path $tmp_path".old"
if [[ -f "$tmp_path".old && "${keep_old:0:1}" == "y" ]]; then
num_files=$(ls -1q "${tmp_path}.old"* 2> /dev/null | wc -l | tr -d '[:space:]')
echo " -> Renaming old file to "$tmp_path".old.${num_files}"
mv $tmp_path $tmp_path".old.${num_files}"
else
rm $tmp_path".old"*
echo " -> Renaming old file to "$tmp_path".old"
mv $tmp_path $tmp_path".old"
fi
fi
helm template $app $full_path --namespace $app \
--debug \
--create-namespace \
--values k8s/argocd/values.yaml \
--values k8s/argocd/values-${deployment}.yaml \
--set selfapp.deployment="${deployment}" \
--set selfapp.enabled="true" \
--set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" \
@@ -11,6 +11,17 @@
# useWildCard: bool = False
# middleware: str = "https-redirect"
#
{{ if .useSecondaryDomain }}
{{ $domin := {{ .global.secondaryDomain }} }}
{{ else }}
{{ $domin := {{ .global.domain }} }}
{{ end }}
{{ if .useDirectPrefix }}
{{ $domin := printf "%s.%s" .prefix $domain }}
{{ else }}
{{ $domin := printf "%s.%s.%s" .prefix .rootSubDomain $domain }}
{{ end }}
{{ if .global.tls.enabled }}
{{ if (.useWildCard | default .global.tls.useWildCard) }}
@@ -18,7 +29,7 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: "tls-{{.prefix}}.{{.global.domain}}"
name: "tls-{{ $domin }}"
namespace: {{ .namespace }}
spec:
refreshInterval: 1h
@@ -26,45 +37,33 @@ spec:
kind: ClusterSecretStore
name: apps-ingresses
target:
name: tls-{{.prefix}}.{{.global.domain}}
name: tls-{{ $domin }}
creationPolicy: Owner
deletionPolicy: Delete
data:
- secretKey: tls.crt
remoteRef:
{{ if hasSuffix ".core" .prefix }}
key: cloudflare-wildcard.core.{{ .global.domain }}
{{ else if hasSuffix ".vh" .prefix }}
key: cloudflare-wildcard.vh.{{ .global.domain }}
{{ else }}
key: cloudflare-wildcard.{{ .global.domain }}
{{ end }}
key: cloudflare-wildcard.{{ $domin }}
property: tls.crt
- secretKey: tls.key
remoteRef:
{{ if hasSuffix ".core" .prefix }}
key: cloudflare-wildcard.core.{{ .global.domain }}
{{ else if hasSuffix ".vh" .prefix }}
key: cloudflare-wildcard.vh.{{ .global.domain }}
{{ else }}
key: cloudflare-wildcard.{{ .global.domain }}
{{ end }}
key: cloudflare-wildcard.{{ $domin }}
property: tls.key
{{ else }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: "tls-{{.prefix}}.{{.global.domain}}"
name: "tls-{{ $domin }}"
namespace: {{ .namespace }}
spec:
secretName: "tls-{{.prefix}}.{{.global.domain}}"
secretName: "tls-{{ $domin }}"
issuerRef:
kind: ClusterIssuer
name: "{{ .global.tls.issuer }}"
commonName: "{{.prefix}}.{{.global.domain}}"
commonName: "{{ $domin }}"
dnsNames:
- "{{.prefix}}.{{.global.domain}}"
- "{{ $domin }}"
{{ end }}
{{ end }}
@@ -72,7 +71,7 @@ spec:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "{{.prefix}}.{{.global.domain}}"
name: "{{ $domin }}"
namespace: {{ .namespace }}
annotations:
homelab-ingress/managing-app-namespace: "apps-ingresses"
@@ -93,7 +92,7 @@ metadata:
{{ end }}
spec:
rules:
- host: "{{.prefix}}.{{.global.domain}}"
- host: "{{ $domin }}"
http:
paths:
- backend:
@@ -105,10 +104,13 @@ spec:
pathType: Prefix
{{ if .global.tls.enabled }}
tls:
- secretName: "tls-{{.prefix}}.{{.global.domain}}"
- secretName: "tls-{{ $domin }}"
hosts:
- "{{.prefix}}.{{.global.domain}}"
- "{{ $domin }}"
{{ end }}
{{ else }}
{{ end }}
{{- end -}}
@@ -40,15 +40,15 @@ spec:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: cloudflare-wildcard{{$prefix}}.{{ $.Values.global.domain }}
name: cloudflare-wildcard{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}
spec:
secretName: cloudflare-wildcard{{$prefix}}.{{ $.Values.global.domain }}
secretName: cloudflare-wildcard{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}
issuerRef:
name: cloudflare
kind: Issuer
commonName: '*{{$prefix}}.{{ $.Values.global.domain }}'
commonName: '*{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}'
dnsNames:
- "*{{$prefix}}.{{ $.Values.global.domain }}"
- "*{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}"
{{ end }}
{{ end }}
{{ end }}
@@ -47,7 +47,7 @@ metadata:
app.kubernetes.io/name: authentik
spec:
forwardAuth:
address: http://authentik.chart-authentik.svc.cluster.local:80/outpost.goauthentik.io/auth/traefik
address: http://authentik-server.chart-authentik.svc.cluster.local:80/outpost.goauthentik.io/auth/traefik
trustForwardHeader: true
authResponseHeaders:
- X-authentik-username
+2
View File
@@ -1,5 +1,7 @@
global:
domain: "me.local"
secondaryDomain: "me.internal"
rootSubDomain: "home"
tls:
enabled: false
reverseProxy: {}
+9 -12
View File
@@ -1,23 +1,23 @@
nextcloud:
image:
repository: "ghcr.io/asosnovsky/nextcloud"
tag: "v1.1.1"
tag: "v28.0.2"
pullPolicy: IfNotPresent
flavor: fpm
replicaCount: 2
replicaCount: 1
nodeSelector:
homelab/capacity: high
cronjob:
enabled: true
resources:
requests:
cpu: "500m"
memory: "1Gi"
memory: "100Mi"
ephemeral-storage: "40Ki"
limits:
memory: 5Gi
ephemeral-storage: "40Mi"
nextcloud:
@@ -59,9 +59,8 @@ nextcloud:
enabled: true
auth:
enabled: true
cronjob:
enabled: true
replica:
replicaCount: 1
persistence:
enabled: true
@@ -70,10 +69,9 @@ nextcloud:
resources:
requests:
cpu: "500m"
memory: "1Gi"
memory: "2Gi"
ephemeral-storage: "20Mi"
limits:
memory: 10Gi
ephemeral-storage: "200Mi"
hpa:
@@ -90,5 +88,4 @@ nextcloud:
memory: "256Mi"
ephemeral-storage: "100Ki"
limits:
memory: 1Gi
ephemeral-storage: "100Mi"
ephemeral-storage: "100Mi"
+16 -16
View File
@@ -8,8 +8,8 @@ global:
familyvideos: "changeme"
plex:
repo: "plexinc/pms-docker"
tag: "1.32.7.7621-871adbd44"
resources:
tag: "1.40.0.7998-c29d4c0c8"
resources:
limits:
memory: "14Gi"
requests:
@@ -18,7 +18,7 @@ plex:
jellyfin:
repo: "lscr.io/linuxserver/jellyfin"
tag: latest
resources:
resources:
limits:
memory: "14Gi"
requests:
@@ -28,8 +28,8 @@ jellyfin:
arrs:
sonarr:
repo: lscr.io/linuxserver/sonarr
tag: "4.0.1.929-ls225"
migrateDbFromSqllite:
tag: "4.0.2.1183-ls229"
migrateDbFromSqllite:
enabled: false
claimName: config-sonarr-0
usePostgres: true
@@ -48,11 +48,11 @@ arrs:
<InstanceName>Sosnovsky Sonarr</InstanceName>
<AuthenticationMethod>External</AuthenticationMethod>
<AuthenticationType>DisabledForLocalAddresses</AuthenticationType>
radarr:
repo: lscr.io/linuxserver/radarr
tag: "5.2.6.8376-ls203"
migrateDbFromSqllite:
tag: "5.3.6.8612-ls206"
migrateDbFromSqllite:
enabled: false
claimName: config-radarr-0
usePostgres: true
@@ -71,11 +71,11 @@ arrs:
<InstanceName>Sosnovsky Radarr</InstanceName>
<AuthenticationMethod>External</AuthenticationMethod>
<AuthenticationType>DisabledForLocalAddresses</AuthenticationType>
readarr:
repo: lscr.io/linuxserver/readarr
tag: "develop-0.3.18.2411-ls88"
migrateDbFromSqllite:
migrateDbFromSqllite:
enabled: false
usePostgres: true
podResources:
@@ -92,11 +92,11 @@ arrs:
extraConfigXml: |-
<InstanceName>Sosnovsky Readarr</InstanceName>
<AuthenticationType>DisabledForLocalAddresses</AuthenticationType>
prowlarr:
repo: lscr.io/linuxserver/prowlarr
tag: "1.13.3.4273-ls53"
migrateDbFromSqllite:
tag: "1.13.3.4273-ls54"
migrateDbFromSqllite:
enabled: false
claimName: config-prowlarr-0
usePostgres: true
@@ -120,7 +120,7 @@ services:
bazarr:
kind: StatefulSet
repo: lscr.io/linuxserver/bazarr
tag: "v1.4.1-ls238"
tag: "v1.4.2-ls240"
ports:
tcp:
web: 6767
@@ -134,7 +134,7 @@ services:
requests:
cpu: 250m
memory: "500M"
jellyplex:
kind: Deployment
disableSVC: true
@@ -154,4 +154,4 @@ services:
memory: "500M"
requests:
cpu: 50m
memory: "500M"
memory: "500M"
@@ -1,4 +1,5 @@
{{ range $k, $v := .Values.apps }}
{{ if $v.enabled }}
---
kind: Service
apiVersion: v1
@@ -117,4 +118,5 @@ spec:
envFrom: {{ ($v.envFrom | default list) | toJson }}
env: {{ ($v.env | default list) | toJson }}
volumeMounts: {{ ($v.volumeMounts | default list) | toJson }}
{{ end }}
{{ end }}
+11 -9
View File
@@ -1,7 +1,8 @@
apps:
quirky:
enabled: true
ingress:
middleware: apps-ingresses-https-redirect
middleware: apps-ingresses-https-redirect
repo: ghcr.io/asosnovsky/quirky
tag: "latest"
podResources:
@@ -20,9 +21,10 @@ apps:
- med
- low
ollama:
enabled: false
ingress:
middleware: apps-ingresses-chain-authentik
repo: ollama/ollama
middleware: apps-ingresses-chain-authentik
repo: ollama/ollama
tag: "latest"
podResources:
limits:
@@ -39,12 +41,12 @@ apps:
tcp:
web: 11434
volumes:
- name: config
persistentVolumeClaim:
claimName: pv-ollama
- name: config
persistentVolumeClaim:
claimName: pv-ollama
volumeMounts:
- name: config
mountPath: /root/.ollama
- name: config
mountPath: /root/.ollama
capacity:
- med
- high
- high
+5 -8
View File
@@ -32,7 +32,7 @@ services:
icon: "https://grafana.core.home.sosnovsky.ca/public/img/fav32.png"
health: "healthz"
- prefix: "authentik.core"
service: "authentik"
service: "authentik-server"
namespace: "chart-authentik"
group: "Core"
icon: "https://authentik.core.home.sosnovsky.ca/static/dist/assets/icons/icon.png"
@@ -91,16 +91,12 @@ services:
namespace: "apps-videohosting"
middleware: "apps-ingresses-chain-authentik"
group: "Video Hosting"
# - prefix: "immich"
# service: "immich-server"
# namespace: "apps-photos"
# middleware: "apps-ingresses-chain-authentik"
# group: "Apps"
# webapp services
{{- $webapps := .Files.Get (printf "apps-values/%s" .Values.apps.webapps.valuesFile) }}
{{- $webapps := tpl $webapps . | fromYaml }}
{{- range $k, $v := $webapps.apps }}
- prefix: "{{ $k }}-app"
{{ if $v.enabled }}
- prefix: "{{ $v.ingress.prefix | default (printf "%s-app" $k) }}"
service: "{{ $k }}"
namespace: "apps-webapps"
port: {{ $v.ports.tcp.web }}
@@ -109,5 +105,6 @@ services:
{{ else }}
middleware: "apps-ingresses-chain-authentik"
{{ end -}}
group: "Basic Webapps"
group: {{ .ingress.group | default "Basic Webapps" }}
{{ end }}
{{- end }}
+1 -1
View File
@@ -54,4 +54,4 @@ nextcloud:
existingClaim: {{ .Values.storage.nextcloudRedisMaster.name }}
replica:
persistence:
storageClass: local-path
storageClass: {{ .Values.global.nfs.storageClass }}
+41 -16
View File
@@ -1,7 +1,8 @@
apps:
quirky:
enabled: true
ingress:
middleware: apps-ingresses-https-redirect
middleware: apps-ingresses-https-redirect
repo: ghcr.io/asosnovsky/quirky
tag: "latest"
podResources:
@@ -19,10 +20,33 @@ apps:
capacity:
- med
- low
ollama:
me:
enabled: true
ingress:
middleware: apps-ingresses-chain-authentik
repo: ollama/ollama
prefix: aboutme
middleware: apps-ingresses-https-redirect
repo: ghcr.io/asosnovsky/aboutme
tag: "latest"
podResources:
limits:
memory: "250Mi"
requests:
cpu: 250m
memory: "250Mi"
health:
readiness: "/"
liveness: "/"
ports:
tcp:
web: 8080
capacity:
- med
- low
ollama:
enabled: false
ingress:
middleware: apps-ingresses-chain-authentik
repo: ollama/ollama
tag: "latest"
podResources:
limits:
@@ -36,19 +60,20 @@ apps:
tcp:
web: 11434
volumes:
- name: config
persistentVolumeClaim:
claimName: {{ .Values.storage.ollama.name }}
- name: config
persistentVolumeClaim:
claimName: {{ .Values.storage.ollama.name }}
volumeMounts:
- name: config
mountPath: /root/.ollama
- name: config
mountPath: /root/.ollama
capacity:
- med
- high
ollama-web:
enabled: false
ingress:
middleware: apps-ingresses-chain-authentik
repo: ghcr.io/ollama-webui/ollama-webui
middleware: apps-ingresses-chain-authentik
repo: ghcr.io/ollama-webui/ollama-webui
tag: "main"
podResources:
limits:
@@ -66,12 +91,12 @@ apps:
tcp:
web: 8080
volumes:
- name: config
persistentVolumeClaim:
claimName: {{ .Values.storage.ollamaWebGui.name }}
- name: config
persistentVolumeClaim:
claimName: {{ .Values.storage.ollamaWebGui.name }}
volumeMounts:
- name: config
mountPath: /app/backend/data
- name: config
mountPath: /app/backend/data
capacity:
- med
- low
+4 -3
View File
@@ -14,8 +14,9 @@ postgresql:
enabled: false
redis:
enabled: true
envFrom:
- secretRef:
name: {{ .Values.secrets.authentik.secrets.env.name }}
global:
envFrom:
- secretRef:
name: {{ .Values.secrets.authentik.secrets.env.name }}
@@ -1,5 +1,6 @@
cleanPrometheusOperatorObjectNames: false
alertmanager:
enabled: true
alertmanagerSpec:
storage:
volumeClaimTemplate:
+2 -1
View File
@@ -1,6 +1,7 @@
global:
deployment: prod
domain: "home.sosnovsky.ca"
domain: "sosnovsky.ca"
secondaryDomain: "skyg.ca"
tls:
useWildCard: true
enabled: true
+4 -2
View File
@@ -6,6 +6,8 @@ global:
email: "ariel@sosnovsky.ca"
timezone: America/Toronto
domain: "changeme"
rootSubDomain: "home"
secondaryDomain: "changeme"
tls:
enabled: false
issuer: ""
@@ -104,12 +106,12 @@ infrastructureCharts:
prometheus:
chart: kube-prometheus-stack
repoURL: "https://prometheus-community.github.io/helm-charts"
targetRevision: "51.10.0"
targetRevision: "56.21.2"
valuesFile: prometheus.yaml
enableServerSideApply: true
authentik:
repoURL: https://charts.goauthentik.io
targetRevision: "2023.10.5"
targetRevision: "2024.2.2"
valuesFile: authentik.yaml
homepage:
repoURL: https://jameswynn.github.io/helm-charts
+2 -2
View File
@@ -5,5 +5,5 @@ type: application
version: 0.1.0
dependencies:
- name: argo-cd
version: 5.35.0
repository: https://argoproj.github.io/argo-helm
version: 6.6.0
repository: https://argoproj.github.io/argo-helm
+1
View File
@@ -30,6 +30,7 @@ spec:
helm:
valueFiles:
- values.yaml
- values-{{ .Values.selfapp.deployment }}.yaml
parameters:
- name: "selfapp.deployment"
value: {{ .Values.selfapp.deployment | quote }}
+2
View File
@@ -0,0 +1,2 @@
global:
domain: argocd.home.internal
+2
View File
@@ -0,0 +1,2 @@
global:
domain: argocd.core.home.sosnovsky.ca
+3
View File
@@ -6,6 +6,9 @@ argo-cd:
server.insecure: true
server.basehref: /
server.rootpath: ""
redis.server: "argocd-redis.argocd.svc.cluster.local:6379"
repo.server: "argocd-repo-server.argocd.svc.cluster.local:8081"
server.dex.server: "http://argocd-dex-server.argocd.svc.cluster.local:5556"
crds:
install: true
keep: false
View File
Whitespace-only changes.