Files
wild-cloud/infrastructure_setup/externaldns/externaldns.yaml
Paul Payne 21d89c2b79 Refactor cert-manager and ExternalDNS configurations
- Updated the namespace for the internal wildcard certificate from 'internal' to 'cert-manager'.
- Adjusted the DNS zone selectors in Let's Encrypt configurations to use CLOUDFLARE_DOMAIN consistently.
- Changed the namespace for the wildcard certificate from 'default' to 'cert-manager'.
- Modified ExternalDNS configuration to use OWNER_ID instead of CLUSTER_ID for TXT owner ID.
- Cleaned up setup-cert-manager.sh by removing unnecessary internal namespace creation and secret duplication.
- Updated certificate wait commands to reflect the new namespace structure.
- Simplified the copying of certificates to the example-admin namespace.
- Removed test service deployment from setup-externaldns.sh for a cleaner setup process.
2025-05-03 13:51:52 -07:00

70 lines
1.6 KiB
YAML

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: external-dns
namespace: externaldns
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: external-dns
rules:
- apiGroups: [""]
resources: ["services", "endpoints", "pods"]
verbs: ["get", "watch", "list"]
- apiGroups: ["extensions", "networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "watch", "list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: external-dns-viewer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: external-dns
subjects:
- kind: ServiceAccount
name: external-dns
namespace: externaldns
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-dns
namespace: externaldns
spec:
selector:
matchLabels:
app: external-dns
strategy:
type: Recreate
template:
metadata:
labels:
app: external-dns
spec:
serviceAccountName: external-dns
containers:
- name: external-dns
image: registry.k8s.io/external-dns/external-dns:v0.13.4
args:
- --source=service
- --source=ingress
- --provider=cloudflare
- --txt-owner-id=${OWNER_ID}
- --log-level=debug
- --publish-internal-services
- --no-cloudflare-proxied
env:
- name: CF_API_TOKEN
valueFrom:
secretKeyRef:
name: cloudflare-api-token
key: api-token