Compare commits

..

177 commits

Author SHA1 Message Date
j
3d53cf9a2f remove certs 2025-07-13 22:56:09 +10:00
j
1e5f92a02d Add dovecot 2025-07-13 22:41:42 +10:00
j
f68c0eb357 Add dovecot for testing 2025-07-13 21:03:57 +10:00
j
fea4ae567c try put user pass into secret this prob wont work 2025-07-13 10:19:18 +10:00
j
c52009020c remove psql 2025-07-13 09:46:28 +10:00
j
28693adfe8 disable signup 2025-07-12 23:23:35 +10:00
j
cfd55c3246 Add psql backup 2025-07-12 23:23:18 +10:00
j
abb58138b6 Remove admin, allow signup 2025-07-12 23:17:01 +10:00
j
50a8532d98 Add ingress for vaultwarden 2025-07-12 23:12:51 +10:00
j
0179d6d50f fix secret ref 2025-07-12 23:09:53 +10:00
j
13a7e6a5a6 Remove specific pg 2025-07-12 23:08:34 +10:00
j
91bf0618f4 Get dsn from secret 2025-07-12 23:07:50 +10:00
j
8c51525410 Replace operator with deployment 2025-07-12 22:54:51 +10:00
j
d7f2130b2e creds from secret has hack around 2025-07-12 21:52:16 +10:00
j
6776749e52 x 2025-07-12 21:34:39 +10:00
j
4e17b5bb54 x 2025-07-12 21:29:49 +10:00
j
b66a7b3de2 fix up psql 2025-07-12 21:28:38 +10:00
j
0a11e30cff yolo smb 2025-07-12 21:19:15 +10:00
j
3a97e86b5e Samba share for dpool 2025-07-12 21:17:49 +10:00
j
c14ad440ed pgsql 2025-07-12 21:16:18 +10:00
j
a499bb5cc5 rem test 2025-07-12 21:16:04 +10:00
j
e4abfa72f4 try new psql operator 2025-07-12 21:14:45 +10:00
j
fee0b443da test 2025-07-12 21:09:14 +10:00
j
b67ff9e137 Test 2025-07-12 21:08:02 +10:00
j
c49584e23a re-add vaultwarden 2025-07-12 20:00:25 +10:00
j
43a17c0d7c readd 2025-07-12 19:32:30 +10:00
j
8b0f9f17f2 still drinking yolo vaultwarden 2025-07-12 18:53:13 +10:00
j
b325f73d63 remove both sorry i drank 2025-07-12 18:52:46 +10:00
j
c582281dc9 Change vw data path 2025-07-12 18:49:26 +10:00
j
4754988438 Messed with pvs now need to nuke 2025-07-12 14:06:55 +10:00
j
b3d6a38309 Reorder 2025-07-12 13:56:53 +10:00
j
54d8507866 GPT rework cloned with db 2025-07-12 13:53:27 +10:00
j
743dc97e15 Remove psql because it was a pain 2025-07-12 13:51:48 +10:00
j
596d2a3959 Update to OCI 2025-07-12 13:48:58 +10:00
j
d5019aafa2 Add postgres 2025-07-12 13:43:25 +10:00
j
0d449eefb1 Admin token enables admin area 2025-07-12 13:39:53 +10:00
j
6b62cebfcf More logical way of doing things 2025-07-12 13:38:14 +10:00
j
5626e4fbb9 Better way of checking. See commit desc.
This is a better way of checking. Recommended for set and forget but not
battle tested. Original way that this replaces risks wiping data.
2025-07-12 13:37:14 +10:00
j
c291399f8f Init container to prepopulate data directory 2025-07-12 13:35:34 +10:00
j
b26e6a2c95 linkwarden 2025-07-12 13:17:01 +10:00
j
4c0bb8f0c7 Add vault warden 2025-07-12 13:16:25 +10:00
j
800f9216cc Fix timezone 2025-07-12 13:10:10 +10:00
j
bad83858fd vault warden 2025-07-12 13:09:53 +10:00
j
560507b22d restore cert manager to build cert 2025-07-12 12:59:05 +10:00
j
039fe86597 remove to force full wipe rebuild 2025-07-12 12:58:38 +10:00
j
406d0aa867 Drop staging server 2025-07-12 12:53:21 +10:00
j
939ff4dcdb Split DNS and SSL off 2025-07-12 12:48:17 +10:00
j
0dd05a5c1d Allow replication to home-media 2025-07-11 10:08:12 +10:00
j
d7c5547164 Switch to staging server to give timeouts a chance to timeout 2025-07-11 09:19:05 +10:00
j
55e80ee0b8 Update ingress 2025-07-11 00:49:23 +10:00
j
f93db85e06 remove secret replicator 2025-07-11 00:48:42 +10:00
j
019cfea0bd Add redis for caching 2025-07-11 00:41:13 +10:00
j
f37cffaf94 hsts 2025-07-11 00:31:13 +10:00
j
42ba699d8e didnt work 2025-07-10 23:50:40 +10:00
j
e8084bf517 cheeky cronjob 2025-07-10 23:48:38 +10:00
j
16acbf5b02 Fix mysql host 2025-07-10 23:41:18 +10:00
j
0a9ecb1e08 x 2025-07-10 23:18:56 +10:00
j
28f767671e Just add in 2025-07-10 23:18:34 +10:00
j
882d9ca823 remove target namespace? 2025-07-10 23:04:21 +10:00
j
7dfd7cef83 x 2025-07-10 23:03:02 +10:00
j
246e23c37b fix secret key name 2025-07-10 23:00:57 +10:00
j
80344a23ec x 2025-07-10 22:58:37 +10:00
j
e7168a3039 Just... trying something 2025-07-10 22:45:18 +10:00
j
9be3c25858 deps 2025-07-10 22:41:41 +10:00
j
de68b89629 Eh 2025-07-10 22:39:43 +10:00
j
12f1964af1 I really hate flux sometimes 2025-07-10 22:37:51 +10:00
j
c67bca0573 flux kust or am i stoopid? 2025-07-10 22:27:16 +10:00
j
eaff825682 Add backup to nextcloud. Tricks load order I hope. 2025-07-10 22:25:17 +10:00
j
bf0abb8f51 yeet backup because break 2025-07-10 22:24:40 +10:00
j
a3cbbb9e4d Consolidate to see if flux doesnt one shot 2025-07-10 22:24:21 +10:00
j
7e53160afe Use host path because im fucking lazy 2025-07-10 22:09:22 +10:00
j
51b7523829 Fix namespace for pvc 2025-07-10 21:41:10 +10:00
j
6909100982 Fix db name 2025-07-10 21:39:04 +10:00
j
bc8c2f3179 Add backups 2025-07-10 21:35:39 +10:00
j
5abcac4177 Remove certificate that is not needed 2025-07-10 21:16:32 +10:00
j
621d1465a7 Re-add extra perms I missed 2025-07-10 21:15:54 +10:00
j
9f8826950d Add cert manager 2025-07-10 20:36:47 +10:00
j
cecabe6f68 Add authentik 2025-07-10 20:34:57 +10:00
j
4cecc4ffc3 Deploy DNS 2025-07-10 20:32:37 +10:00
j
04bcac839b Port over bind config 2025-07-10 20:32:26 +10:00
j
e386020f17 Add nextcloud and deploy rep 2025-07-10 20:30:36 +10:00
j
eb03c59808 Add replicator. 2025-07-10 20:28:52 +10:00
j
711ecede22 Try something new 2025-07-10 20:22:15 +10:00
j
c8cd4659a3 fuck helm. 2025-07-10 20:00:02 +10:00
j
ba63e97b2e Move core operators to deployments due to chicken egg issues 2025-07-10 18:19:12 +10:00
j
6b56e35f68 Just incase; put chart into chart 2025-07-10 18:16:26 +10:00
j
526aaa1dd8 Update versionf or rfc fix 2025-07-10 17:55:47 +10:00
j
f80d240995 Fix rfc2136 host 2025-07-10 17:55:34 +10:00
j
d2ad7d8e96 force update 2025-07-10 17:54:28 +10:00
j
7359fc17f7 Add EndpointSlices for external dns 2025-07-10 17:52:30 +10:00
j
0d03b2a68a Remove dupes because its deployed in chart 2025-07-10 17:43:06 +10:00
j
500194ed68 Update versiont o see if flux just auto updates because im sick of namespace not deleting on manual upate 2025-07-10 17:25:58 +10:00
j
0431748ef9 gpt thorwing me around 2025-07-10 17:25:39 +10:00
j
e3c15c839b Update for deprecation warning 2025-07-10 16:57:13 +10:00
j
0d3658705b Remove secret replication because we're now in one namespace 2025-07-10 16:49:07 +10:00
j
c1dae3957d Missed a namespace 2025-07-10 16:48:21 +10:00
j
3bbb8663bc Remove namespaces 2025-07-10 16:35:27 +10:00
j
71971b7e07 Replace namespace with chart namespace 2025-07-10 16:33:48 +10:00
j
8e62b66b97 Just ignore commits please 2025-07-10 16:28:34 +10:00
j
4e20bdd8db Add endpointslices 2025-07-10 14:11:51 +10:00
j
12a04cd1e5 Remove operators beacuse they were auto applied 2025-07-10 14:07:16 +10:00
j
771dd6dbe9 Fix namespace 2025-07-10 14:00:54 +10:00
j
76f617f3fe Remove mariadb namespace because not needed used 2025-07-10 14:00:24 +10:00
j
950012fa3d Difficult bit into kust. Strip mariadb from helm. 2025-07-10 13:56:45 +10:00
j
0786edbead Reference globals instead 2025-07-10 12:23:43 +10:00
j
152c521644 remove values 2025-07-10 12:02:52 +10:00
j
d39d303511 reboot - readd 2025-07-10 11:57:48 +10:00
j
bce94b467e reboot - remove 2025-07-10 11:57:34 +10:00
j
464135d975 Nextcloud to target namespace 2025-07-10 11:57:00 +10:00
j
9a4a80792c Re-add to re-apply. Basically reboot. 2025-07-10 11:54:19 +10:00
j
2b1ccd960e Remove to clean slate - nc failing 2025-07-10 11:50:14 +10:00
j
b3b5d48d8a Forgot to add nextcloud to be deployed 2025-07-10 11:39:03 +10:00
j
8f01bcbde0 Copy nextcloud over from original manifest. Not helmified. 2025-07-10 11:30:38 +10:00
j
c201633250 Changes as per GPT recommendation 2025-07-10 11:26:46 +10:00
j
27006f8fb7 Add cert-manager. Hail mary tbh. 2025-07-10 11:19:56 +10:00
j
d2cfbfd45b Add cert-manager as dependency 2025-07-10 11:08:26 +10:00
j
ffdfd52c23 Re-add 2025-07-10 10:07:21 +10:00
j
6040dfac45 remove all resources because nuke. 2025-07-10 10:03:19 +10:00
j
db2e311c93 Target specific namespace 2025-07-10 10:00:18 +10:00
j
d150842efd Rename helmrelease files to hrel 2025-07-10 09:58:30 +10:00
j
3b7e8cb307 Split repos into their own file 2025-07-10 09:57:57 +10:00
j
7fa37cb93e Name this release after the release 2025-07-10 09:56:54 +10:00
j
c091ec8a14 Namespace rename to not be so long. 2025-07-10 09:54:27 +10:00
j
fcda90f014 Fix values declaration 2025-07-10 09:51:45 +10:00
j
2f4345783d Switch prod and dev for consistency in format 2025-07-10 09:48:20 +10:00
j
7363b6db54 Remove dev. Use prod. 2025-07-10 09:47:26 +10:00
j
11efc800e2 Merge branch 'dev' 2025-07-10 09:43:44 +10:00
j
4b209f4649 Add namespace to bind master 2025-07-10 09:39:50 +10:00
j
c553b5cbae Add namespace to externaldns 2025-07-10 09:39:35 +10:00
j
06ef3d543b remove prod, add mariadb tgz 2025-07-10 09:36:41 +10:00
j
b2446584aa remove prod for now 2025-07-10 09:34:46 +10:00
j
912b379cef Scope DNS to release namespace 2025-07-10 09:31:36 +10:00
j
a358fc1df9 Include subcharts. Everything seems to be pushing to dev 2025-07-10 09:23:46 +10:00
j
2a56922b31 yolo? 2025-07-06 00:11:35 +10:00
j
07a524c68e values per env 2025-07-06 00:05:57 +10:00
j
94f86472e7 Remove slave for now. Master worked never got slave working. Need fucntional to move to dev 2025-07-05 23:53:57 +10:00
j
99e69421a8 Fix duplicate declaration 2025-07-05 23:53:57 +10:00
j
cd400204fc Honestly. I'm too tired. 2025-07-05 23:53:57 +10:00
j
081e75688b Repos stored in flux-system 2025-07-05 23:53:57 +10:00
j
3bb8a876d2 Set chart to root 2025-07-05 23:53:57 +10:00
j
0540bbe6f3 Use homeserverprod instead of homeserver 2025-07-05 23:53:57 +10:00
j
dfd175956c Convert kust to helmrelease 2025-07-05 23:53:57 +10:00
j
95f83776a6 Remove slave for now. Master worked never got slave working. Need fucntional to move to dev 2025-07-05 23:51:26 +10:00
j
f798f2be87 Fix duplicate declaration 2025-07-05 23:49:08 +10:00
j
6635b1285c Honestly. I'm too tired. 2025-07-05 23:45:41 +10:00
j
72de10f09d Repos stored in flux-system 2025-07-05 23:42:42 +10:00
j
c27c7b3c29 Set chart to root 2025-07-05 23:40:50 +10:00
j
49941189be Use homeserverprod instead of homeserver 2025-07-05 23:35:58 +10:00
j
e4a60f94a9 Convert kust to helmrelease 2025-07-05 23:34:30 +10:00
j
1d950877fb Merge pull request 'Applies kustomizations for each environment' (#3) from dev into main
Reviewed-on: #3
2025-07-05 23:27:27 +10:00
j
d12d77aa03 Deploy correct manifests 2025-07-05 23:25:25 +10:00
j
572966f8c1 Better structure 2025-07-05 23:18:17 +10:00
j
11f718529b Merge pull request 'Bring dev into main in order to apply deployments/' (#2) from dev into main
Reviewed-on: #2
2025-07-05 23:14:44 +10:00
j
54c13bc173 required chart declarations 2025-07-05 23:13:51 +10:00
j
d9859dc3c8 Load balancer 2025-07-05 23:13:40 +10:00
j
36f1e4ca2a Convert service to load balancer 2025-07-05 23:11:50 +10:00
j
4d11768bbf Port DNS charts 2025-07-05 23:05:03 +10:00
j
56e28b1b47 Bit of a .. rewrite. 2025-07-05 22:23:09 +10:00
j
9396fc927e Remove chart, thought it wasn't needed but gpt says it was lmao 2025-07-05 21:48:54 +10:00
j
a0a7e77c30 Put it all into home-server namespace - no need for so much separation atm 2025-07-05 21:43:36 +10:00
j
1ac9f74334 Deploy charts/dns 2025-07-05 21:35:11 +10:00
j
e0386f8f73 start from an easier starting point 2025-07-05 21:34:32 +10:00
j
f1a76a715c YESUS 2025-07-05 21:34:21 +10:00
j
dbf8fe7ecd Finally found its 'lexicographical' jesus gpt 2025-07-05 20:55:09 +10:00
j
b7a4a9194b just.. eh. 2025-07-05 20:51:03 +10:00
j
479b80ae19 Publish DNS 2025-07-05 20:23:03 +10:00
j
7f50f9f7c6 amys baking company. holy shit. 2025-07-05 20:18:19 +10:00
j
7167f871e3 comment everything else out 2025-07-05 20:17:51 +10:00
j
36922a23af Test chart 2025-07-05 20:16:11 +10:00
j
a74411aead charts -> templates 2025-07-05 20:12:20 +10:00
j
ba549914a7 Remove stupid values gpt keeps adding 2025-07-05 20:10:49 +10:00
j
fdbd0951ed Fix kind 2025-07-05 20:10:13 +10:00
j
ffdea5d9ec mild fix 2025-07-05 20:08:43 +10:00
j
71334e37ff Yolo the helm. Im tired 2025-07-05 20:04:25 +10:00
j
afece74fa4 Merge pull request 'Migrate to chart layout dont want to deploy to test yet' (#1) from chart-migration into main
Reviewed-on: #1
2025-07-05 20:02:38 +10:00
j
f9c2846876 Migrate to chart layout dont want to deploy to test yet 2025-07-05 12:06:11 +10:00
j
bf1916ebd1 Move to Helm chart stub 2025-07-05 11:49:57 +10:00
38 changed files with 1353 additions and 19 deletions

View file

@ -1,3 +1,10 @@
# home-server
Kubernetes manifests that define my home server
Kubernetes manifests that define my home server
THIS SPIRALED
Originally a kustomize but I wanted to be able to let others use it and tweak
hostname values, so it became my first ever Helm chart.
I know I don't love Helm, but I needed to us it sadly.

View file

@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- monitoring/provider.yaml
- monitoring/grafana.yaml
- monitoring/loki.yaml
- monitoring/prometheus.yaml
- operators/mariadb.yaml
- operators/replicator.yaml
- dns/namespace.yaml
- dns/bind.yaml
- dns/externaldns.yaml
- ssl/certmanager.yaml
- auth/authentik.yaml
- files/nextcloud.yaml
- files/syncthing.yaml

View file

@ -0,0 +1,60 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: mariadb-system
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: mariadb-operator
namespace: flux-system
spec:
url: https://helm.mariadb.com/mariadb-operator
interval: 1h
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: mariadb-operator-crds
namespace: mariadb-system
spec:
interval: 30m
chart:
spec:
chart: mariadb-operator-crds
version: 0.38.1
sourceRef:
kind: HelmRepository
name: mariadb-operator
namespace: flux-system
install:
createNamespace: true
upgrade:
disableWait: true
timeout: 5m
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: mariadb-operator
namespace: mariadb-system
spec:
interval: 30m
chart:
spec:
chart: mariadb-operator
version: 0.38.1
sourceRef:
kind: HelmRepository
name: mariadb-operator
namespace: flux-system
install:
createNamespace: true
dependsOn:
- name: mariadb-operator-crds
namespace: mariadb-system
values:
metrics:
enabled: true

View file

@ -0,0 +1,98 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubernetes-replicator
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubernetes-replicator
rules:
- apiGroups: ["", "apps", "extensions"]
resources:
- secrets
- configmaps
- roles
- rolebindings
- cronjobs
- deployments
- events
- ingresses
- jobs
- pods
- pods/attach
- pods/exec
- pods/log
- pods/portforward
- services
- namespaces
- serviceaccounts
verbs: ["*"]
- apiGroups: ["batch"]
resources:
- configmaps
- cronjobs
- deployments
- events
- ingresses
- jobs
- pods
- pods/attach
- pods/exec
- pods/log
- pods/portforward
- services
verbs: ["*"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources:
- roles
- rolebindings
- clusterrolebindings
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubernetes-replicator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubernetes-replicator
subjects:
- kind: ServiceAccount
name: kubernetes-replicator
namespace: kube-system
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: mittwald
namespace: flux-system
spec:
url: https://helm.mittwald.de
interval: 1h
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: kubernetes-replicator
namespace: kube-system
spec:
interval: 5m
chart:
spec:
chart: kubernetes-replicator
sourceRef:
kind: HelmRepository
name: mittwald
namespace: flux-system
install:
createNamespace: false
upgrade:
disableWait: false
values:
serviceAccount:
create: false
name: kubernetes-replicator

View file

@ -0,0 +1,138 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: bind-master-config
namespace: home-server
data:
named.conf: |
include "/etc/bind/externaldns-key.conf";
options {
directory "/var/cache/bind";
recursion yes;
allow-query { any; };
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
forwarders {
10.40.0.254;
};
dnssec-validation auto;
};
zone "." IN {
type hint;
file "/usr/share/dns/root.hints";
};
zone "hxme.net." IN {
type master;
file "/etc/bind/db.hxme.net";
allow-update { key "externaldns-key"; };
};
db.hxme.net: |
$TTL 3600
@ IN SOA ns1.hxme.net. admin.hxme.net. (
1 ; Serial
7200 ; Refresh
1800 ; Retry
1209600 ; Expire
86400 ) ; Negative Cache TTL
;
@ IN NS ns1.hxme.net.
ns1 IN A 10.40.0.110
@ IN A 10.40.0.110
www IN A 10.40.0.110
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: bind-master
namespace: home-server
spec:
selector:
matchLabels:
app: bind-master
template:
metadata:
labels:
app: bind-master
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
securityContext:
fsGroup: 999
initContainers:
- name: fetch-root-hints
image: debian:12
command:
- sh
- -c
- |
apt update && apt -y install curl
curl -sfSL https://www.internic.net/domain/named.cache -o /usr/share/dns/root.hints
volumeMounts:
- mountPath: /usr/share/dns
name: root-hints
containers:
- name: bind-master
image: internetsystemsconsortium/bind9:9.18
command: ["named", "-g", "-c", "/etc/bind/named.conf"]
ports:
- containerPort: 53
protocol: UDP
- containerPort: 53
protocol: TCP
volumeMounts:
- name: config
mountPath: /etc/bind/named.conf
subPath: named.conf
- name: config
mountPath: /etc/bind/db.hxme.net
subPath: db.hxme.net
- name: dns-secrets
mountPath: /etc/bind/externaldns-key.conf
subPath: externaldns-key.conf
- name: bind-cache
mountPath: /var/cache/bind
- name: bind-rundir
mountPath: /var/run/named
- name: root-hints
mountPath: /usr/share/dns
volumes:
- name: dns-secrets
secret:
secretName: dns-secrets
- name: config
configMap:
name: bind-master-config
- name: bind-cache
emptyDir: {}
- name: bind-rundir
emptyDir: {}
- name: root-hints
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: bind-master
namespace: home-server
spec:
selector:
app: bind-master
ports:
- name: dns-udp
port: 53
protocol: UDP
targetPort: 53
- name: dns-tcp
port: 53
protocol: TCP
targetPort: 53

View file

@ -0,0 +1,73 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: jetstack
namespace: flux-system
spec:
url: https://charts.jetstack.io
interval: 1h
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: cert-manager
namespace: home-server
spec:
interval: 30m
chart:
spec:
chart: cert-manager
version: v1.18.2
sourceRef:
kind: HelmRepository
name: jetstack
namespace: flux-system
install:
crds: CreateReplace
createNamespace: true
values:
installCRDs: true
extraArgs:
- --dns01-recursive-nameservers-only
- --dns01-recursive-nameservers=8.8.8.8:53,1.1.1.1:53
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-rfc2136
spec:
acme:
email: admin@hxme.net
server: https://acme-v02.api.letsencrypt.org/directory
#server: https://acme-staging-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-rfc2136
solvers:
- dns01:
rfc2136:
nameserver: hawke.hxst.com.au:53
tsigKeyName: "hxme-update-key"
tsigAlgorithm: HMACSHA512
tsigSecretSecretRef:
name: hxme-update-key
key: hxme-update-key
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: wildcard-hxme-net
namespace: home-server
spec:
secretName: wildcard-hxme-net
secretTemplate:
annotations:
replicator.v1.mittwald.de/replication-allowed: "true"
replicator.v1.mittwald.de/replicate-to: "home-media"
issuerRef:
name: letsencrypt-rfc2136
kind: ClusterIssuer
commonName: "hxme.net"
dnsNames:
- "hxme.net"
- "*.hxme.net"

View file

@ -0,0 +1,78 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: external-dns
rules:
- apiGroups: [""]
resources: ["services","endpoints","pods"]
verbs: ["get","watch","list"]
- apiGroups: ["extensions","networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list","watch"]
- apiGroups: ["discovery.k8s.io"]
resources: ["endpointslices"]
verbs: ["get", "watch", "list"]
# Add DNS provider specific rules here if needed (e.g., for AWS IAM, GCP etc.)
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: external-dns-viewer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: external-dns
subjects:
- kind: ServiceAccount
name: external-dns
namespace: home-server
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: external-dns
namespace: home-server
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-dns
namespace: home-server
spec:
replicas: 1
selector:
matchLabels:
app: external-dns
template:
metadata:
labels:
app: external-dns
spec:
serviceAccountName: external-dns
containers:
- name: external-dns
image: bitnami/external-dns:latest
args:
- --source=service
- --source=ingress
- --provider=rfc2136
- --rfc2136-host=bind-master.home-server.svc.cluster.local
- --rfc2136-port=53
- --rfc2136-zone=hxme.net
- --rfc2136-tsig-secret=$(RFC2136_TSIG_SECRET)
- --rfc2136-tsig-secret-alg=hmac-sha256
- --rfc2136-tsig-keyname=externaldns-key
- --policy=sync
- --registry=txt
- --txt-owner-id=my-cluster
env:
- name: RFC2136_TSIG_SECRET
valueFrom:
secretKeyRef:
name: dns-secrets
key: externaldns-secret

View file

@ -0,0 +1,8 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- bind.yaml
- externaldns.yaml
- certmanager.yaml

View file

@ -0,0 +1,42 @@
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: authentik
namespace: flux-system
spec:
url: https://charts.goauthentik.io/
interval: 1h
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: authentik
namespace: home-server
spec:
interval: 30m
chart:
spec:
chart: authentik
version: 2024.4.2
sourceRef:
kind: HelmRepository
name: authentik
namespace: flux-system
install:
createNamespace: true
upgrade:
disableWait: false
timeout: 10m
valuesFrom:
- kind: Secret
name: authentik-values
values:
server:
ingress:
annotations:
external-dns.alpha.kubernetes.io/hostname: auth.hxme.net
tls:
- secretName: wildcard-hxme-net
hosts:
- auth.hxme.net

View file

@ -0,0 +1,104 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: dovecot-config
namespace: home-server
data:
dovecot.conf: |
log_path = /dev/stdout
info_log_path = /dev/stdout
debug_log_path = /dev/stdout
syslog_facility = local0
protocols = imap
listen = *
disable_plaintext_auth = yes
mail_location = maildir:/data/%u
base_dir = /var/run/dovecot/
ssl = required
ssl_cert = </etc/ssl/hxme/fullchain.pem
ssl_key = </etc/ssl/hxme/privkey.pem
auth_mechanisms = plain login
passdb {
driver = ldap
args = /config/ldap.conf
}
userdb {
driver = static
args = uid=1000 gid=1000 home=/data/%u
}
service imap-login {
inet_listener imap {
port = 0
}
inet_listener imaps {
port = 993
ssl = yes
}
}
ldap.conf: |
hosts = ldap://auth.hxme.net
auth_bind = yes
base = dc=ldap,dc=goauthentik,dc=io
dn = cn=binduser,ou=service-accounts,dc=ldap,dc=goauthentik,dc=io
dnpass = FtaJpthRpKyhEEy69H5qxPymtSeSeuCT9SQCdXmWDeAe7cgTCnk6HXpSzTNS
user_attrs = =home=/data/%u
user_filter = (&(objectClass=person)(uid=%u))
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dovecot
namespace: home-server
spec:
replicas: 1
selector:
matchLabels:
app: dovecot
template:
metadata:
labels:
app: dovecot
spec:
containers:
- name: dovecot
image: registry.gitlab.com/dxcker/dovecot:latest
ports:
- containerPort: 993
name: imaps
volumeMounts:
- name: config
mountPath: /config/
- name: certs
mountPath: /etc/ssl/hxme
readOnly: true
volumes:
- name: config
configMap:
name: dovecot-config
- name: ldap
configMap:
name: dovecot-ldap
- name: tls
secret:
secretName: wildcard-hxme-net
---
apiVersion: v1
kind: Service
metadata:
name: dovecot
namespace: home-server
spec:
selector:
app: dovecot
ports:
- name: imaps
port: 993
targetPort: 993
type: ClusterIP

View file

@ -0,0 +1,11 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- authentik.yaml
- nextcloud.yaml
- vaultwarden.yaml
- linkwarden.yaml
- samba.yaml
- dovecot.yaml

View file

@ -0,0 +1,95 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: linkwarden-pv
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: local-path
hostPath:
path: /dpool/services/linkwarden/app
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: linkwarden-pvc
namespace: home-server
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 5Gi
volumeName: linkwarden-pv
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: linkwarden
namespace: home-server
spec:
replicas: 1
selector:
matchLabels:
app: linkwarden
template:
metadata:
labels:
app: linkwarden
spec:
initContainers:
- name: copy-linkwarden
image: ghcr.io/linkwarden/linkwarden:latest
command: ["/bin/sh", "-c"]
args:
- |
if [ -z "$(ls -A /new_data)" ]; then
echo "/new_data is empty, initializing..."
cp -r /data/. /new_data/
else
echo "/new_data already initialized, skipping copy."
fi
volumeMounts:
- name: linkwarden-data
mountPath: /new_data
containers:
- name: linkwarden
image: ghcr.io/linkwarden/linkwarden:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
env:
- name: NODE_ENV
value: "production"
- name: TZ
value: "Australia/Brisbane"
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: linkwarden-postgres-secret
key: DATABASE_URL
volumeMounts:
- name: linkwarden-data
mountPath: /data
volumes:
- name: linkwarden-data
persistentVolumeClaim:
claimName: linkwarden-pvc
---
apiVersion: v1
kind: Service
metadata:
name: linkwarden
namespace: home-server
spec:
selector:
app: linkwarden
ports:
- port: 3000
targetPort: 3000
protocol: TCP

View file

@ -0,0 +1,132 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: nextcloud-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: local-path
hostPath:
path: /dpool/temp/Nextcloud
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nextcloud-pvc
namespace: home-server
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 10Gi
volumeName: nextcloud-pv
---
apiVersion: v1
kind: Service
metadata:
name: nextcloud
namespace: home-server
spec:
ports:
- port: 80
selector:
app: nextcloud
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nextcloud
namespace: home-server
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
selector:
matchLabels:
app: nextcloud
template:
metadata:
labels:
app: nextcloud
spec:
containers:
- name: nextcloud
image: nextcloud:29
env:
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: nextcloud-secrets
key: MYSQL_PASSWORD
- name: MYSQL_DATABASE
value: nextcloud
- name: MYSQL_USER
value: nextcloud
- name: MYSQL_HOST
value: nextcloud-db
ports:
- containerPort: 80
volumeMounts:
- name: nextcloud-data
mountPath: /var/www/html
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
volumes:
- name: nextcloud-data
persistentVolumeClaim:
claimName: nextcloud-pvc
---
apiVersion: k8s.mariadb.com/v1alpha1
kind: MariaDB
metadata:
name: nextcloud-db
namespace: home-server
spec:
rootPasswordSecretKeyRef:
name: nextcloud-secrets
key: MYSQL_ROOT_PASSWORD
database: nextcloud
username: nextcloud
passwordSecretKeyRef:
name: nextcloud-secrets
key: MYSQL_PASSWORD
image: mariadb:10.11
storage:
size: 5Gi
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nextcloud
namespace: home-server
annotations:
external-dns.alpha.kubernetes.io/hostname: nc.hxme.net
nginx.ingress.kubernetes.io/server-snippet: |
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
spec:
tls:
- hosts:
- nc.hxme.net
secretName: wildcard-hxme-net
rules:
- host: nc.hxme.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nextcloud
port:
number: 80

View file

@ -0,0 +1,94 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: smb-share-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
storageClassName: local-path
persistentVolumeReclaimPolicy: Retain
hostPath:
path: /dpool/
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: smb-share-pvc
namespace: home-server
spec:
accessModes:
- ReadWriteMany
storageClassName: local-path
resources:
requests:
storage: 10Gi
volumeName: smb-share-pv
---
apiVersion: v1
kind: Service
metadata:
name: smb-server
namespace: home-server
spec:
selector:
app: smb-server
ports:
- name: smb
port: 445
targetPort: 445
- name: netbios
port: 139
targetPort: 139
type: NodePort # Use ClusterIP or LoadBalancer depending on access requirements
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: smb-server
namespace: home-server
spec:
replicas: 1
selector:
matchLabels:
app: smb-server
template:
metadata:
labels:
app: smb-server
spec:
containers:
- name: samba
image: dperson/samba
env:
- name: SMB_USER
valueFrom:
secretKeyRef:
name: smb-credentials
key: username
- name: SMB_PASS
valueFrom:
secretKeyRef:
name: smb-credentials
key: password
args:
- -u
- "$(SMB_USER);$(SMB_PASS)"
- -s
- "share;/mount;yes;no;no;$(SMB_USER)"
ports:
- containerPort: 139
- containerPort: 445
securityContext:
capabilities:
add: ["NET_ADMIN"]
volumeMounts:
- name: share
mountPath: /mount
volumes:
- name: share
persistentVolumeClaim:
claimName: smb-share-pvc

View file

@ -0,0 +1,109 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: vaultwarden-pv
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: local-path
hostPath:
path: /dpool/services/vaultwarden/data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: vaultwarden-pvc
namespace: home-server
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 5Gi
volumeName: vaultwarden-pv
---
apiVersion: v1
kind: Service
metadata:
name: vaultwarden
namespace: home-server
spec:
selector:
app: vaultwarden
ports:
- port: 80
targetPort: 80
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: vaultwarden
namespace: home-server
spec:
replicas: 1
selector:
matchLabels:
app: vaultwarden
template:
metadata:
labels:
app: vaultwarden
spec:
containers:
- name: vaultwarden
image: vaultwarden/server:latest
imagePullPolicy: Always
env:
- name: TZ
value: "Australia/Brisbane"
- name: WEBSOCKET_ENABLED
value: "true"
- name: SIGNUPS_ALLOWED
value: "false"
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: vaultwarden-postgres-secret
key: DATABASE_URL
ports:
- containerPort: 80
volumeMounts:
- name: vaultwarden-data
mountPath: /data
volumes:
- name: vaultwarden-data
persistentVolumeClaim:
claimName: vaultwarden-pvc
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: vaultwarden
namespace: home-server
annotations:
external-dns.alpha.kubernetes.io/hostname: vault.hxme.net
nginx.ingress.kubernetes.io/server-snippet: |
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
spec:
tls:
- hosts:
- vault.hxme.net
secretName: wildcard-hxme-net
rules:
- host: vault.hxme.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: vaultwarden
port:
number: 80

View file

@ -1,17 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
kind: Kustomization
resources:
- monitoring/provider.yaml
- monitoring/grafana.yaml
- monitoring/loki.yaml
- monitoring/prometheus.yaml
- operators/mariadb.yaml
- operators/replicator.yaml
- dns/namespace.yaml
- dns/bind.yaml
- dns/externaldns.yaml
- ssl/certmanager.yaml
- auth/authentik.yaml
- files/nextcloud.yaml
- files/syncthing.yaml
- kusts/operators.yaml
- kusts/dns-ssl.yaml
- kusts/home-server.yaml

View file

@ -0,0 +1,29 @@
## I am so fucking mad with Flux right now I can't even begin explaining it.
# I have to do this because it doesn't respect order in kusts...
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: dns-ssl
namespace: flux-system
spec:
interval: 1m0s
ref:
branch: main
url: ssh://git@repobase.net/j/home-server.git
secretRef:
name: flux-ssh
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: dns-ssl
namespace: flux-system
spec:
interval: 1m0s
path: ./deployments/dns-ssl
prune: true
sourceRef:
kind: GitRepository
name: dns-ssl

View file

@ -0,0 +1,28 @@
## I am so fucking mad with Flux right now I can't even begin explaining it.
# I have to do this because it doesn't respect order in kusts...
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: home-server-apps
namespace: flux-system
spec:
interval: 1m0s
ref:
branch: main
url: ssh://git@repobase.net/j/home-server.git
secretRef:
name: flux-ssh
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: home-server-apps
namespace: flux-system
spec:
interval: 1m0s
path: ./deployments/home-server
prune: true
sourceRef:
kind: GitRepository
name: home-server-apps

View file

@ -0,0 +1,29 @@
## I am so fucking mad with Flux right now I can't even begin explaining it.
# I have to do this because it doesn't respect order in kusts...
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: operators
namespace: flux-system
spec:
interval: 1m0s
ref:
branch: main
url: ssh://git@repobase.net/j/home-server.git
secretRef:
name: flux-ssh
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: operators
namespace: flux-system
spec:
interval: 1m0s
path: ./deployments/operators
prune: true
sourceRef:
kind: GitRepository
name: operators

View file

@ -0,0 +1,10 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- mariadb.yaml
- redis.yaml
- postgresql.yaml
- replicator.yaml
- namespace.yaml

View file

@ -54,7 +54,4 @@ spec:
dependsOn:
- name: mariadb-operator-crds
namespace: mariadb-system
values:
metrics:
enabled: true

View file

@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: home-server

View file

@ -0,0 +1,148 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: postgres
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-pv
namespace: postgres
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: local-path
hostPath:
path: /dpool/services/postgres/data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
namespace: postgres
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 5Gi
volumeName: postgres-pv
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:15
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: postgres-secret
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
volumes:
- name: postgres-data
persistentVolumeClaim:
claimName: postgres-pvc
---
apiVersion: v1
kind: Service
metadata:
name: postgres
namespace: postgres
spec:
selector:
app: postgres
ports:
- port: 5432
targetPort: 5432
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-backup-pv
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: local-path
hostPath:
path: /dpool/postgres/backup
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-backup-pvc
namespace: postgres
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 5Gi
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: postgres-backup
namespace: postgres
spec:
schedule: "0 2 * * *" # Every day at 2 AM
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: pg-backup
image: postgres:15
envFrom:
- secretRef:
name: postgres-secret
command:
- /bin/sh
- -c
- |
mkdir -p /backup
PGPASSWORD=$POSTGRES_PASSWORD pg_dump -U $POSTGRES_USER -h localhost $POSTGRES_DB > /backup/backup-$(date +'%Y-%m-%d').sql
volumeMounts:
- name: backup-volume
mountPath: /backup
volumes:
- name: backup-volume
persistentVolumeClaim:
claimName: postgres-backup-pvc

View file

@ -0,0 +1,33 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: home-server
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:7
ports:
- containerPort: 6379
---
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: home-server
spec:
selector:
app: redis
ports:
- port: 6379