Skip to content

Commit

Permalink
Revert Steven "feat(ingress-nginx): remove need for individual ingres…
Browse files Browse the repository at this point in the history
…s annotations" (#8443)
  • Loading branch information
onedr0p authored Dec 9, 2024
1 parent 556f819 commit b678d9d
Show file tree
Hide file tree
Showing 32 changed files with 65 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Alternative solutions to the first two of these problems would be to host a Kube

## 🌐 DNS

In my cluster there are two instances of [ExternalDNS](https://github.com/kubernetes-sigs/external-dns) running. One for syncing private DNS records to my `UDM Pro Max` using [ExternalDNS webhook provider for UniFi](https://github.com/kashalls/external-dns-unifi-webhook), while another instance syncs public DNS to `Cloudflare`. This setup is managed by creating ingresses with two specific classes: `internal` for private DNS and `external` for public DNS. The `external-dns` instances then syncs the DNS records to their respective platforms accordingly.
In my cluster there are two [ExternalDNS](https://github.com/kubernetes-sigs/external-dns) instances deployed. One is deployed with the [ExternalDNS webhook provider for UniFi](https://github.com/kashalls/external-dns-unifi-webhook) which syncs DNS records to my UniFi router. The other ExternalDNS instance syncs DNS records to Cloudflare only when the ingresses and services have an ingress class name of `external` and contain an ingress annotation `external-dns.alpha.kubernetes.io/target`. All local clients on my network use my UniFi router as the upstream DNS server.

---

Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/database/emqx/cluster/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: emqx-dashboard
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
spec:
ingressClassName: internal
rules:
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/atuin/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ spec:
scrapeTimeout: 10s
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: sh.devbu.io
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/autobrr/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/bazarr/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: bazarr.devbu.io
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/filebrowser/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/go2rtc/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ spec:
protocol: UDP
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: go2rtc.devbu.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ spec:
port: 12321
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: external.devbu.io
className: external
hosts:
- host: hass.devbu.io
Expand All @@ -94,6 +96,8 @@ spec:
identifier: app
port: http
code-server:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: hass-code.devbu.io
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/miniflux/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ spec:
scrapeTimeout: 10s
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/overseerr/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: external.devbu.io
className: external
hosts:
- host: requests.devbu.io
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/pinchflat/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
1 change: 1 addition & 0 deletions kubernetes/main/apps/default/plex/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ spec:
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: external.devbu.io
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
className: external
hosts:
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/prowlarr/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/qbittorrent/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ spec:
protocol: TCP
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: qb.devbu.io
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/radarr/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/sabnzbd/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: sab.devbu.io
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/slskd/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ spec:
scrapeTimeout: 10s
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/sonarr/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/tautulli/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/zigbee2mqtt/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ spec:
port: *port
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: zigbee.devbu.io
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/default/zwave/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ spec:
port: 3000
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: webhook-receiver
annotations:
external-dns.alpha.kubernetes.io/target: external.devbu.io
spec:
ingressClassName: external
rules:
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/kube-system/cilium/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ spec:
rollOutPods: true
ingress:
enabled: true
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts: ["hubble.devbu.io"]
2 changes: 2 additions & 0 deletions kubernetes/main/apps/network/echo-server/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ spec:
scrapeTimeout: 10s
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: external.devbu.io
className: external
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
5 changes: 1 addition & 4 deletions kubernetes/main/apps/network/nginx/external/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
replicaCount: 2
service:
annotations:
external-dns.alpha.kubernetes.io/hostname: &hostname external.devbu.io
external-dns.alpha.kubernetes.io/hostname: external.devbu.io
lbipam.cilium.io/ips: 192.168.42.126
ingressClassResource:
name: external
Expand Down Expand Up @@ -79,10 +79,7 @@ spec:
any: true
extraArgs:
default-ssl-certificate: network/devbu-io-tls
publish-status-address: *hostname
terminationGracePeriodSeconds: 120
publishService:
enabled: false
resources:
requests:
cpu: 100m
Expand Down
5 changes: 1 addition & 4 deletions kubernetes/main/apps/network/nginx/internal/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
replicaCount: 2
service:
annotations:
external-dns.alpha.kubernetes.io/hostname: &hostname internal.devbu.io
external-dns.alpha.kubernetes.io/hostname: internal.devbu.io
lbipam.cilium.io/ips: 192.168.42.121
ingressClassResource:
name: internal
Expand Down Expand Up @@ -73,10 +73,7 @@ spec:
any: true
extraArgs:
default-ssl-certificate: network/devbu-io-tls
publish-status-address: *hostname
terminationGracePeriodSeconds: 120
publishService:
enabled: false
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ spec:
fullnameOverride: blackbox-exporter
ingress:
enabled: true
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
className: internal
hosts:
- host: blackbox-exporter.devbu.io
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/observability/gatus/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ spec:
scrapeTimeout: 10s
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: external.devbu.io
className: external
hosts:
- host: status.devbu.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ spec:
enabled: true
ingress:
enabled: true
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
ingressClassName: internal
hosts: ["grafana.devbu.io"]
persistence:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ spec:
port: *healthPort
ingress:
app:
annotations:
external-dns.alpha.kubernetes.io/target: external.devbu.io
className: external
hosts:
- host: "{{ .Release.Name }}.devbu.io"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
alertmanager:
ingress:
enabled: true
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
ingressClassName: internal
hosts: ["alertmanager.devbu.io"]
pathType: Prefix
Expand Down Expand Up @@ -69,6 +71,8 @@ spec:
prometheus:
ingress:
enabled: true
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
ingressClassName: internal
hosts: ["prometheus.devbu.io"]
pathType: Prefix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:
createPrometheusRules: true
ingress:
dashboard:
annotations:
external-dns.alpha.kubernetes.io/target: internal.devbu.io
ingressClassName: internal
host:
name: rook.devbu.io
Expand Down Expand Up @@ -197,6 +199,7 @@ spec:
# ingress:
# enabled: true
# annotations:
# external-dns.alpha.kubernetes.io/target: internal.devbu.io
# nginx.ingress.kubernetes.io/proxy-body-size: "0"
# nginx.ingress.kubernetes.io/proxy-request-buffering: "off"
# ingressClassName: internal
Expand Down

0 comments on commit b678d9d

Please sign in to comment.