From 0f21b4c77e8b71689152b46d1babcce697c8c617 Mon Sep 17 00:00:00 2001 From: GeorgeRaven Date: Wed, 14 Jan 2026 00:28:56 +0000 Subject: [PATCH] Codified coredns config Changelog: added Signed-off-by: GeorgeRaven --- charts/coredns/.helmignore | 23 +++++++++++ charts/coredns/Chart.yaml | 6 +++ charts/coredns/README.md | 26 +++++++++++++ charts/coredns/templates/cm.yaml | 40 ++++++++++++++++++++ charts/coredns/values.yaml | 13 +++++++ charts/infrastructure/templates/coredns.yaml | 26 +++++++++++++ 6 files changed, 134 insertions(+) create mode 100644 charts/coredns/.helmignore create mode 100644 charts/coredns/Chart.yaml create mode 100644 charts/coredns/README.md create mode 100644 charts/coredns/templates/cm.yaml create mode 100644 charts/coredns/values.yaml create mode 100644 charts/infrastructure/templates/coredns.yaml diff --git a/charts/coredns/.helmignore b/charts/coredns/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/coredns/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/coredns/Chart.yaml b/charts/coredns/Chart.yaml new file mode 100644 index 00000000..4d08904d --- /dev/null +++ b/charts/coredns/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: coredns +description: A Helm chart for Kubernetes +type: application +version: 0.1.4 +appVersion: "1.16.0" diff --git a/charts/coredns/README.md b/charts/coredns/README.md new file mode 100644 index 00000000..51ce2eb8 --- /dev/null +++ b/charts/coredns/README.md @@ -0,0 +1,26 @@ +# coredns + +![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) + +A Helm chart for Kubernetes + +## Requirements + +| Repository | Name | Version | +|------------|------|---------| +| https://bitnami-labs.github.io/coredns | coredns | 2.17.9 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| coredns | object | `{}` | | +| environment.baseDomain | string | `"deepcypher.me"` | | +| environment.contact.email | string | `"noreply@deepcypher.me"` | | +| environment.contact.name | string | `"George Onoufriou"` | | +| environment.hardware | string | `"metal"` | | +| environment.location.name | string | `"unknown"` | | +| environment.mode | string | `"production"` | | +| environment.name | string | `"unknown"` | | +| environment.revision | string | `"main"` | | + diff --git a/charts/coredns/templates/cm.yaml b/charts/coredns/templates/cm.yaml new file mode 100644 index 00000000..64abd57d --- /dev/null +++ b/charts/coredns/templates/cm.yaml @@ -0,0 +1,40 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: coredns + namespace: kube-system +data: + Corefile: |- + .:53 { + log + errors + # rewrite k8s-expanded lookups back to deepcypher.me + # rewrite name suffix deepcypher.me.svc.cluster.local. deepcypher.me. + # send traffic to k8s-gateways static IP + rewrite name auth.deepcypher.me traefik.traefik.svc.cluster.local. + forward deepcypher.me. 192.168.10.252 { + policy round_robin + } + # fake recursion available header + header { + response set ra # set RecursionAvailable flag + } + health { + lameduck 5s + } + ready + log . { + class error + } + prometheus :9153 + + kubernetes cluster.local in-addr.arpa ip6.arpa { + pods insecure + fallthrough in-addr.arpa ip6.arpa + } + forward . /etc/resolv.conf + cache 30 + loop + reload + loadbalance + } diff --git a/charts/coredns/values.yaml b/charts/coredns/values.yaml new file mode 100644 index 00000000..48249a60 --- /dev/null +++ b/charts/coredns/values.yaml @@ -0,0 +1,13 @@ +coredns: {} + +environment: + name: unknown # not to be used for hard checks but to display to user + hardware: metal # to be used to enable on-prem specific features like ceph, cilium, etc + mode: production # to be used to configure backup movement and additional debugging features + revision: main # to be used to pull from different git branches + baseDomain: deepcypher.me # to be used to override default chart domains to configure environments + location: + name: unknown # not to be used for hard checks purely informational + contact: + name: George Onoufriou + email: noreply@deepcypher.me diff --git a/charts/infrastructure/templates/coredns.yaml b/charts/infrastructure/templates/coredns.yaml new file mode 100644 index 00000000..aa67e8e7 --- /dev/null +++ b/charts/infrastructure/templates/coredns.yaml @@ -0,0 +1,26 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: coredns + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + name: '' + namespace: coredns + server: 'https://kubernetes.default.svc' + source: + path: charts/coredns + repoURL: {{ .Values.global.repo }} + targetRevision: {{ .Values.environment.revision }} + #helm: + # values: | + project: default + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true