Adding internal dns via bind.

This commit is contained in:
Joseph Hanson 2024-01-14 23:08:53 -06:00
parent 9304a7e493
commit 0142c8b091
4 changed files with 127 additions and 0 deletions

View file

@ -0,0 +1,22 @@
---
# yaml-language-server: $schema=https://ks.hsn.dev/external-secrets.io/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: externaldns-internal
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: externaldns-internal-secrets
creationPolicy: Owner
data:
- secretKey: bind_rndc_algorithm
remoteRef:
key: bind
property: externaldns_algorithm
- secretKey: bind_rndc_secret
remoteRef:
key: bind
property: externaldns_secret

View file

@ -0,0 +1,79 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta2.json
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: &name externaldns-jahanson-tech
spec:
interval: 30m
chart:
spec:
chart: external-dns
version: 1.14.1
sourceRef:
kind: HelmRepository
name: kubernetes-sigs-external-dns
namespace: flux-system
interval: 30m
values:
fullnameOverride: *name
domainFilters:
- jahanson.tech
env:
- name: EXTERNAL_DNS_RFC2136_HOST
value: "10.5.0.3"
- name: EXTERNAL_DNS_RFC2136_PORT
value: "53"
- name: EXTERNAL_DNS_RFC2136_ZONE
value: "jahanson.tech"
- name: EXTERNAL_DNS_RFC2136_TSIG_AXFR
value: "true"
- name: EXTERNAL_DNS_RFC2136_TSIG_KEYNAME
value: externaldns
- name: EXTERNAL_DNS_RFC2136_TSIG_SECRET_ALG
valueFrom:
secretKeyRef:
name: externaldns-internal-secrets
key: bind_rndc_algorithm
- name: EXTERNAL_DNS_RFC2136_TSIG_SECRET
valueFrom:
secretKeyRef:
name: externaldns-internal-secrets
key: bind_rndc_secret
podAnnotations:
secret.reloader.stakater.com/reload: externaldns-internal-secrets
policy: sync
provider: rfc2136
resources:
requests:
cpu: 16m
memory: 90M
limits:
memory: 90M
serviceMonitor:
enabled: true
sources:
- ingress
- service
txtPrefix: "k8s."
postRenderers:
- kustomize:
patches:
- target:
version: v1
kind: Deployment
name: *name
patch: |
- op: add
path: /spec/template/spec/enableServiceLinks
value: false

View file

@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
- ./externalsecret.yaml

View file

@ -21,6 +21,25 @@ spec:
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cluster-apps-externaldns-jahanson-tech
namespace: flux-system
labels:
substitution.flux.home.arpa/enabled: "true"
spec:
interval: 10m
path: "./kubernetes/apps/network/external-dns/app/jahanson-tech"
prune: true
sourceRef:
kind: GitRepository
name: homelab
wait: true
dependsOn:
- name: cluster-apps-external-secrets-stores
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &appname externaldns-shared
namespace: flux-system