From 6f5b22226ae85163d1243f0d74da0cbfcb34f717 Mon Sep 17 00:00:00 2001 From: Daniel Muehlbachler-Pietrzykowski Date: Thu, 9 Nov 2023 11:59:51 +0100 Subject: [PATCH] feat: cleanup internal dns --- README.md | 5 +- .../coredns/extensions/kustomization.yaml | 6 --- .../coredns/coredns/extensions/service.yaml | 24 --------- .../coredns/coredns/kustomization.yaml | 13 ----- .../coredns/coredns/kustomizeconfig.yaml | 7 --- .../coredns/coredns/templates/extensions.yaml | 12 ----- .../coredns/coredns/templates/release.yaml | 21 -------- .../coredns/coredns/templates/repository.yaml | 8 --- applications/coredns/coredns/values.yaml | 51 ------------------- applications/coredns/etcd/kustomization.yaml | 11 ---- .../coredns/etcd/kustomizeconfig.yaml | 7 --- .../coredns/etcd/templates/release.yaml | 21 -------- applications/coredns/etcd/values.yaml | 29 ----------- .../coredns/external-dns/kustomization.yaml | 11 ---- .../coredns/external-dns/kustomizeconfig.yaml | 7 --- .../external-dns/templates/release.yaml | 21 -------- applications/coredns/external-dns/values.yaml | 31 ----------- applications/coredns/kustomization.yaml | 7 --- applications/kustomization.yaml | 1 - 19 files changed, 2 insertions(+), 291 deletions(-) delete mode 100644 applications/coredns/coredns/extensions/kustomization.yaml delete mode 100644 applications/coredns/coredns/extensions/service.yaml delete mode 100644 applications/coredns/coredns/kustomization.yaml delete mode 100644 applications/coredns/coredns/kustomizeconfig.yaml delete mode 100644 applications/coredns/coredns/templates/extensions.yaml delete mode 100644 applications/coredns/coredns/templates/release.yaml delete mode 100644 applications/coredns/coredns/templates/repository.yaml delete mode 100644 applications/coredns/coredns/values.yaml delete mode 100644 applications/coredns/etcd/kustomization.yaml delete mode 100644 applications/coredns/etcd/kustomizeconfig.yaml delete mode 100644 applications/coredns/etcd/templates/release.yaml delete mode 100644 applications/coredns/etcd/values.yaml delete mode 100644 applications/coredns/external-dns/kustomization.yaml delete mode 100644 applications/coredns/external-dns/kustomizeconfig.yaml delete mode 100644 applications/coredns/external-dns/templates/release.yaml delete mode 100644 applications/coredns/external-dns/values.yaml delete mode 100644 applications/coredns/kustomization.yaml diff --git a/README.md b/README.md index 9062588b..4e9e67cb 100644 --- a/README.md +++ b/README.md @@ -62,10 +62,9 @@ The following applications are defined in [`core/`](core/). The following applications are defined in [`applications/`](applications/). -- [x] [AdGuard](https://adguard.com/en/adguard-home/overview.html) - DNS server with ad filtering/blocking capabilities. -- [x] [CoreDNS](https://coredns.io) - DNS resolver for internal, local only, domains. +- [x] [Adguard](https://adguard.com/en/adguard-home/overview.html) - DNS server with ad filtering/blocking capabilities. - [x] [dnsmasq](https://thekelleys.org.uk/dnsmasq/doc.html) - IPv4 and IPv6 DHCP server. -- [x] [External DNS with CoreDNS/etcd integration](https://github.com/kubernetes-sigs/external-dns) - Creates DNS records in CoreDNS/etcs for internal, local only, reachable services. +- [x] [External DNS with Adguard integration](https://github.com/kubernetes-sigs/external-dns) - Creates DNS records in Adguard for internal, local only, reachable services. Uses the [External DNS Adguard Webhook provider](https://github.com/muhlba91/external-dns-provider-adguard). - [x] External Services - Deploys Kubernetes `Service`s and `Ingress`es to local endpoints, and existing services outside of the cluster. - [x] [Grafana](http://grafana.com) - Visualization of metrics, and other data. diff --git a/applications/coredns/coredns/extensions/kustomization.yaml b/applications/coredns/coredns/extensions/kustomization.yaml deleted file mode 100644 index a8544a89..00000000 --- a/applications/coredns/coredns/extensions/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: coredns -resources: - - ./service.yaml diff --git a/applications/coredns/coredns/extensions/service.yaml b/applications/coredns/coredns/extensions/service.yaml deleted file mode 100644 index 5f4cce1d..00000000 --- a/applications/coredns/coredns/extensions/service.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - annotations: - metallb.universe.tf/loadBalancerIPs: "10.0.220.1,2a01:aea0:dd3:25a:f000:21:1" - name: coredns-lb -spec: - type: LoadBalancer - ipFamilyPolicy: PreferDualStack - externalTrafficPolicy: Local - ipFamilies: - - IPv4 - - IPv6 - ports: - - name: udp-53 - port: 53 - protocol: UDP - - name: tcp-53 - port: 53 - protocol: TCP - selector: - app.kubernetes.io/instance: coredns - app.kubernetes.io/name: coredns diff --git a/applications/coredns/coredns/kustomization.yaml b/applications/coredns/coredns/kustomization.yaml deleted file mode 100644 index bdf813b9..00000000 --- a/applications/coredns/coredns/kustomization.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - ./templates/repository.yaml - - ./templates/release.yaml - - ./templates/extensions.yaml -configMapGenerator: - - name: coredns-values - files: - - values.yaml=values.yaml -configurations: - - kustomizeconfig.yaml diff --git a/applications/coredns/coredns/kustomizeconfig.yaml b/applications/coredns/coredns/kustomizeconfig.yaml deleted file mode 100644 index 58f92ba1..00000000 --- a/applications/coredns/coredns/kustomizeconfig.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -nameReference: - - kind: ConfigMap - version: v1 - fieldSpecs: - - path: spec/valuesFrom/name - kind: HelmRelease diff --git a/applications/coredns/coredns/templates/extensions.yaml b/applications/coredns/coredns/templates/extensions.yaml deleted file mode 100644 index 53c0b231..00000000 --- a/applications/coredns/coredns/templates/extensions.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: coredns-extensions -spec: - targetNamespace: coredns - sourceRef: - kind: GitRepository - name: cluster-applications - path: ./applications/coredns/coredns/extensions/ - wait: true diff --git a/applications/coredns/coredns/templates/release.yaml b/applications/coredns/coredns/templates/release.yaml deleted file mode 100644 index 3605bd7e..00000000 --- a/applications/coredns/coredns/templates/release.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - name: coredns -spec: - releaseName: coredns - targetNamespace: coredns - chart: - spec: - chart: coredns - version: 1.28.1 - reconcileStrategy: ChartVersion - sourceRef: - kind: HelmRepository - name: coredns - namespace: flux-system - valuesFrom: - - kind: ConfigMap - name: coredns-values - valuesKey: values.yaml diff --git a/applications/coredns/coredns/templates/repository.yaml b/applications/coredns/coredns/templates/repository.yaml deleted file mode 100644 index a7baf9aa..00000000 --- a/applications/coredns/coredns/templates/repository.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository -metadata: - name: coredns - namespace: flux-system -spec: - url: https://coredns.github.io/helm diff --git a/applications/coredns/coredns/values.yaml b/applications/coredns/coredns/values.yaml deleted file mode 100644 index 943d20af..00000000 --- a/applications/coredns/coredns/values.yaml +++ /dev/null @@ -1,51 +0,0 @@ ---- -global: - fullnameOverride: coredns - -serviceAccount: - create: true - -isClusterService: false - -servers: - - zones: - - zone: . - port: 53 - plugins: - - name: errors - - name: health - configBlock: |- - lameduck 5s - - name: ready - - name: prometheus - parameters: 0.0.0.0:9153 - - name: forward - parameters: . tls://1.1.1.1 tls://1.0.0.1 tls://2606:4700:4700::1111 tls://2606:4700:4700::1001 - configBlock: | - tls_servername cloudflare-dns.com - except internal.muehlbachler.io - - name: cache - parameters: 3600 - - name: loop - - name: reload - - name: loadbalance - - name: etcd - parameters: internal.muehlbachler.io - configBlock: | - stubzones - path /skydns - endpoint http://etcd:2379 - -livenessProbe: - initialDelaySeconds: 5 - -readinessProbe: - initialDelaySeconds: 5 - -resources: - requests: - cpu: 5m - memory: 80Mi - limits: - cpu: 50m - memory: 144Mi diff --git a/applications/coredns/etcd/kustomization.yaml b/applications/coredns/etcd/kustomization.yaml deleted file mode 100644 index d5563c32..00000000 --- a/applications/coredns/etcd/kustomization.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - ./templates/release.yaml -configMapGenerator: - - name: coredns-etcd-values - files: - - values.yaml=values.yaml -configurations: - - kustomizeconfig.yaml diff --git a/applications/coredns/etcd/kustomizeconfig.yaml b/applications/coredns/etcd/kustomizeconfig.yaml deleted file mode 100644 index 58f92ba1..00000000 --- a/applications/coredns/etcd/kustomizeconfig.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -nameReference: - - kind: ConfigMap - version: v1 - fieldSpecs: - - path: spec/valuesFrom/name - kind: HelmRelease diff --git a/applications/coredns/etcd/templates/release.yaml b/applications/coredns/etcd/templates/release.yaml deleted file mode 100644 index a82da724..00000000 --- a/applications/coredns/etcd/templates/release.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - name: coredns-etcd -spec: - releaseName: coredns-etcd - targetNamespace: coredns - chart: - spec: - chart: etcd - version: 9.5.6 - reconcileStrategy: ChartVersion - sourceRef: - kind: HelmRepository - name: bitnami - namespace: flux-system - valuesFrom: - - kind: ConfigMap - name: coredns-etcd-values - valuesKey: values.yaml diff --git a/applications/coredns/etcd/values.yaml b/applications/coredns/etcd/values.yaml deleted file mode 100644 index 76b4b1f2..00000000 --- a/applications/coredns/etcd/values.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -fullnameOverride: etcd - -serviceAccount: - create: true - automountServiceAccountToken: false - -auth: - rbac: - create: false - token: - enabled: false - -persistence: - enabled: false - -livenessProbe: - initialDelaySeconds: 5 - -readinessProbe: - initialDelaySeconds: 5 - -resources: - requests: - cpu: 15m - memory: 112Mi - limits: - cpu: 150m - memory: 176Mi diff --git a/applications/coredns/external-dns/kustomization.yaml b/applications/coredns/external-dns/kustomization.yaml deleted file mode 100644 index 295bad52..00000000 --- a/applications/coredns/external-dns/kustomization.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - ./templates/release.yaml -configMapGenerator: - - name: coredns-external-dns-values - files: - - values.yaml=values.yaml -configurations: - - kustomizeconfig.yaml diff --git a/applications/coredns/external-dns/kustomizeconfig.yaml b/applications/coredns/external-dns/kustomizeconfig.yaml deleted file mode 100644 index 58f92ba1..00000000 --- a/applications/coredns/external-dns/kustomizeconfig.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -nameReference: - - kind: ConfigMap - version: v1 - fieldSpecs: - - path: spec/valuesFrom/name - kind: HelmRelease diff --git a/applications/coredns/external-dns/templates/release.yaml b/applications/coredns/external-dns/templates/release.yaml deleted file mode 100644 index ec317806..00000000 --- a/applications/coredns/external-dns/templates/release.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease -metadata: - name: coredns-external-dns -spec: - releaseName: coredns-external-dns - targetNamespace: coredns - chart: - spec: - chart: external-dns - version: 6.27.0 - reconcileStrategy: ChartVersion - sourceRef: - kind: HelmRepository - name: bitnami - namespace: flux-system - valuesFrom: - - kind: ConfigMap - name: coredns-external-dns-values - valuesKey: values.yaml diff --git a/applications/coredns/external-dns/values.yaml b/applications/coredns/external-dns/values.yaml deleted file mode 100644 index 5ad3cd4f..00000000 --- a/applications/coredns/external-dns/values.yaml +++ /dev/null @@ -1,31 +0,0 @@ ---- -image: - registry: registry.k8s.io - repository: external-dns/external-dns - tag: v0.14.0 - -sources: - - crd - - service - - ingress - -interval: 2m - -logLevel: warning - -domainFilters: - - internal.muehlbachler.io -annotationFilter: external-dns.alpha.kubernetes.io/provider=internal - -txtOwnerId: external-dns-prod-coredns -provider: coredns -coredns: - etcdEndpoints: "http://etcd.coredns:2379" - -resources: - requests: - cpu: 3m - memory: 64Mi - limits: - cpu: 30m - memory: 96Mi diff --git a/applications/coredns/kustomization.yaml b/applications/coredns/kustomization.yaml deleted file mode 100644 index aa8bf777..00000000 --- a/applications/coredns/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - ./etcd/ - - ./coredns/ - - ./external-dns/ diff --git a/applications/kustomization.yaml b/applications/kustomization.yaml index ec9701c4..5d633b1c 100644 --- a/applications/kustomization.yaml +++ b/applications/kustomization.yaml @@ -4,6 +4,5 @@ kind: Kustomization namespace: flux-system resources: - ./dnsmasq/ - - ./coredns/ - ./adguard/ - ./external-services/