add external-dns

This commit is contained in:
CJ_Clippy 2024-04-26 17:55:07 +00:00
parent 1f234f6cc1
commit f59d6fea42
3 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,24 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: podinfo-ingress
namespace: default
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-staging"
spec:
ingressClassName: nginx
rules:
- host: podinfo.sbtp.xyz
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: podinfo
port:
name: http
tls:
- hosts:
- podinfo.sbtp.xyz
secretName: podinfo-tls

View File

@ -5,3 +5,4 @@ resources:
- namespace.yaml
- repository.yaml
- release.yaml
- ingress.yaml

View File

@ -0,0 +1,66 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: external-dns
---
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: default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-dns
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: external-dns
template:
metadata:
labels:
app: external-dns
spec:
serviceAccountName: external-dns
containers:
- name: external-dns
resources:
limits:
memory: "1024Mi"
cpu: "100m"
image: registry.k8s.io/external-dns/external-dns:v0.14.1
args:
- --source=ingress
- --domain-filter=sbtp.xyz
- --provider=vultr
env:
- name: VULTR_API_KEY
valueFrom:
secretKeyRef:
name: vultr
key: apiKey