From b5d859b6cb67887bedcd62175f32560f8450638c Mon Sep 17 00:00:00 2001 From: willemjan Date: Thu, 15 Oct 2026 09:23:32 +0200 Subject: [PATCH] added adguard and agrocd self management --- apps/adguard.yaml | 16 +++++++ apps/argocd.yaml | 16 +++++++ infrastructure/argocd/values.yaml | 6 +++ services/adguard/app.yaml | 78 +++++++++++++++++++++++++++++++ services/adguard/cert.yaml | 10 ++++ 5 files changed, 126 insertions(+) create mode 100644 apps/adguard.yaml create mode 100644 infrastructure/argocd/values.yaml create mode 100644 services/adguard/app.yaml create mode 100644 services/adguard/cert.yaml diff --git a/apps/adguard.yaml b/apps/adguard.yaml new file mode 100644 index 0000000..0daeb7e --- /dev/null +++ b/apps/adguard.yaml @@ -0,0 +1,16 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: adguard + namespace: adguard +spec: + project: default + source: + repoURL: https://gitea.zb-kw.duckdns.org/willemjan/cluster.git + targetRevision: main + path: services/adguard + destination: + server: https://kubernetes.default.svc + namespace: adguard + syncPolicy: + automated: {prune: true, selfHeal: true} \ No newline at end of file diff --git a/apps/argocd.yaml b/apps/argocd.yaml index e69de29..6c61df7 100644 --- a/apps/argocd.yaml +++ b/apps/argocd.yaml @@ -0,0 +1,16 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: argocd + namespace: argocd +spec: + project: default + source: + repoURL: https://gitea.zb-kw.duckdns.org/willemjan/cluster.git + targetRevision: main + path: services/argocd + destination: + server: https://kubernetes.default.svc + namespace: argocd + syncPolicy: + automated: {prune: true, selfHeal: true} \ No newline at end of file diff --git a/infrastructure/argocd/values.yaml b/infrastructure/argocd/values.yaml new file mode 100644 index 0000000..cb98afb --- /dev/null +++ b/infrastructure/argocd/values.yaml @@ -0,0 +1,6 @@ +# infrastructure/argocd/values.yaml of patch +spec: + template: + spec: + nodeSelector: + node-type: 8100t \ No newline at end of file diff --git a/services/adguard/app.yaml b/services/adguard/app.yaml new file mode 100644 index 0000000..68f581b --- /dev/null +++ b/services/adguard/app.yaml @@ -0,0 +1,78 @@ +# services//app.yaml +apiVersion: v1 +kind: Namespace +metadata: + name: adguard +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: adguard-config + namespace: adguard +spec: + storageClassName: nfs-client # NFS vanaf Proxmox — Bijlage A + accessModes: [ReadWriteMany] + resources: + requests: + storage: 5Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: adguard + namespace: adguard +spec: + selector: + matchLabels: {app: adguard} + template: + metadata: + labels: {app: adguard} + spec: + containers: + - name: adguard + image: adguard/adguardhome:v0.107.79 # pin de tag! (Renovate houdt ze bij) + ports: [{containerPort: 80}] + volumeMounts: [{name: config, mountPath: /config}] + volumes: + - name: config + persistentVolumeClaim: {claimName: adguard-config} +--- +apiVersion: v1 +kind: Service +metadata: + name: adguard + namespace: adguard +spec: + selector: {app: adguard} + ports: [{port: 80, targetPort: 80}] # intern op 80 zetten is handig +--- +# toevoegen in service.yaml — DNS op de node zelf +apiVersion: v1 +kind: Service +metadata: + name: adguard-dns + namespace: adguard +spec: + type: LoadBalancer # klipper bindt poort 53 op de node(s) + selector: {app: adguard} + ports: + - {name: dns-tcp, port: 53, targetPort: 53, protocol: TCP} + - {name: dns-udp, port: 53, targetPort: 53, protocol: UDP} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: adguard + namespace: adguard +spec: + rules: + - host: adguard-cluster.zb-kw.duckdns.org + http: + paths: + - path: / + pathType: Prefix + backend: + service: {name: adguard, port: {number: 80}} + tls: + - hosts: [adguard-cluster.zb-kw.duckdns.org] + secretName: zb-kw-wildcard-tls \ No newline at end of file diff --git a/services/adguard/cert.yaml b/services/adguard/cert.yaml new file mode 100644 index 0000000..d2a9652 --- /dev/null +++ b/services/adguard/cert.yaml @@ -0,0 +1,10 @@ +# services//cert.yaml +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: zb-kw-wildcard + namespace: adguard +spec: + secretName: zb-kw-wildcard-tls + dnsNames: ["adguard-cluster.zb-kw.duckdns.org"] + issuerRef: {name: duckdns, kind: ClusterIssuer} \ No newline at end of file