diff --git a/k8s/apps/db-users/Chart.yaml b/k8s/apps/db-users/Chart.yaml
deleted file mode 100644
index 1b3cb96..0000000
--- a/k8s/apps/db-users/Chart.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-apiVersion: v2
-name: users
-description: An apps service for homelab
-type: application
-version: 0.1.0
-dependencies: []
diff --git a/k8s/apps/db-users/templates/_helpers/user-generation/entry.sh.tpl b/k8s/apps/db-users/templates/_helpers/user-generation/entry.sh.tpl
deleted file mode 100644
index edc433d..0000000
--- a/k8s/apps/db-users/templates/_helpers/user-generation/entry.sh.tpl
+++ /dev/null
@@ -1,12 +0,0 @@
-{{- define "pg-users.entry" -}}
-#!/bin/sh
-
-cp -r /app /tmp/app
-
-cd /tmp/app && \
- terraform init && \
- terraform apply -auto-approve -input=false \
- -var-file="/app/users.tfvars" \
- -var-file="/app/db_users_dbs.tfvars" \
- -lock=false
-{{- end -}}
\ No newline at end of file
diff --git a/k8s/apps/db-users/templates/_helpers/user-generation/terraform.tf.tpl b/k8s/apps/db-users/templates/_helpers/user-generation/terraform.tf.tpl
deleted file mode 100644
index 91d833a..0000000
--- a/k8s/apps/db-users/templates/_helpers/user-generation/terraform.tf.tpl
+++ /dev/null
@@ -1,111 +0,0 @@
-{{- define "pg-users.terraform" -}}
-variable "db_host" {}
-variable "db_username" {}
-variable "db_password" {}
-variable "db_users" {
- type = list(string)
-}
-variable "db_port" {
- type = number
- default = 5432
-}
-variable "db_users_dbs" {
- type = map(list(string))
- default = {}
-}
-terraform {
- required_providers {
- postgresql = {
- source = "cyrilgdn/postgresql"
- version = "{{.Values.terraform.cyrilgdnPostgresql.tag}}"
- }
- }
-}
-
-terraform {
- backend "kubernetes" {
- secret_suffix = "{{ .Release.Name }}"
- in_cluster_config = true
- namespace = "{{ .Release.Namespace }}"
- }
-}
-
-
-provider "postgresql" {
- host = var.db_host
- port = var.db_port
- username = var.db_username
- password = var.db_password
- connect_timeout = 15
- sslmode = "disable"
-}
-
-resource "random_password" "pg_users_pswd" {
- count = length(var.db_users)
-
- length = 16
- special = true
- override_special = "!#$%&"
-}
-
-
-locals {
- users = {
- for u, pwd in random_password.pg_users_pswd :
- var.db_users[u] => pwd.result
- }
- users_db = distinct(flatten([
- for user, dbs in var.db_users_dbs: [
- for db in dbs: {
- db = db
- user = user
- }
- ]
- ]))
-}
-
-resource "kubernetes_secret" "pg_users" {
- for_each = local.users
- metadata {
- name = "password.pg.${each.key}"
- namespace = "{{ .Release.Namespace }}"
- annotations = {
- "managed-by": "job/user-generation"
- }
- }
-
- data = {
- username = each.key
- password = each.value
- host = var.db_host
- port = var.db_port
- additional_dbs = jsonencode({
- for dbName in try(var.db_users_dbs[each.key], []):
- dbName => "${each.key}-${dbName}"
- })
- }
-
- type = "Opaque"
-}
-
-resource "postgresql_role" "u" {
- for_each = local.users
- name = each.key
- password = each.value
- login = true
-}
-
-resource "postgresql_database" "db" {
- for_each = local.users
- name = each.key
- owner = postgresql_role.u[each.key].id
-}
-
-resource "postgresql_database" "db_users" {
- for_each = { for ud in local.users_db: "${ud.user}-${ud.db}" => ud }
- name = each.key
- owner = postgresql_role.u[each.value.user].id
-}
-
-
-{{- end -}}
\ No newline at end of file
diff --git a/k8s/apps/db-users/templates/rbac.yml b/k8s/apps/db-users/templates/rbac.yml
deleted file mode 100644
index e506313..0000000
--- a/k8s/apps/db-users/templates/rbac.yml
+++ /dev/null
@@ -1,41 +0,0 @@
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: Role
-metadata:
- name: {{ .Release.Name }}
- namespace: {{ .Release.Namespace }}
-rules:
-- apiGroups: [""]
- resources: ["secrets"]
- verbs: ["list", "create"]
-- apiGroups: [""]
- resources: ["secrets"]
- verbs: ["get", "update", "create", "patch", "delete"]
-- apiGroups: ["coordination.k8s.io"]
- resources: ["leases"]
- verbs: ["get", "update", "create", "patch", "delete"]
- resourceNames: ["lock-tfstate-default-{{ .Release.Name }}"]
-- apiGroups: ["coordination.k8s.io"]
- resources: ["leases"]
- verbs: ["create"]
----
-apiVersion: v1
-automountServiceAccountToken: true
-kind: ServiceAccount
-metadata:
- name: {{ .Release.Name }}
- namespace: {{ .Release.Namespace }}
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: RoleBinding
-metadata:
- name: {{ .Release.Name }}
- namespace: {{ .Release.Namespace }}
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: Role
- name: {{ .Release.Name }}
-subjects:
-- kind: ServiceAccount
- name: {{ .Release.Name }}
- namespace: {{ .Release.Namespace }}
\ No newline at end of file
diff --git a/k8s/apps/db-users/templates/users-job.yaml b/k8s/apps/db-users/templates/users-job.yaml
deleted file mode 100644
index 1688fbf..0000000
--- a/k8s/apps/db-users/templates/users-job.yaml
+++ /dev/null
@@ -1,60 +0,0 @@
----
-apiVersion: batch/v1
-kind: Job
-metadata:
- name: "user-generation"
- namespace: "{{ .Release.Namespace }}"
- annotations:
- checksum/run-sh: "{{ include "pg-users.entry" . | sha256sum }}"
- checksum/main-tf: "{{ include "pg-users.terraform" . | sha256sum }}"
- checksum/users-tfvars: "{{ (print "db_users = " ( .Values.userGeneration.users | toJson )) | sha256sum }}"
- checksum/users_dbs-tfvars: "{{ (print "db_users_dbs = " ( .Values.userGeneration.users_dbs | toJson )) | sha256sum }}"
- helm.sh/hook: post-install
- helm.sh/hook-delete-policy: before-hook-creation
-spec:
- template:
- metadata:
- annotations:
- checksum/run-sh: "{{ include "pg-users.entry" . | sha256sum }}"
- checksum/main-tf: "{{ include "pg-users.terraform" . | sha256sum }}"
- checksum/users-tfvars: "{{ (print "db_users = " ( .Values.userGeneration.users | toJson )) | sha256sum }}"
- checksum/users_dbs-tfvars: "{{ (print "db_users_dbs = " ( .Values.userGeneration.users_dbs | toJson )) | sha256sum }}"
- spec:
- serviceAccount: "{{ .Release.Name }}"
- serviceAccountName: "{{ .Release.Name }}"
- volumes:
- - name: tffiles
- secret:
- secretName: "user-generation-tf"
- containers:
- - name: base
- image: "hashicorp/terraform:{{ .Values.userGeneration.tfVersion }}"
- command:
- - sh
- - /app/run.sh
- volumeMounts:
- - mountPath: /app
- name: tffiles
- env:
- - name: TF_LOG_PATH
- value: /tmp/terraform.log
- - name: TF_INPUT
- value: "0"
- - name: TF_DATA_DIR
- value: /tmp/.terraform
- - name: TF_IN_AUTOMATION
- value: "1"
- - name: TF_VAR_db_host
- value: "postgres.{{ .Release.Namespace }}.svc.cluster.local"
- - name: TF_VAR_db_username
- valueFrom:
- secretKeyRef:
- name: "{{ .Values.postgresSecret }}"
- key: "username"
- - name: TF_VAR_db_password
- valueFrom:
- secretKeyRef:
- name: "{{ .Values.postgresSecret }}"
- key: "password"
- restartPolicy: Never
- backoffLimit: 2
diff --git a/k8s/apps/db-users/templates/users-secret.yaml b/k8s/apps/db-users/templates/users-secret.yaml
deleted file mode 100644
index 439359e..0000000
--- a/k8s/apps/db-users/templates/users-secret.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
----
-apiVersion: v1
-kind: Secret
-type: Opaque
-metadata:
- name: "user-generation-tf"
- namespace: "{{ .Release.Namespace }}"
-data:
- run.sh: "{{ include "pg-users.entry" . | b64enc }}"
- main.tf: "{{ include "pg-users.terraform" . | b64enc }}"
- users.tfvars: "{{ (print "db_users = " ( .Values.userGeneration.users | toJson )) | b64enc }}"
- db_users_dbs.tfvars: "{{ (print "db_users_dbs = " ( .Values.userGeneration.users_dbs | toJson )) | b64enc }}"
diff --git a/k8s/apps/db-users/values-dev.yaml b/k8s/apps/db-users/values-dev.yaml
deleted file mode 100644
index e69de29..0000000
diff --git a/k8s/apps/db-users/values-prod.yaml b/k8s/apps/db-users/values-prod.yaml
deleted file mode 100644
index e69de29..0000000
diff --git a/k8s/apps/db-users/values.yaml b/k8s/apps/db-users/values.yaml
deleted file mode 100644
index bcfbcbb..0000000
--- a/k8s/apps/db-users/values.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-userGeneration:
- tfVersion: "1.3.7"
- users:
- - nextcloud
- - authentik
- - radarr
- - sonarr
- - prowlarr
- - immich
- - readarr
- - bazarr
- users_dbs:
- radarr: [log, cache]
- sonarr: [log, cache]
- prowlarr: [log, cache]
- readarr: [log, cache]
- bazarr: [log, cache]
-
-postgresSecret: ""
-
-terraform:
- cyrilgdnPostgresql:
- tag: 1.18.0
\ No newline at end of file
diff --git a/k8s/apps/ingresses/Chart.yaml b/k8s/apps/ingresses/Chart.yaml
deleted file mode 100644
index 1bfe146..0000000
--- a/k8s/apps/ingresses/Chart.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-apiVersion: v2
-name: ingresses
-description: An apps service for homelab
-type: application
-version: 0.1.0
-dependencies: []
diff --git a/k8s/apps/ingresses/templates/_helpers/domain.yaml b/k8s/apps/ingresses/templates/_helpers/domain.yaml
deleted file mode 100644
index d8f6d77..0000000
--- a/k8s/apps/ingresses/templates/_helpers/domain.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-{{- define "homelab.ingress.domain" -}}
- {{- $rootPrefix := empty .leadPrefix | ternary "" (printf "%s." .leadPrefix) -}}
- {{- if .useSecondaryDomain -}}
-{{$rootPrefix}}{{.global.secondaryDomain}}
- {{- else -}}
- {{- if .useDirectPrefix -}}
-{{$rootPrefix}}{{.global.domain}}
- {{- else -}}
-{{$rootPrefix}}{{.global.rootSubDomain}}.{{.global.domain}}
- {{- end -}}
- {{- end -}}
-{{- end -}}
diff --git a/k8s/apps/ingresses/templates/_helpers/ingress.tls.yaml b/k8s/apps/ingresses/templates/_helpers/ingress.tls.yaml
deleted file mode 100644
index fd79b64..0000000
--- a/k8s/apps/ingresses/templates/_helpers/ingress.tls.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-{{ define "homelab.ingress.domain.tls"}}
-{{ if (.useWildCard | default .global.tls.useWildCard) }}
----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
- name: "tls-{{.prefix}}.{{ .domain }}"
- namespace: {{ .namespace }}
-spec:
- refreshInterval: 1h
- secretStoreRef:
- kind: ClusterSecretStore
- name: apps-ingresses
- target:
- name: tls-{{.prefix}}.{{ .domain }}
- creationPolicy: Owner
- deletionPolicy: Delete
- data:
- - secretKey: tls.crt
- remoteRef:
- key: cloudflare-wildcard.{{ .domain }}
- property: tls.crt
- - secretKey: tls.key
- remoteRef:
- key: cloudflare-wildcard.{{ .domain }}
- property: tls.key
-{{ else }}
----
-apiVersion: cert-manager.io/v1
-kind: Certificate
-metadata:
- name: "tls-{{.prefix}}.{{ .domain }}"
- namespace: {{ .namespace }}
-spec:
- secretName: "tls-{{.prefix}}.{{ .domain }}"
- issuerRef:
- kind: ClusterIssuer
- name: "{{ .global.tls.issuer }}"
- commonName: "{{.prefix}}.{{ .domain }}"
- dnsNames:
- - "{{.prefix}}.{{ .domain }}"
-{{ end }}
-{{ end }}
\ No newline at end of file
diff --git a/k8s/apps/ingresses/templates/_helpers/ingress.yaml b/k8s/apps/ingresses/templates/_helpers/ingress.yaml
deleted file mode 100644
index d1b85d8..0000000
--- a/k8s/apps/ingresses/templates/_helpers/ingress.yaml
+++ /dev/null
@@ -1,122 +0,0 @@
-{{- define "homelab.ingress" }}
-
-#
-# Input: = {{ . | toJson }}
-# prefix: str = {{ .prefix }}
-# service: str = {{ .service }}
-# namespace: str = {{ .namespace }}
-# global: map (should be .global) = {{ .global | toJson }}
-# port: int = 80 = {{ .port }}
-# path: str = "/" = {{ .path }}
-# useWildCard: bool = False = {{ .useWildCard }}
-# middleware: str = "https-redirect" = {{ .middleware }}
-# useSecondaryDomain: bool = False = {{ .useSecondaryDomain }}
-# useDirectPrefix: bool = False = {{ .useDirectPrefix }}
-# widget: bool = False = {{ .widget | toJson }}
-#
-
-
-{{- $splitPrefix := splitList "." .prefix -}}
-{{- $prefix := first $splitPrefix -}}
-{{- $leadPrefix := join "." (rest $splitPrefix) -}}
-
-{{- $_ := set . "prefix" $prefix -}}
-{{- $_ := set . "leadPrefix" $leadPrefix -}}
-
-{{- $domain := (include "homelab.ingress.domain" .) -}}
-
-{{- $_ := set . "domain" $domain -}}
-
-# .domain = {{ .domain }}
-# .prefix = {{ .prefix }}
-{{ if .global.tls.enabled }}
-{{ include "homelab.ingress.domain.tls" . }}
-{{ end }}
----
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: "{{.prefix}}.{{ $domain }}"
- namespace: {{ .namespace }}
- annotations:
- homelab-ingress/managing-app-namespace: "apps-ingresses"
- traefik.ingress.kubernetes.io/router.middlewares: {{ .middleware | default "apps-ingresses-https-redirect"}}@kubernetescrd
- gethomepage.dev/enabled: "true"
- gethomepage.dev/name: "{{.prefix}}@{{.namespace}}"
- gethomepage.dev/siteMonitor: 'http://{{.service}}.{{ .namespace }}.svc.cluster.local:{{.port | default 80}}{{ .path | default "/" }}{{ .health | default "" }}'
- {{ if .description}}
- gethomepage.dev/description: "{{ .description }}"
- {{ end }}
- gethomepage.dev/group: {{ .group | default "Unassigned" }}
- {{ if .icon }}
- gethomepage.dev/icon: "{{.icon}}"
- {{ else }}
- gethomepage.dev/icon: "homepage.png"
- {{ end }}
- {{ if .widget }}
- {{ range $k, $v := .widget }}
- gethomepage.dev/widget.{{$k}}: {{ $v | quote }}
- {{ end }}
- {{ end }}
- {{ range $k, $v := (.annotations | default (dict )) }}
- {{ $k }}: {{ $v }}
- {{ end }}
-spec:
- rules:
- - host: "{{.prefix}}.{{ $domain }}"
- http:
- paths:
- - backend:
- service:
- name: "{{.service}}"
- port:
- number: {{.port | default 80}}
- path: {{ .path | default "/" }}
- pathType: Prefix
- {{ if .global.tls.enabled }}
- tls:
- - secretName: "tls-{{.prefix}}.{{ $domain }}"
- hosts:
- - "{{.prefix}}.{{ $domain }}"
- {{ end }}
----
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: "{{.prefix}}.internal"
- namespace: {{ .namespace }}
- annotations:
- homelab-ingress/managing-app-namespace: "apps-ingresses"
- gethomepage.dev/enabled: "true"
- gethomepage.dev/name: "{{.prefix}}@{{.namespace}}"
- gethomepage.dev/siteMonitor: 'http://{{.service}}.{{ .namespace }}.svc.cluster.local:{{.port | default 80}}{{ .path | default "/" }}{{ .health | default "" }}'
- {{ if .description}}
- gethomepage.dev/description: "{{ .description }}"
- {{ end }}
- gethomepage.dev/group: Internal({{ .group | default "Unassigned" }})
- {{ if .icon }}
- gethomepage.dev/icon: "{{.icon}}"
- {{ else }}
- gethomepage.dev/icon: "homepage.png"
- {{ end }}
- {{ if .widget }}
- {{- range $k, $v := .widget }}
- gethomepage.dev/widget.{{$k}}: {{ $v | quote }}
- {{- end }}
- {{ end }}
- {{ range $k, $v := (.annotations | default (dict )) }}
- {{ $k }}: {{ $v }}
- {{ end }}
-spec:
- rules:
- - host: "{{.prefix}}.k3sapp.internal"
- http:
- paths:
- - backend:
- service:
- name: "{{.service}}"
- port:
- number: {{.port | default 80}}
- path: {{ .path | default "/" }}
- pathType: Prefix
-{{- end -}}
\ No newline at end of file
diff --git a/k8s/apps/ingresses/templates/authentik.yaml b/k8s/apps/ingresses/templates/authentik.yaml
deleted file mode 100644
index ab9c848..0000000
--- a/k8s/apps/ingresses/templates/authentik.yaml
+++ /dev/null
@@ -1,84 +0,0 @@
----
-apiVersion: traefik.containo.us/v1alpha1
-kind: IngressRoute
-metadata:
- name: authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}
- namespace: chart-authentik
-spec:
- routes:
- - kind: Rule
- match: "Host(`authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}`)"
- middlewares:
- - name: forwardauth-authentik
- namespace: chart-authentik
- priority: 10
- services:
- - kind: Service
- name: authentik-server
- namespace: chart-authentik
- port: 80
- - kind: Rule
- match: "Host(`authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}`) && PathPrefix(`/outpost.goauthentik.io/`)"
- priority: 15
- services:
- - kind: Service
- name: authentik-server
- namespace: chart-authentik
- port: 80
-{{ if .Values.global.tls.enabled }}
- tls:
- secretName: tls-authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}
- domains:
- - main: authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}
-{{ end }}
----
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: forwardauth-authentik
- namespace: chart-authentik
-spec:
- forwardAuth:
- address: http://authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}/outpost.goauthentik.io/auth/traefik
- trustForwardHeader: true
- authResponseHeaders:
- - X-authentik-username
- - X-authentik-groups
- - X-authentik-email
- - X-authentik-name
- - X-authentik-uid
- - X-authentik-jwt
- - X-authentik-meta-jwks
- - X-authentik-meta-outpost
- - X-authentik-meta-provider
- - X-authentik-meta-app
- - X-authentik-meta-version
----
-{{ if .Values.global.tls.enabled }}
-{{ include "homelab.ingress.domain.tls" (dict "global" .Values.global "namespace" "chart-authentik" "prefix" "authentik.home" "domain" .Values.global.domain ) }}
----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
- name: "authentik-outpost-tls"
- namespace: chart-authentik
-spec:
- refreshInterval: 1h
- secretStoreRef:
- kind: ClusterSecretStore
- name: apps-ingresses
- target:
- name: "authentik-outpost-tls"
- creationPolicy: Owner
- deletionPolicy: Delete
- data:
- - secretKey: tls.crt
- remoteRef:
- key: cloudflare-wildcard.{{ .Values.global.domain }}
- property: tls.crt
- - secretKey: tls.key
- remoteRef:
- key: cloudflare-wildcard.{{ .Values.global.domain }}
- property: tls.key
-{{ end }}
-
diff --git a/k8s/apps/ingresses/templates/clusterissuer.yaml b/k8s/apps/ingresses/templates/clusterissuer.yaml
deleted file mode 100644
index d384e19..0000000
--- a/k8s/apps/ingresses/templates/clusterissuer.yaml
+++ /dev/null
@@ -1,106 +0,0 @@
-{{ if .Values.global.tls.enabled }}
----
-apiVersion: cert-manager.io/v1
-kind: ClusterIssuer
-metadata:
- name: {{ .Values.global.tls.issuer }}
-spec:
- acme:
- server: {{ .Values.global.tls.acmeServer }}
- skipTLSVerify: {{ .Values.global.tls.skipTLSVerify }}
- email: {{ .Values.global.email }}
- privateKeySecretRef:
- name: {{ .Values.global.tls.issuer }}
- solvers:
- - http01:
- ingress:
- class: traefik
-
-{{ if .Values.cloudflare.enabled }}
----
-apiVersion: cert-manager.io/v1
-kind: Issuer
-metadata:
- name: cloudflare
-spec:
- acme:
- server: {{ .Values.global.tls.acmeServer }}
- skipTLSVerify: {{ .Values.global.tls.skipTLSVerify }}
- email: {{ .Values.global.email }}
- privateKeySecretRef:
- name: cloudflare
- solvers:
- - dns01:
- cloudflare:
- apiTokenSecretRef:
- name: {{ .Values.cloudflare.tokenSecretName }}
- key: {{ .Values.cloudflare.tokenSecretKey }}
-{{ range $prefix := .Values.cloudflare.certificateRootDomains }}
----
-apiVersion: cert-manager.io/v1
-kind: Certificate
-metadata:
- name: cloudflare-wildcard{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}
-spec:
- secretName: cloudflare-wildcard{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}
- issuerRef:
- name: cloudflare
- kind: Issuer
- commonName: '*{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}'
- dnsNames:
- - "*{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}"
-{{ end }}
----
-apiVersion: cert-manager.io/v1
-kind: Certificate
-metadata:
- name: cloudflare-wildcard.{{ $.Values.global.domain }}
-spec:
- secretName: cloudflare-wildcard.{{ $.Values.global.domain }}
- issuerRef:
- name: cloudflare
- kind: Issuer
- commonName: '*.{{ $.Values.global.domain }}'
- dnsNames:
- - "*.{{ $.Values.global.domain }}"
----
-apiVersion: cert-manager.io/v1
-kind: Certificate
-metadata:
- name: cloudflare-wildcard.{{ $.Values.global.secondaryDomain }}
-spec:
- secretName: cloudflare-wildcard.{{ $.Values.global.secondaryDomain }}
- issuerRef:
- name: cloudflare
- kind: Issuer
- commonName: '*.{{ $.Values.global.secondaryDomain }}'
- dnsNames:
- - "*.{{ $.Values.global.secondaryDomain }}"
----
-apiVersion: cert-manager.io/v1
-kind: Certificate
-metadata:
- name: cloudflare.{{ $.Values.global.domain }}
-spec:
- secretName: cloudflare.{{ $.Values.global.domain }}
- issuerRef:
- name: cloudflare
- kind: Issuer
- commonName: '{{ $.Values.global.domain }}'
- dnsNames:
- - "{{ $.Values.global.domain }}"
----
-apiVersion: cert-manager.io/v1
-kind: Certificate
-metadata:
- name: cloudflare.{{ $.Values.global.secondaryDomain }}
-spec:
- secretName: cloudflare.{{ $.Values.global.secondaryDomain }}
- issuerRef:
- name: cloudflare
- kind: Issuer
- commonName: '{{ $.Values.global.secondaryDomain }}'
- dnsNames:
- - "{{ $.Values.global.secondaryDomain }}"
-{{ end }}
-{{ end }}
\ No newline at end of file
diff --git a/k8s/apps/ingresses/templates/dummy-pod.yaml b/k8s/apps/ingresses/templates/dummy-pod.yaml
deleted file mode 100644
index a788fa7..0000000
--- a/k8s/apps/ingresses/templates/dummy-pod.yaml
+++ /dev/null
@@ -1,40 +0,0 @@
----
-kind: Deployment
-apiVersion: apps/v1
-metadata:
- name: dummy-app
- namespace: "{{ .Release.Namespace }}"
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: dummy
- release: "{{ .Release.Name }}"
- template:
- metadata:
- labels:
- app: dummy
- release: "{{ .Release.Name }}"
- spec:
- containers:
- - name: name
- image: nginxdemos/hello
- resources:
- limits:
- memory: 1Gi
- ports:
- - containerPort: 80
----
-kind: Service
-apiVersion: v1
-metadata:
- name: dummy-app
-spec:
- selector:
- app: dummy
- release: "{{ .Release.Name }}"
- type: ClusterIP
- ports:
- - name: http
- port: 80
- targetPort: 80
diff --git a/k8s/apps/ingresses/templates/middleware-common.yaml b/k8s/apps/ingresses/templates/middleware-common.yaml
deleted file mode 100644
index 7aacc42..0000000
--- a/k8s/apps/ingresses/templates/middleware-common.yaml
+++ /dev/null
@@ -1,63 +0,0 @@
----
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: https-redirect
- namespace: "{{ .Release.Namespace }}"
-spec:
- redirectScheme:
- scheme: https
----
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: strict-transport
- namespace: "{{ .Release.Namespace }}"
-spec:
- headers:
- hostsProxyHeaders:
- - "X-Forwarded-Host"
- referrerPolicy: "same-origin"
- stsSeconds: 15552000
- stsIncludeSubdomains: true
- stsPreload: true
- forceSTSHeader: true
----
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: chain-authentik
- namespace: "{{ .Release.Namespace }}"
-spec:
- chain:
- middlewares:
- - name: https-redirect
- namespace: "{{ .Release.Namespace }}"
- - name: forwardauth-authentik
- namespace: "{{ .Release.Namespace }}"
-
----
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: forwardauth-authentik
- namespace: "{{ .Release.Namespace }}"
- labels:
- app.kubernetes.io/instance: authentik
- app.kubernetes.io/name: authentik
-spec:
- forwardAuth:
- address: http://authentik-server.chart-authentik.svc.cluster.local:80/outpost.goauthentik.io/auth/traefik
- trustForwardHeader: true
- authResponseHeaders:
- - X-authentik-username
- - X-authentik-groups
- - X-authentik-email
- - X-authentik-name
- - X-authentik-uid
- - X-authentik-jwt
- - X-authentik-meta-jwks
- - X-authentik-meta-outpost
- - X-authentik-meta-provider
- - X-authentik-meta-app
- - X-authentik-meta-version
diff --git a/k8s/apps/ingresses/templates/middleware-nextcloud.yaml b/k8s/apps/ingresses/templates/middleware-nextcloud.yaml
deleted file mode 100644
index ea3ae72..0000000
--- a/k8s/apps/ingresses/templates/middleware-nextcloud.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
----
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: nextcloud
- namespace: apps-nextcloud
-spec:
- chain:
- middlewares:
- - name: https-redirect
- namespace: "{{ .Release.Namespace }}"
- - name: apps-nextcloud-well-known
- - name: apps-nextcloud-well-known-web-finger
- - name: strict-transport
- namespace: "{{ .Release.Namespace }}"
-
----
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: apps-nextcloud-well-known
- namespace: apps-nextcloud
-spec:
- redirectRegex:
- permanent: true
- regex: "https://(.*)/.well-known/(?:card|cal)dav"
- replacement: "https://${1}/remote.php/dav"
-
----
-apiVersion: traefik.containo.us/v1alpha1
-kind: Middleware
-metadata:
- name: apps-nextcloud-well-known-web-finger
- namespace: apps-nextcloud
-spec:
- redirectRegex:
- permanent: true
- regex: "https://(.*)/.well-known/webfinger"
- replacement: "https://${1}/public.php?service=webfinger"
diff --git a/k8s/apps/ingresses/templates/reverse-proxy.yaml b/k8s/apps/ingresses/templates/reverse-proxy.yaml
deleted file mode 100644
index da5dbb0..0000000
--- a/k8s/apps/ingresses/templates/reverse-proxy.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-{{ range $prefix, $data := .Values.reverseProxy }}
----
-apiVersion: v1
-kind: Endpoints
-metadata:
- name: "reverse-proxy-{{$prefix}}"
-subsets:
-- addresses:
- - ip: "{{ $data.ip }}"
- ports:
- - port: {{ $data.port | default 80 }}
- protocol: TCP
----
-apiVersion: v1
-kind: Service
-metadata:
- name: "reverse-proxy-{{$prefix}}"
-spec:
- type: ClusterIP
- ports:
- - port: 80
- protocol: TCP
- targetPort: {{ $data.port | default 80 }}
-{{ if (not $data.disableIngress) }}
-{{- $ingressDef := (dict "service" (printf "reverse-proxy-%s" $prefix) "prefix" $prefix "global" $.Values.global "namespace" $.Release.Namespace "group" "Reverse Proxies" ) -}}
-{{- $ingressDef := (merge ($data.overrides | default (dict)) $ingressDef) -}}
-
-{{ include "homelab.ingress" $ingressDef}}
-
-{{ end }}
-
-{{ end }}
\ No newline at end of file
diff --git a/k8s/apps/ingresses/templates/services.yaml b/k8s/apps/ingresses/templates/services.yaml
deleted file mode 100644
index 73c190b..0000000
--- a/k8s/apps/ingresses/templates/services.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-{{ range $svc := .Values.services }}
-{{ include "homelab.ingress" (merge $svc (dict "global" $.Values.global)) }}
-{{ end }}
\ No newline at end of file
diff --git a/k8s/apps/ingresses/templates/static-files.yaml b/k8s/apps/ingresses/templates/static-files.yaml
deleted file mode 100644
index f47cd64..0000000
--- a/k8s/apps/ingresses/templates/static-files.yaml
+++ /dev/null
@@ -1,127 +0,0 @@
-
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: "sec-domain-static-files"
-data:
-{{ range $staticFile := .Values.staticFiles.secondaryDomain }}
- {{$staticFile.path}}: |
- {{ $staticFile.content | nindent 6 }}
-{{ end }}
-
----
-kind: Deployment
-apiVersion: apps/v1
-metadata:
- name: "sec-domain-host"
- labels:
- app: "static-files"
- domain: "{{$.Values.global.secondaryDomain}}"
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: "static-files"
- domain: "{{$.Values.global.secondaryDomain}}"
- template:
- metadata:
- annotations:
- {{ range $staticFile := .Values.staticFiles.secondaryDomain }}
- "checksum/{{$staticFile.path}}": "{{ $staticFile.content | sha256sum }}"
- {{ end }}
- labels:
- app: "static-files"
- domain: "{{$.Values.global.secondaryDomain}}"
- spec:
- volumes:
- - name: static-files
- configMap:
- name: "sec-domain-static-files"
- containers:
- - name: api
- image: caddy:2.7-alpine
- command:
- - caddy
- - file-server
- - --root
- - /files
- - --listen
- - '0.0.0.0:80'
- volumeMounts:
- - mountPath: /files
- name: static-files
- resources:
- limits:
- memory: 1Gi
- ports:
- - containerPort: 80
----
-kind: Service
-apiVersion: v1
-metadata:
- name: "sec-domain-static-files"
- labels:
- app: "static-files"
- domain: "{{$.Values.global.secondaryDomain}}"
-spec:
- selector:
- app: "static-files"
- domain: "{{$.Values.global.secondaryDomain}}"
- type: ClusterIP
- ports:
- - name: http
- port: 80
- targetPort: 80
-
----
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: "sec-domain-static-files"
- annotations:
- homelab-ingress/managing-app-namespace: "apps-ingresses"
-spec:
- rules:
- - host: "{{ $.Values.global.secondaryDomain }}"
- http:
- paths:
- - path: "/"
- pathType: Exact
- backend:
- service:
- name: "sec-domain-static-files"
- port:
- number: 80
-{{ range $staticFile := .Values.staticFiles.secondaryDomain }}
- - backend:
- service:
- name: "sec-domain-static-files"
- port:
- number: 80
- path: "/{{$staticFile.path}}"
- pathType: Exact
-{{ end }}
- {{ if $.Values.global.tls.enabled }}
- tls:
- - secretName: "tls-{{ $.Values.global.secondaryDomain }}"
- hosts:
- - "{{ $.Values.global.secondaryDomain }}"
- {{ end }}
-
-
-{{ if $.Values.global.tls.enabled }}
----
-apiVersion: cert-manager.io/v1
-kind: Certificate
-metadata:
- name: "tls-{{ $.Values.global.secondaryDomain }}"
-spec:
- secretName: "tls-{{ $.Values.global.secondaryDomain }}"
- issuerRef:
- kind: ClusterIssuer
- name: "{{ $.Values.global.tls.issuer }}"
- commonName: "{{ $.Values.global.secondaryDomain }}"
- dnsNames:
- - "{{ $.Values.global.secondaryDomain }}"
-{{ end }}
diff --git a/k8s/apps/ingresses/values-dev.yaml b/k8s/apps/ingresses/values-dev.yaml
deleted file mode 100644
index 3d53ce0..0000000
--- a/k8s/apps/ingresses/values-dev.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-reverseProxy:
- home:
- port: "8123"
- ip: "192.168.0.20"
- yellow:
- port: "8123"
- ip: "192.168.0.23"
-services:
- - prefix: "argocd.core"
- service: "argocd-server"
- namespace: "argocd"
- group: "Core"
- icon: "assets/favicon/favicon-32x32.png"
- - prefix: "demo"
- service: "dummy-app"
- namespace: "apps-ingresses"
- middleware: "apps-ingresses-forwardauth-authentik"
- group: "Demo"
- - prefix: "sonarr"
- service: "sonarr"
- namespace: "apps-sonarr"
- group: "Video Hosting"
- widget:
- type: sonarr
- fields: '["wanted", "queued"]'
- url: http://sonarr.host.or.ip
- key: apikeyapikeyapikeyapikeyapikey
-staticFiles:
- mainDomain: []
- secondaryDomain:
- - path: "ads.txt"
- content: |
- google.com, pub-6915532978483380, DIRECT, f08c47fec0942fa0
\ No newline at end of file
diff --git a/k8s/apps/ingresses/values-prod.yaml b/k8s/apps/ingresses/values-prod.yaml
deleted file mode 100644
index fed86c9..0000000
--- a/k8s/apps/ingresses/values-prod.yaml
+++ /dev/null
@@ -1,227 +0,0 @@
-global:
- tls:
- enabled: true
-reverseProxy:
- personal:
- ip: 10.0.0.119
- port: "8000"
- overrides:
- group: "Misc"
-
- castle:
- ip: "10.0.12.1"
- port: "80"
- overrides:
- icon: http://10.0.12.1:80/static/icons/favicon.ico
-
- kuma:
- ip: "10.0.12.1"
- port: "3001"
- overrides:
- icon: "https://kuma.home.sosnovsky.ca/apple-touch-icon.png"
- overrides:
- middleware: "apps-ingresses-chain-authentik"
- widget:
- type: uptimekuma
- url: http://10.0.12.1:3001
- slug: main
-
- basement:
- ip: "10.0.12.2"
- port: "80"
- overrides:
- icon: http://10.0.12.2:80/static/icons/favicon.ico
-
- pitorrent:
- ip: "10.0.10.3"
- port: "8080"
- overrides:
- middleware: "apps-ingresses-chain-authentik"
- group: "Video Hosting"
- widget:
- type: qbittorrent
- url: http://10.0.10.3:8080
-
- esphome:
- ip: "10.0.10.4"
- port: "6052"
- overrides:
- middleware: "apps-ingresses-chain-authentik"
-
- scrypted:
- ip: "10.0.10.7"
- port: "11080"
- overrides:
- group: "Cameras"
-
- fwscode:
- ip: 10.0.10.4
- port: 8443
- overrides:
- group: "Framework Services"
- middleware: "apps-ingresses-chain-authentik"
-
- fwdockge:
- ip: 10.0.10.4
- port: 5050
- overrides:
- group: "Framework Services"
- middleware: "apps-ingresses-chain-authentik"
-
- abs:
- ip: 10.0.10.6
- port: 8000
- overrides:
- prefix: "abs.vh"
- middleware: "apps-ingresses-chain-authentik"
- group: "Video Hosting"
-
- jellyfin:
- ip: 10.0.10.5
- port: 8096
- overrides:
- prefix: "jellyfin"
- # middleware: "apps-ingresses-chain-authentik"
- group: "Video Hosting"
-
- events:
- ip: 10.0.10.6
- port: 9999
- overrides:
- group: "Apps"
- useSecondaryDomain: true
-
-cloudflare:
- enabled: true
-
-staticFiles:
- mainDomain: []
- secondaryDomain:
- - path: "ads.txt"
- content: |
- google.com, pub-6915532978483380, DIRECT, f08c47fec0942fa0
- - path: "index.html"
- content: |
-
SkyG
- Site in Development
- - path: "data-deletion-policy"
- content: |
-
-
-
- Data Deletion Policy
-
-
-
- Data Deletion Policy
- This policy outlines the procedures for deleting data from our app, which helps host private events.
- Data Retention
- We retain data for a limited period of time, as outlined below:
-
- - Event data: We retain event data for a period of 1 year after the event has ended.
- - User data: We retain user data for a period of 1 year after the user's account is deactivated.
-
- Data Deletion Requests
- If you would like to request the deletion of your data, please email ariel@sosnovsky.ca with the following information:
-
- - Your name
- - Your email address
- - A description of the data you would like to have deleted
-
- We will respond to your request within 30 days and delete the requested data within 60 days.
- Data Deletion Process
- When we receive a data deletion request, we will:
-
- - Verify the identity of the requestor
- - Locate and identify the data to be deleted
- - Delete the data from our systems
- - Confirm the deletion to the requestor
-
- Data Security
- We take the security of your data seriously and have implemented measures to protect it from unauthorized access,
- use, or disclosure. These measures include:
-
- - Data encryption
- - Access controls
- - Regular security audits
-
- Contact Us
- If you have any questions or concerns about this policy, please email ariel@sosnovsky.ca.
-
-
-
- - path: "privacy-policy"
- content: |
-
-
- Privacy Policy
-
- Introduction
-
- SkyG is committed to protecting the privacy of our users. This privacy policy explains how we collect, use, and disclose information when you use our app to manage private events.
-
- Information We Collect
-
- When you create an account with us, we collect the following information:
-
- * Your name and email address
- * Your phone number (optional)
- * Your password (hashed for security)
- * Your event details, including title, date, time, location, and description
-
- We also collect information about your interactions with our app, including:
-
- * Your login and logout times
- * Your event creation and editing activities
- * Your RSVPs and attendance records
- * Your communication with other users through our app's messaging feature
-
- How We Use Your Information
-
- We use your information to provide and improve our app, including:
-
- * To create and manage your account
- * To send you notifications and updates about your events
- * To provide customer support and troubleshoot issues
- * To analyze usage patterns and improve our app's features and functionality
- * To comply with legal and regulatory requirements
-
- Sharing Your Information
-
- We do not share your personal information with third parties except in the following circumstances:
-
- * With your consent: We may share your information with third parties if you give us permission to do so.
- * To provide services: We may share your information with third-party service providers who help us provide our app, such as payment processors and event venue management systems.
- * To comply with law: We may share your information with law enforcement or other government agencies if required by law or if necessary to protect our users or our app.
-
- Security Measures
-
- We take the security of your information seriously. We use industry-standard encryption and secure servers to protect your data. We also implement access controls and other security measures to prevent unauthorized access to your information.
-
- Your Rights
-
- You have the right to:
-
- * Access your personal information: You can request a copy of your personal information from us.
- * Correct your personal information: You can request that we correct any inaccuracies in your personal information.
- * Delete your personal information: You can request that we delete your personal information, but please note that this may affect your ability to use our app.
- * Object to processing: You can object to our processing of your personal information, but please note that this may affect your ability to use our app.
-
- Changes to This Policy
-
- We may update this policy from time to time. We will notify you of any changes by email or through our app. Your continued use of our app after any changes to this policy will be considered acceptance of those changes.
-
- Contact Us
-
- If you have any questions or concerns about this policy, please contact us at [support email address].
-
- Effective Date
-
- This policy is effective as of June-24/2024.
-
- By using our app, you acknowledge that you have read, understood, and agree to be bound by this privacy policy.
-
-
-
\ No newline at end of file
diff --git a/k8s/apps/ingresses/values.yaml b/k8s/apps/ingresses/values.yaml
deleted file mode 100644
index 6c17765..0000000
--- a/k8s/apps/ingresses/values.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
-global:
- domain: "me.local"
- secondaryDomain: "me.internal"
- rootSubDomain: "home"
- tls:
- enabled: false
-reverseProxy: {}
-services:
- - prefix: "argocd.core"
- service: "argocd-server"
- namespace: "argocd"
- group: "Core"
- icon: "assets/favicon/favicon-32x32.png"
- - prefix: "demo"
- service: "dummy-app"
- namespace: "apps-ingresses"
- middleware: "apps-ingresses-forwardauth-authentik"
- group: "Demo"
-cloudflare:
- enabled: false
- tokenSecretName: ~
- tokenSecretKey: ~
- certificateRootDomains:
- - ""
- - ".core"
- - ".vh"
- - ".wa"
-staticFiles:
- mainDomain: []
- secondaryDomain: []
diff --git a/k8s/apps/nextcloud/Chart.yaml b/k8s/apps/nextcloud/Chart.yaml
deleted file mode 100644
index c4fb70b..0000000
--- a/k8s/apps/nextcloud/Chart.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-apiVersion: v2
-name: nextcloud
-description: An applications service for homelab
-type: application
-version: 0.1.0
-dependencies:
- - name: nextcloud
- repository: https://nextcloud.github.io/helm/
- version: 3.5.3
diff --git a/k8s/apps/nextcloud/templates/secret-db.yaml b/k8s/apps/nextcloud/templates/secret-db.yaml
deleted file mode 100644
index f168681..0000000
--- a/k8s/apps/nextcloud/templates/secret-db.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
- name: "{{ .Values.nextcloud.externalDatabase.existingSecret.secretName }}"
-spec:
- refreshInterval: 1h
- secretStoreRef:
- kind: ClusterSecretStore
- name: chart-database
- target:
- name: "{{ .Values.nextcloud.externalDatabase.existingSecret.secretName }}"
- data:
- - secretKey: "{{ .Values.nextcloud.externalDatabase.existingSecret.usernameKey }}"
- remoteRef:
- key: "{{ .Values.nextcloud.externalDatabase.existingSecret.secretName }}"
- property: username
-
- - secretKey: "{{ .Values.nextcloud.externalDatabase.existingSecret.passwordKey }}"
- remoteRef:
- key: "{{ .Values.nextcloud.externalDatabase.existingSecret.secretName }}"
- property: password
diff --git a/k8s/apps/nextcloud/templates/secret-nc-default-creds.yaml b/k8s/apps/nextcloud/templates/secret-nc-default-creds.yaml
deleted file mode 100644
index f67c61a..0000000
--- a/k8s/apps/nextcloud/templates/secret-nc-default-creds.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
----
-apiVersion: v1
-kind: Secret
-type: Opaque
-metadata:
- name: "{{ .Values.nextcloud.nextcloud.existingSecret.secretName }}"
- annotations:
- secret-generator.v1.mittwald.de/autogenerate: "{{ .Values.nextcloud.nextcloud.existingSecret.passwordKey }}"
-data:
- {{ .Values.nextcloud.nextcloud.existingSecret.usernameKey }}: "YWRtaW4="
diff --git a/k8s/apps/nextcloud/values-dev.yaml b/k8s/apps/nextcloud/values-dev.yaml
deleted file mode 100644
index e69de29..0000000
diff --git a/k8s/apps/nextcloud/values-prod.yaml b/k8s/apps/nextcloud/values-prod.yaml
deleted file mode 100644
index 21f9f16..0000000
--- a/k8s/apps/nextcloud/values-prod.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-nextcloud:
- nextcloud:
- configs:
- proxy.config.php: |-
- array(
- 0 => '127.0.0.1',
- 1 => '10.0.0.0/8',
- ),
- 'overwritehost' => 'nextcloud.home.sosnovsky.ca',
- 'overwriteprotocol' => 'https',
- 'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),
- );
diff --git a/k8s/apps/nextcloud/values.yaml b/k8s/apps/nextcloud/values.yaml
deleted file mode 100644
index 32c5ba9..0000000
--- a/k8s/apps/nextcloud/values.yaml
+++ /dev/null
@@ -1,91 +0,0 @@
-nextcloud:
- image:
- repository: "ghcr.io/asosnovsky/nextcloud"
- tag: "v28.0.2"
- pullPolicy: IfNotPresent
- flavor: fpm
-
- replicaCount: 1
-
- nodeSelector:
- homelab/capacity: high
-
- cronjob:
- enabled: true
- resources:
- requests:
- cpu: "500m"
- memory: "100Mi"
- ephemeral-storage: "40Ki"
- limits:
- ephemeral-storage: "40Mi"
-
- nextcloud:
- existingSecret:
- enabled: true
- secretName: "password.nextcloud.admin-initial"
- usernameKey: username
- passwordKey: password
- update: 2
- defaultConfigs:
- .htaccess: true
- redis.config.php: true
- apache-pretty-urls.config.php: true
- apcu.config.php: true
- apps.config.php: false
- autoconfig.php: true
- smtp.config.php: true
- strategy:
- type: RollingUpdate
- rollingUpdate:
- maxSurge: 1
- maxUnavailable: 0
-
- internalDatabase:
- enabled: false
-
- externalDatabase:
- enabled: true
- type: postgresql
- database: nextcloud
- host: changeme
- existingSecret:
- enabled: true
- secretName: password.pg.nextcloud
- usernameKey: username
- passwordKey: password
-
- redis:
- enabled: true
- auth:
- enabled: true
- replica:
- replicaCount: 1
-
- persistence:
- enabled: true
- nextcloudData:
- enabled: true
- resources:
- requests:
- cpu: "500m"
- memory: "2Gi"
- ephemeral-storage: "20Mi"
- limits:
- ephemeral-storage: "200Mi"
-
- hpa:
- enabled: true
- cputhreshold: 60
- minPods: 1
- maxPods: 5
-
- nginx:
- enabled: true
- resources:
- requests:
- cpu: "100m"
- memory: "256Mi"
- ephemeral-storage: "100Ki"
- limits:
- ephemeral-storage: "100Mi"
diff --git a/k8s/apps/postfix/Chart.yaml b/k8s/apps/postfix/Chart.yaml
deleted file mode 100644
index 9883ef1..0000000
--- a/k8s/apps/postfix/Chart.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-apiVersion: v2
-name: postfix
-description: An apps service for homelab
-type: application
-version: 0.1.0
-dependencies: []
diff --git a/k8s/apps/postfix/templates/postfix.yaml b/k8s/apps/postfix/templates/postfix.yaml
deleted file mode 100644
index e265250..0000000
--- a/k8s/apps/postfix/templates/postfix.yaml
+++ /dev/null
@@ -1,70 +0,0 @@
-{{ if .Values.smtp_configs }}
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: "postfix-smtp-env"
-type: Opaque
-data:
- SERVER_HOSTNAME: "{{ (printf "%s.%s" .Values.global.rootSubDomain .Values.global.domain) | b64enc }}"
-{{ range $k, $v := .Values.smtp_configs }}
- {{ $k }}: "{{ $v | b64enc }}"
-{{ end }}
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: postfix
- labels:
- app: postfix
-spec:
- strategy:
- rollingUpdate:
- maxSurge: 1
- maxUnavailable: 1
- type: RollingUpdate
- selector:
- matchLabels:
- app: postfix
- template:
- metadata:
- labels:
- app: postfix
- annotations:
- postfix/env-checksum: "{{ .Values.smtp_configs | toJson | sha256sum }}"
- spec:
- containers:
- - image: juanluisbaptiste/postfix:alpine
- name: postfix
- resources:
- requests:
- cpu: "20m"
- memory: "55M"
- limits:
- memory: "55M"
- env:
- - name: "SMTP_PASSWORD"
- valueFrom:
- secretKeyRef:
- name: {{ .Values.smtp_password_secret }}
- key: {{ .Values.smtp_password_secret_key }}
- envFrom:
- - secretRef:
- name: postfix-smtp-env
- ports:
- - containerPort: 25
- name: smtp
----
-kind: Service
-apiVersion: v1
-metadata:
- name: postfix
-spec:
- selector:
- app: postfix
- type: ClusterIP
- ports:
- - name: smtp
- port: 25
- targetPort: 25
-{{ end }}
\ No newline at end of file
diff --git a/k8s/apps/postfix/values-dev.yaml b/k8s/apps/postfix/values-dev.yaml
deleted file mode 100644
index e69de29..0000000
diff --git a/k8s/apps/postfix/values-prod.yaml b/k8s/apps/postfix/values-prod.yaml
deleted file mode 100644
index e69de29..0000000
diff --git a/k8s/apps/postfix/values.yaml b/k8s/apps/postfix/values.yaml
deleted file mode 100644
index 6712791..0000000
--- a/k8s/apps/postfix/values.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-global:
- domain: changme
-smtp_configs: {}
-smtp_password_secret: "changeme"
-smtp_password_secret_key: "changeme"
\ No newline at end of file
diff --git a/k8s/apps/videohosting/Chart.yaml b/k8s/apps/videohosting/Chart.yaml
deleted file mode 100644
index ebfbd3f..0000000
--- a/k8s/apps/videohosting/Chart.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-apiVersion: v2
-name: videohosting
-description: An applications service for homelab
-type: application
-version: 0.1.0
-dependencies: []
diff --git a/k8s/apps/videohosting/templates/configs-bazarr.yaml b/k8s/apps/videohosting/templates/configs-bazarr.yaml
deleted file mode 100644
index d9ea7db..0000000
--- a/k8s/apps/videohosting/templates/configs-bazarr.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
- name: "bazarr-db-creds"
-spec:
- refreshInterval: 24h
- secretStoreRef:
- kind: ClusterSecretStore
- name: chart-database
- target:
- name: "bazarr-db-creds"
- creationPolicy: Owner
- template:
- engineVersion: v2
- data:
- POSTGRES_ENABLED: "true"
- POSTGRES_HOST: "{{ `{{.host}}` }}"
- POSTGRES_PORT: "{{ `{{.port}}` }}"
- POSTGRES_DATABASE: "{{ `{{.username}}` }}"
- POSTGRES_USERNAME: "{{ `{{.username}}` }}"
- POSTGRES_PASSWORD: "{{ `{{.password}}` }}"
- data:
- - remoteRef:
- key: password.pg.bazarr
- property: username
- secretKey: username
- - remoteRef:
- key: password.pg.bazarr
- property: password
- secretKey: password
- - remoteRef:
- key: password.pg.bazarr
- property: port
- secretKey: port
- - remoteRef:
- key: password.pg.bazarr
- property: host
- secretKey: host
\ No newline at end of file
diff --git a/k8s/apps/videohosting/templates/sts-arrs.yaml b/k8s/apps/videohosting/templates/sts-arrs.yaml
deleted file mode 100644
index 13714b3..0000000
--- a/k8s/apps/videohosting/templates/sts-arrs.yaml
+++ /dev/null
@@ -1,196 +0,0 @@
-{{ range $k, $v := .Values.arrs }}
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{$k}}-envs
-data:
- PUID: "1000"
- PGID: "1000"
- TZ: {{ $.Values.global.timezone }}
-{{- range $envName, $envValue := ($v.envVars | default (dict )) }}
- {{ $envName }}: "{{$envValue}}"
-{{ end }}
-
----
-apiVersion: external-secrets.io/v1beta1
-kind: ExternalSecret
-metadata:
- name: "{{$k}}-config"
-spec:
- refreshInterval: 24h
- secretStoreRef:
- kind: ClusterSecretStore
- name: chart-database
- target:
- name: "{{$k}}-config"
- creationPolicy: Owner
- template:
- engineVersion: v2
- data:
- config.xml: |-
-
- info
- False
- 80
- 443
-
- *
- {{ `{{.password | b32enc}}` }}{{ `{{.password | b32enc}}` }}
- Docker
- False
- main
-
- {{ `{{.port}}` }}
- {{ if $v.usePostgres }}
- {{ `{{.username}}` }}
- {{ `{{.password}}` }}
- 5432
- {{ `{{.host}}` }}
- {{$k}}
- {{$k}}-log
- {{$k}}-cache
- {{ end }}
-
- {{- $v.extraConfigXml | nindent 12 }}
-
- data:
- - remoteRef:
- key: password.pg.{{$k}}
- property: username
- secretKey: username
- - remoteRef:
- key: password.pg.{{$k}}
- property: password
- secretKey: password
- - remoteRef:
- key: password.pg.{{$k}}
- property: port
- secretKey: port
- - remoteRef:
- key: password.pg.{{$k}}
- property: host
- secretKey: host
-
----
-kind: Service
-apiVersion: v1
-metadata:
- name: {{ $k }}
-spec:
- selector:
- app: {{ $k }}
- type: ClusterIP
- ports:
- - port: 80
- targetPort: {{ .port | default 80 }}
- name: "http"
- - port: 443
- targetPort: 443
- name: "https"
-
----
-apiVersion: apps/v1
-kind: StatefulSet
-metadata:
- name: {{$k}}
-spec:
- selector:
- matchLabels:
- app: {{$k}}
- replicas: 1
- revisionHistoryLimit: 2
- updateStrategy:
- rollingUpdate:
- partition: 1
- type: RollingUpdate
- volumeClaimTemplates:
- - metadata:
- finalizers:
- - kubernetes.io/pvc-protection
- name: config
- spec:
- storageClassName: {{ $.Values.global.nfs.storageClass }}
- accessModes:
- - ReadWriteOnce
- resources:
- {{- $v.configVolumesResources | toYaml | nindent 10 }}
- template:
- metadata:
- labels:
- app: {{$k}}
- annotations:
- "checksum/extraConfigXml": "{{ $v.extraConfigXml | sha256sum }}"
- spec:
- affinity:
- nodeAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 1
- preference:
- matchExpressions:
- - key: homelab/capacity
- operator: In
- values:
- - med
- - low
- containers:
- - name: {{$k}}
- image: "{{ $v.repo }}:{{ $v.tag }}"
- imagePullPolicy: Always
- envFrom:
- - configMapRef:
- name: {{$k}}-envs
- resources:
- {{- $v.podResources | toYaml | nindent 12 }}
- ports:
- - containerPort: {{ .port | default 80 }}
- name: "http"
- - containerPort: 443
- name: "https"
- volumeMounts:
- - name: config
- mountPath: /config
- - name: torrents
- mountPath: /torrents
- - name: configxml
- mountPath: /configxml
- lifecycle:
- postStart:
- exec:
- command:
- - /bin/sh
- - -c
- - cp /configxml/config.xml /config/config.xml
- livenessProbe:
- httpGet:
- path: "/ping"
- port: http
- scheme: HTTP
- initialDelaySeconds: 30
- failureThreshold: 10
- timeoutSeconds: 30
- readinessProbe:
- httpGet:
- path: "/ping"
- port: http
- scheme: HTTP
- initialDelaySeconds: 30
- failureThreshold: 10
- timeoutSeconds: 30
- startupProbe:
- tcpSocket:
- port: http
- initialDelaySeconds: 30
- failureThreshold: 10
- timeoutSeconds: 30
- volumes:
- - name: configxml
- secret:
- secretName: "{{$k}}-config"
- - name: torrents
- nfs:
- server: "{{ $.Values.global.nfs.server }}"
- path: "{{ $.Values.global.nfs.additionalShares.torrents }}"
- readOnly: false
-
-{{ end }}
diff --git a/k8s/apps/videohosting/templates/sts-jellyfin.yaml b/k8s/apps/videohosting/templates/sts-jellyfin.yaml
deleted file mode 100644
index fd40054..0000000
--- a/k8s/apps/videohosting/templates/sts-jellyfin.yaml
+++ /dev/null
@@ -1,135 +0,0 @@
-{{ if .Values.jellyfin.enabled }}
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: jellyfin-envs
-data:
- PUID: "1000"
- PGID: "1000"
- TZ: {{ .Values.global.timezone }}
- JELLYFIN_PublishedServerUrl: "https://jellyfin.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}"
- DOTNET_SYSTEM_IO_DISABLEFILELOCKING: "1"
-
----
-kind: Service
-apiVersion: v1
-metadata:
- name: jellyfin
-spec:
- selector:
- app: jellyfin
- type: ClusterIP
- ports:
- - port: 8096
- targetPort: 8096
- name: "http"
- - port: 8920
- targetPort: 8920
- name: "https"
- - port: 7359
- targetPort: 7359
- name: "7359-udp"
- protocol: UDP
- - port: 1900
- targetPort: 1900
- name: "1900-udp"
- protocol: UDP
-
----
-apiVersion: apps/v1
-kind: StatefulSet
-metadata:
- name: jellyfin
-spec:
- selector:
- matchLabels:
- app: jellyfin
- replicas: 1
- revisionHistoryLimit: 2
- updateStrategy:
- type: RollingUpdate
- volumeClaimTemplates:
- - metadata:
- finalizers:
- - kubernetes.io/pvc-protection
- name: config
- spec:
- storageClassName: {{ $.Values.global.nfs.storageClass }}
- accessModes:
- - ReadWriteOnce
- resources:
- requests:
- storage: 10Gi
- limits:
- storage: 100Gi
- - metadata:
- name: cache
- spec:
- storageClassName: local-path
- accessModes:
- - ReadWriteOnce
- resources:
- requests:
- storage: 10Gi
- limits:
- storage: 100Gi
- template:
- metadata:
- labels:
- app: jellyfin
- spec:
- affinity:
- nodeAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 1
- preference:
- matchExpressions:
- - key: homelab/capacity
- operator: In
- values:
- - high
- containers:
- - name: jellyfin
- image: "{{ .Values.jellyfin.repo }}:{{ .Values.jellyfin.tag }}"
- imagePullPolicy: "Always"
- envFrom:
- - configMapRef:
- name: jellyfin-envs
- ports:
- - containerPort: 8096
- name: jellyfin
- - containerPort: 8920
- - containerPort: 7359
- protocol: UDP
- - containerPort: 1900
- protocol: UDP
- resources:
- {{- .Values.jellyfin.resources | toYaml | nindent 12 }}
- volumeMounts:
- - name: config
- mountPath: /config
- - name: cache
- mountPath: /cache
- - name: torrents
- mountPath: /torrents
- - name: family-videos
- mountPath: /family-videos
- startupProbe:
- tcpSocket:
- port: jellyfin
- initialDelaySeconds: 10
- failureThreshold: 10
- timeoutSeconds: 30
- volumes:
- - name: torrents
- nfs:
- server: "{{ $.Values.global.nfs.server }}"
- path: "{{ $.Values.global.nfs.additionalShares.torrents }}"
- readOnly: true
- - name: family-videos
- nfs:
- server: "{{ $.Values.global.nfs.server }}"
- path: "{{ .Values.global.nfs.additionalShares.familyvideos }}"
- readOnly: true
-{{ end }}
\ No newline at end of file
diff --git a/k8s/apps/videohosting/templates/sts-services.yaml b/k8s/apps/videohosting/templates/sts-services.yaml
deleted file mode 100644
index 56eeeca..0000000
--- a/k8s/apps/videohosting/templates/sts-services.yaml
+++ /dev/null
@@ -1,157 +0,0 @@
-{{ range $k, $v := .Values.services }}
-{{ if (not $v.disabled)}}
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{$k}}-envs
-data:
- PUID: "1000"
- PGID: "1000"
- TZ: {{ $.Values.global.timezone }}
-{{- range $envName, $envValue := ($v.envVars | default (dict )) }}
- {{ $envName }}: "{{tpl $envValue $}}"
-{{ end }}
-
-{{ if (not $v.disableSVC) }}
----
-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 }}
-{{ end }}
-{{- $kind := $v.kind | default "StatefulSet" -}}
----
-apiVersion: apps/v1
-kind: {{ $kind }}
-metadata:
- name: {{$k}}
-spec:
- selector:
- matchLabels:
- app: {{$k}}
- replicas: 1
- revisionHistoryLimit: 2
- {{ if (eq $kind "StatefulSet")}}
- updateStrategy:
- rollingUpdate:
- partition: 0
- type: RollingUpdate
- volumeClaimTemplates:
- - metadata:
- finalizers:
- - kubernetes.io/pvc-protection
- name: config
- spec:
- storageClassName: {{ $.Values.global.nfs.storageClass }}
- accessModes:
- - ReadWriteOnce
- resources:
- {{- $v.configVolumesResources | toYaml | nindent 10 }}
- {{ end }}
- template:
- metadata:
- labels:
- app: {{$k}}
- annotations:
- checksum/config-env: "{{ $v.envVars | toYaml | sha256sum }}"
- spec:
- affinity:
- nodeAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 1
- preference:
- matchExpressions:
- - key: homelab/capacity
- operator: In
- values:
- - med
- - low
- containers:
- - name: {{$k}}
- image: "{{ $v.repo }}:{{ $v.tag }}"
- imagePullPolicy: Always
- envFrom:
- - configMapRef:
- name: {{$k}}-envs
- {{ range $envFrom := ($v.envFrom | default list) }}
- - {{ $envFrom | toJson }}
- {{ end }}
- resources:
- {{- $v.podResources | toYaml | nindent 12 }}
- {{ if $v.ports}}
- 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 }}
- {{ end }}
- volumeMounts:
- {{ if (eq $kind "StatefulSet")}}
- - name: config
- mountPath: /config
- {{ end }}
- - name: torrents
- mountPath: /torrents
- {{- if $v.health }}
- {{- 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 }}
- volumes:
- - name: torrents
- nfs:
- server: "{{ $.Values.global.nfs.server }}"
- path: "{{ $.Values.global.nfs.additionalShares.torrents }}"
- readOnly: false
-{{ end }}
-{{ end }}
\ No newline at end of file
diff --git a/k8s/apps/videohosting/values-dev.yaml b/k8s/apps/videohosting/values-dev.yaml
deleted file mode 100644
index e69de29..0000000
diff --git a/k8s/apps/videohosting/values-prod.yaml b/k8s/apps/videohosting/values-prod.yaml
deleted file mode 100644
index e69de29..0000000
diff --git a/k8s/apps/videohosting/values.yaml b/k8s/apps/videohosting/values.yaml
deleted file mode 100644
index 5e4b13d..0000000
--- a/k8s/apps/videohosting/values.yaml
+++ /dev/null
@@ -1,118 +0,0 @@
-global:
- timezone: changeme
- nfs:
- storageClass: changeme
- server: changeme
- additionalShares:
- torrents: "changeme"
- familyvideos: "changeme"
-
-jellyfin:
- enabled: false
- repo: "lscr.io/linuxserver/jellyfin"
- tag: latest
- resources:
- limits:
- memory: "14Gi"
- requests:
- cpu: 1
- memory: "4Gi"
-
-arrs:
- sonarr:
- repo: lscr.io/linuxserver/sonarr
- tag: "latest"
- usePostgres: true
- podResources:
- limits:
- memory: "8Gi"
- requests:
- cpu: 250m
- memory: "500M"
- configVolumesResources:
- requests:
- storage: 10Gi
- limits:
- storage: 100Gi
- extraConfigXml: |-
- Sosnovsky Sonarr
- External
- DisabledForLocalAddresses
-
- radarr:
- repo: lscr.io/linuxserver/radarr
- tag: "latest"
- usePostgres: true
- podResources:
- limits:
- memory: "8Gi"
- requests:
- cpu: 250m
- memory: "500M"
- configVolumesResources:
- requests:
- storage: 10Gi
- limits:
- storage: 100Gi
- extraConfigXml: |-
- Sosnovsky Radarr
- External
- DisabledForLocalAddresses
-
- readarr:
- repo: lscr.io/linuxserver/readarr
- tag: "develop"
- usePostgres: true
- podResources:
- limits:
- memory: "8Gi"
- requests:
- cpu: 250m
- memory: "500M"
- configVolumesResources:
- requests:
- storage: 10Gi
- limits:
- storage: 100Gi
- extraConfigXml: |-
- Sosnovsky Readarr
- DisabledForLocalAddresses
-
- prowlarr:
- repo: lscr.io/linuxserver/prowlarr
- tag: "1.13.3.4273-ls54"
- usePostgres: true
- podResources:
- limits:
- memory: "8Gi"
- requests:
- cpu: 50m
- memory: "250M"
- configVolumesResources:
- requests:
- storage: 1Gi
- limits:
- storage: 10Gi
- extraConfigXml: |-
- Sosnovsky Prowlarr
- External
- DisabledForLocalAddresses
-
-services:
- bazarr:
- kind: StatefulSet
- repo: lscr.io/linuxserver/bazarr
- tag: "v1.4.2-ls240"
- ports:
- tcp:
- web: 6767
- health: {}
- envFrom:
- - secretRef:
- name: bazarr-db-creds
- podResources:
- limits:
- memory: "8Gi"
- requests:
- cpu: 250m
- memory: "500M"
\ No newline at end of file
diff --git a/k8s/apps/webapps/Chart.yaml b/k8s/apps/webapps/Chart.yaml
deleted file mode 100644
index 99dc4ae..0000000
--- a/k8s/apps/webapps/Chart.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-apiVersion: v2
-name: webapps
-description: An applications service for homelab
-type: application
-version: 0.1.0
-dependencies: []
diff --git a/k8s/apps/webapps/templates/deploy-apps.yaml b/k8s/apps/webapps/templates/deploy-apps.yaml
deleted file mode 100644
index a9455da..0000000
--- a/k8s/apps/webapps/templates/deploy-apps.yaml
+++ /dev/null
@@ -1,122 +0,0 @@
-{{ range $k, $v := .Values.apps }}
-{{ if $v.enabled }}
----
-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 }}
-
-{{ if $v.exposedPorts }}
----
-kind: Service
-apiVersion: v1
-metadata:
- name: {{ $k }}-exposed-ports
-spec:
- selector:
- app: {{ $k }}
- type: LoadBalancer
- ports:
- {{- range $exPort, $inPort := $v.exposedPorts }}
- - port: {{ $exPort }}
- targetPort: {{ $inPort }}
- protocol: TCP
- {{ end }}
-{{ end }}
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: {{$k}}
-spec:
- selector:
- matchLabels:
- app: {{$k}}
- replicas: 1
- revisionHistoryLimit: 2
- template:
- metadata:
- labels:
- app: {{$k}}
- spec:
- affinity:
- nodeAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 1
- preference:
- matchExpressions:
- - key: homelab/capacity
- operator: In
- values:
- {{ $v.capacity | toYaml | nindent 20 }}
- volumes: {{ ($v.volumes | default list) | toJson }}
- 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 }}
- {{- 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 }}
- {{ end }}
- startupProbe:
- tcpSocket:
- port: tcp-web
- initialDelaySeconds: 10
- failureThreshold: 10
- timeoutSeconds: 30
- envFrom: {{ ($v.envFrom | default list) | toJson }}
- env: {{ ($v.env | default list) | toJson }}
- volumeMounts: {{ ($v.volumeMounts | default list) | toJson }}
-{{ end }}
-{{ end }}
\ No newline at end of file
diff --git a/k8s/apps/webapps/values-dev.yaml b/k8s/apps/webapps/values-dev.yaml
deleted file mode 100644
index a8acad0..0000000
--- a/k8s/apps/webapps/values-dev.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-apps:
- quirky:
- enabled: true
- 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
- ollama:
- enabled: false
- ingress:
- middleware: apps-ingresses-chain-authentik
- repo: ollama/ollama
- tag: "latest"
- podResources:
- limits:
- memory: "1Gi"
- requests:
- cpu: 250m
- memory: "1Gi"
- health:
- readiness: "/"
- liveness: "/"
- exposedPorts:
- "1143": 11434
- ports:
- tcp:
- web: 11434
- volumes:
- - name: config
- persistentVolumeClaim:
- claimName: pv-ollama
- volumeMounts:
- - name: config
- mountPath: /root/.ollama
- capacity:
- - med
- - high
diff --git a/k8s/apps/webapps/values-prod.yaml b/k8s/apps/webapps/values-prod.yaml
deleted file mode 100644
index e69de29..0000000
diff --git a/k8s/apps/webapps/values.yaml b/k8s/apps/webapps/values.yaml
deleted file mode 100644
index cdb8ca3..0000000
--- a/k8s/apps/webapps/values.yaml
+++ /dev/null
@@ -1 +0,0 @@
-apps: {}
\ No newline at end of file
diff --git a/k8s/argoapps/apps-values/ingresses.yaml b/k8s/argoapps/apps-values/ingresses.yaml
deleted file mode 100644
index 7c333a7..0000000
--- a/k8s/argoapps/apps-values/ingresses.yaml
+++ /dev/null
@@ -1,76 +0,0 @@
-{{- if .Values.secrets.ingresses.secrets.cloudflare }}
-cloudflare:
- enabled: true
- tokenSecretName: {{ .Values.secrets.ingresses.secrets.cloudflare.name }}
- tokenSecretKey: api-token
-{{- end }}
-services:
- # core services
- - prefix: "argocd.core"
- service: "argocd-server"
- namespace: "argocd"
- group: "Core"
- icon: "https://argocd.core.home.sosnovsky.ca/assets/favicon/favicon-32x32.png"
- # - prefix: "monitoring.core"
- # service: prometheus-kube-prometheus-prometheus
- # namespace: chart-prometheus
- # middleware: "apps-ingresses-chain-authentik"
- # group: "Core"
- # icon: "https://monitoring.core.home.sosnovsky.ca/favicon.ico"
- # port: 9090
- # - prefix: "alerts.core"
- # service: prometheus-kube-prometheus-alertmanager
- # namespace: chart-prometheus
- # middleware: "apps-ingresses-chain-authentik"
- # group: "Core"
- # port: 9093
- # - prefix: "grafana.core"
- # service: prometheus-grafana
- # namespace: chart-prometheus
- # middleware: "apps-ingresses-chain-authentik"
- # group: "Core"
- # icon: "https://grafana.core.home.sosnovsky.ca/public/img/fav32.png"
- # health: "healthz"
- # - prefix: "authentik.core"
- # service: "authentik-server"
- # namespace: "chart-authentik"
- # group: "Core"
- # icon: "https://authentik.home.sosnovsky.ca/static/dist/assets/icons/icon.png"
- # root services
- - prefix: "demo"
- service: "dummy-app"
- namespace: "apps-ingresses"
- middleware: "apps-ingresses-chain-authentik"
- group: "Demo"
- - prefix: "nextcloud"
- service: "nextcloud"
- namespace: "apps-nextcloud"
- port: 8080
- middleware: "apps-nextcloud-nextcloud"
- group: "Apps"
- icon: "https://nextcloud.home.sosnovsky.ca/core/img/favicon.ico"
- - prefix: "main"
- service: "homepage"
- namespace: "chart-homepage"
- middleware: "apps-ingresses-chain-authentik"
- port: 3000
- group: "Core"
- # webapp services
- {{- $webapps := .Files.Get (printf "apps-values/%s" .Values.apps.webapps.valuesFile) }}
- {{- $webapps := tpl $webapps . | fromYaml }}
- {{- range $k, $v := $webapps.apps }}
- {{ if $v.enabled }}
- - prefix: "{{ $v.ingress.prefix | default (printf "%s-app" $k) }}"
- service: "{{ $k }}"
- namespace: "apps-webapps"
- useDirectPrefix: {{ $v.ingress.useDirectPrefix | default "false" }}
- useSecondaryDomain: {{ $v.ingress.useSecondaryDomain | default "false" }}
- port: {{ $v.ports.tcp.web }}
- {{- if $v.ingress }}
- middleware: {{ $v.ingress.middleware | default "apps-ingresses-chain-authentik" }}
- {{ else }}
- middleware: "apps-ingresses-chain-authentik"
- {{ end -}}
- group: {{ .ingress.group | default "Basic Webapps" }}
- {{ end }}
- {{- end }}
\ No newline at end of file
diff --git a/k8s/argoapps/apps-values/nextcloud.yaml b/k8s/argoapps/apps-values/nextcloud.yaml
deleted file mode 100644
index a5baccf..0000000
--- a/k8s/argoapps/apps-values/nextcloud.yaml
+++ /dev/null
@@ -1,57 +0,0 @@
-global:
- storageClass: {{ .Values.global.nfs.storageClass }}
-nextcloud:
- nextcloud:
- host: "nextcloud.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}"
- externalDatabase:
- host: postgres.chart-database.svc.cluster.local
- persistence:
- storageClass: {{ .Values.global.nfs.storageClass }}
- existingClaim: {{ .Values.storage.nextcloudConfig.name }}
- nextcloudData:
- storageClass: {{ .Values.global.nfs.storageClass }}
- existingClaim: {{ .Values.storage.nextcloudData.name }}
- configs:
- authelia.config.php: |-
- false,
- 'lost_password_link' => 'disabled',
- 'oidc_login_provider_url' => 'https://auth.core.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}',
- 'oidc_login_client_id' => 'nextcloud',
- 'oidc_login_client_secret' => 'xjW7ByDrY0IpGo6XC5o6eQEUGagjkK6hULfbtADO5GV-ugHiG1ri1FRvkfL.-sacdHWyqZyO',
- 'oidc_login_auto_redirect' => false,
- 'oidc_login_end_session_redirect' => false,
- 'oidc_login_button_text' => 'Log in with Authelia',
- 'oidc_login_hide_password_form' => false,
- 'oidc_login_use_id_token' => true,
- 'oidc_login_attributes' => array (
- 'id' => 'preferred_username',
- 'name' => 'name',
- 'mail' => 'email',
- 'groups' => 'groups',
- ),
- 'oidc_login_default_group' => 'oidc',
- 'oidc_login_use_external_storage' => false,
- 'oidc_login_scope' => 'openid profile email groups',
- 'oidc_login_proxy_ldap' => false,
- 'oidc_login_disable_registration' => true,
- 'oidc_login_redir_fallback' => false,
- 'oidc_login_alt_login_page' => 'assets/login.php',
- 'oidc_login_tls_verify' => true,
- 'oidc_create_groups' => false,
- 'oidc_login_webdav_enabled' => false,
- 'oidc_login_password_authentication' => false,
- 'oidc_login_public_key_caching_time' => 86400,
- 'oidc_login_min_time_between_jwks_requests' => 10,
- 'oidc_login_well_known_caching_time' => 86400,
- 'oidc_login_update_avatar' => false,
- );
- redis:
- master:
- persistence:
- storageClass: {{ .Values.global.nfs.storageClass }}
- existingClaim: {{ .Values.storage.nextcloudRedisMaster.name }}
- replica:
- persistence:
- storageClass: {{ .Values.global.nfs.storageClass }}
\ No newline at end of file
diff --git a/k8s/argoapps/apps-values/webapps.yaml b/k8s/argoapps/apps-values/webapps.yaml
deleted file mode 100644
index 53ea388..0000000
--- a/k8s/argoapps/apps-values/webapps.yaml
+++ /dev/null
@@ -1,105 +0,0 @@
-apps:
- quirky:
- enabled: true
- ingress:
- prefix: quirky
- useSecondaryDomain: true
- 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
- me:
- enabled: true
- ingress:
- prefix: ari
- useDirectPrefix: true
- 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:
- memory: "16Gi"
- requests:
- cpu: 3
- memory: "10Gi"
- exposedPorts:
- "11434": "11434"
- ports:
- tcp:
- web: 11434
- volumes:
- - name: config
- persistentVolumeClaim:
- claimName: {{ .Values.storage.ollama.name }}
- volumeMounts:
- - name: config
- mountPath: /root/.ollama
- capacity:
- - med
- - high
- ollama-web:
- enabled: true
- ingress:
- middleware: apps-ingresses-chain-authentik
- repo: ghcr.io/ollama-webui/ollama-webui
- tag: "main"
- podResources:
- limits:
- memory: "1Gi"
- requests:
- cpu: 250m
- memory: "1Gi"
- health:
- readiness: "/"
- liveness: "/"
- env:
- - name: OLLAMA_API_BASE_URL
- value: "http://bigbox1.lab.internal:11434/api"
- ports:
- tcp:
- web: 8080
- volumes:
- - name: config
- persistentVolumeClaim:
- claimName: {{ .Values.storage.ollamaWebGui.name }}
- volumeMounts:
- - name: config
- mountPath: /app/backend/data
- capacity:
- - med
- - low
diff --git a/k8s/argoapps/chart-values/authelia.yaml b/k8s/argoapps/chart-values/authelia.yaml
deleted file mode 100644
index 6e2009e..0000000
--- a/k8s/argoapps/chart-values/authelia.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-ingress:
- enabled: true
- annotations:
- gethomepage.dev/enabled: "true"
- gethomepage.dev/name: "Authelia"
- certManager: false
- tls:
- enabled: false
- hostOverride:
- - host: authelia.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}
- path: "/"
- traefikCRD:
- enabled: true
- matchOverride: Host(`authelia.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}`)
-# configMap:
-# disabled: true
diff --git a/k8s/argoapps/chart-values/authentik.yaml b/k8s/argoapps/chart-values/authentik.yaml
deleted file mode 100644
index dd9f2af..0000000
--- a/k8s/argoapps/chart-values/authentik.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-authentik:
- cookie_domain: {{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}
- email:
- from: {{ .Values.global.smtp.email }}
- host: postfix.email.svc.cluster.local
- port: 25
- username: {{ .Values.global.smtp.email }}
- use_ssl: false
- postgresql:
- host: postgres.chart-database.svc.cluster.local
- name: authentik
- user: authentik
-postgresql:
- enabled: false
-redis:
- enabled: true
-server:
- ingress:
- enabled: true
- annotations:
- gethomepage.dev/enabled: 'true'
- gethomepage.dev/group: Core
- gethomepage.dev/icon: 'https://authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}/static/dist/assets/icons/icon.png'
- gethomepage.dev/name: authentik@chart-authentik
- gethomepage.dev/siteMonitor: 'http://authentik-server.chart-authentik.svc.cluster.local:80/'
- hosts:
- - authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}
- pathType: Prefix
- tls:
- - hosts:
- - authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}
- secretName: tls-authentik.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}
- https: false
-global:
- envFrom:
- - secretRef:
- name: {{ .Values.secrets.authentik.secrets.env.name }}
diff --git a/k8s/argoapps/chart-values/database.yaml b/k8s/argoapps/chart-values/database.yaml
deleted file mode 100644
index 96550b1..0000000
--- a/k8s/argoapps/chart-values/database.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-fullnameOverride: "postgres"
-image:
- tag: 15.1.0-debian-11-r19
- repository: bitnami/postgresql
- pullPolicy: IfNotPresent
-auth:
- secretKeys:
- adminPasswordKey: password
- existingSecret: "{{ .Values.secrets.database.secrets.dbmain.name }}"
-architecture: standalone
-postgresqlDataDir: /bitnami/postgresql/data
-primary:
- persistence:
- enabled: true
- mountPath: /bitnami/postgresql
- storageClass: "{{ .Values.global.nfs.storageClass }}"
- existingClaim: "{{ .Values.storage.database.name }}"
- accessModes:
- - ReadWriteMany
-readReplicas:
- replicaCount: 0
diff --git a/k8s/argoapps/chart-values/homepage.yaml b/k8s/argoapps/chart-values/homepage.yaml
deleted file mode 100644
index dddb3f2..0000000
--- a/k8s/argoapps/chart-values/homepage.yaml
+++ /dev/null
@@ -1,60 +0,0 @@
-image:
- repository: ghcr.io/gethomepage/homepage
- tag: latest
-config:
- widgets:
- - kubernetes:
- cluster:
- show: true
- cpu: true
- memory: true
- showLabel: true
- label: "cluster"
- nodes:
- show: true
- cpu: true
- memory: true
- showLabel: true
- services:
- - Local Cameras:
- - Korie:
- href: http://korie.cam.internal/
- siteMonitor: http://korie.cam.internal/
- - Eddie:
- href: http://eddie.cam.internal/
- siteMonitor: http://eddie.cam.internal/
- - Living Room:
- href: http://livingroom.cam.internal/
- siteMonitor: http://livingroom.cam.internal/
- - Doorbell:
- href: 'http://doorbell.cam.internal'
- siteMonitor: http://doorbell.cam.internal/
- - Garage:
- href: 'http://garage.cam.internal'
- siteMonitor: http://garage.cam.internal/
- - Routers:
- - GL Main:
- href: http://gl.router.internal
- siteMonitor: http://gl.router.internal
- - GL Basement:
- href: http://gl-basement.router.internal
- siteMonitor: http://gl-basement.router.internal
- - MainMesh:
- href: http://velica-main.router.internal
- siteMonitor: http://velica-main.router.internal
- - MeshNode1:
- href: http://velica-node1.router.internal
- siteMonitor: http://velica-node1.router.internal
- - MeshNode2:
- href: http://velica-node2.router.internal
- siteMonitor: http://velica-node2.router.internal
- bookmarks: []
- kubernetes:
- mode: cluster
-
-
-serviceAccount:
- create: true
- name: homepage
-
-enableRbac: true
diff --git a/k8s/argoapps/chart-values/prometheus.yaml b/k8s/argoapps/chart-values/prometheus.yaml
deleted file mode 100644
index 65d09e5..0000000
--- a/k8s/argoapps/chart-values/prometheus.yaml
+++ /dev/null
@@ -1,76 +0,0 @@
-cleanPrometheusOperatorObjectNames: false
-alertmanager:
- enabled: true
- alertmanagerSpec:
- storage:
- volumeClaimTemplate:
- spec:
- storageClassName: {{ .Values.global.nfs.storageClass }}
- accessModes: ["ReadWriteOnce"]
- resources:
- requests:
- storage: 50Gi
- limits:
- storage: 100Gi
-
-{{- if .Values.global.tls.enabled }}
- externalUrl: "https://alerts.core.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}"
-{{- else }}
- externalUrl: "http://alerts.core.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}"
-{{- end }}
- resources:
- requests:
- memory: 400Mi
- limits:
- memory: 2Gi
-
- config:
- global:
- smtp_from: '{{.Values.global.smtp.email }}'
- smtp_smarthost: 'postfix.email.svc.cluster.local:25'
- smtp_hello: 'alerts.core.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}'
- receivers:
- - name: '{{ .Values.global.email }}'
- email_configs:
- - to: '{{ .Values.global.email }}'
-
-grafana:
- defaultDashboardsTimezone: {{ .Values.global.timezone }}
- adminPassword: prom-operator
- persistence:
- type: pvc
- enabled: true
- storageClassName: {{ .Values.global.nfs.storageClass }}
- envFromConfigMaps:
- - name: {{ .Values.secrets.prometheus.configmaps.auth.name }}
- optional: true
- grafana.ini:
- server:
- domain: grafana.core.{{ .Values.global.domain }}
- server:
- root_url: https://grafana.core.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}
-
-prometheus:
- prometheusSpec:
- enableAdminAPI: false
-
-{{- if .Values.global.tls.enabled }}
- externalUrl: "https://monitoring.core.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}"
-{{- else }}
- externalUrl: "http://monitoring.core.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}"
-{{- end }}
- resources:
- requests:
- memory: 400Mi
- limits:
- memory: 2Gi
- storageSpec:
- volumeClaimTemplate:
- spec:
- storageClassName: {{ .Values.global.nfs.storageClass }}
- accessModes: ["ReadWriteOnce"]
- resources:
- requests:
- storage: 50Gi
- limits:
- storage: 100Gi
\ No newline at end of file
diff --git a/k8s/bootstrap/metallb.yml b/k8s/bootstrap/metallb.yml
new file mode 100644
index 0000000..78af09d
--- /dev/null
+++ b/k8s/bootstrap/metallb.yml
@@ -0,0 +1,15 @@
+---
+apiVersion: metallb.io/v1beta1
+kind: IPAddressPool
+metadata:
+ name: first-pool
+ namespace: metallb-system
+spec:
+ addresses:
+ - 10.0.100.1-10.0.100.255
+---
+apiVersion: metallb.io/v1beta1
+kind: L2Advertisement
+metadata:
+ name: l2ad
+ namespace: metallb-system