Skip to content

Commit cf7cd9c

Browse files
committed
Release version 0.0.4
1 parent 4511139 commit cf7cd9c

File tree

5 files changed

+89
-10
lines changed

5 files changed

+89
-10
lines changed

README.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
External-DNS Webhook Provider to manage Netcup DNS Records
44

5+
> [!INFO]
6+
> This repository is not affiliated with Netcup.
57
68
> [!WARNING]
79
> Completely untested code. Might eat your DNS records. You have been warned.
@@ -33,6 +35,39 @@ Then apply one of the following manifests file to deploy external-dns.
3335

3436
[embedmd]:# (example/external-dns.yaml)
3537
```yaml
38+
apiVersion: v1
39+
kind: ServiceAccount
40+
metadata:
41+
name: external-dns
42+
---
43+
apiVersion: rbac.authorization.k8s.io/v1
44+
kind: ClusterRole
45+
metadata:
46+
name: external-dns
47+
rules:
48+
- apiGroups: [""]
49+
resources: ["services","endpoints","pods"]
50+
verbs: ["get","watch","list"]
51+
- apiGroups: ["extensions","networking.k8s.io"]
52+
resources: ["ingresses"]
53+
verbs: ["get","watch","list"]
54+
- apiGroups: [""]
55+
resources: ["nodes"]
56+
verbs: ["list", "watch"]
57+
---
58+
apiVersion: rbac.authorization.k8s.io/v1
59+
kind: ClusterRoleBinding
60+
metadata:
61+
name: external-dns-viewer
62+
roleRef:
63+
apiGroup: rbac.authorization.k8s.io
64+
kind: ClusterRole
65+
name: external-dns
66+
subjects:
67+
- kind: ServiceAccount
68+
name: external-dns
69+
namespace: default
70+
---
3671
apiVersion: apps/v1
3772
kind: Deployment
3873
metadata:
@@ -48,18 +83,22 @@ spec:
4883
labels:
4984
app: external-dns
5085
spec:
86+
serviceAccountName: external-dns
5187
containers:
5288
- name: external-dns
5389
image: registry.k8s.io/external-dns/external-dns:v0.14.0
5490
args:
91+
- --log-level=debug
5592
- --source=ingress
5693
- --source=service
5794
- --provider=webhook
5895
- name: external-dns-webhook-provider
59-
image: ghcr.io/mrueg/external-dns-netcup-webhook:main
96+
image: ghcr.io/mrueg/external-dns-netcup-webhook:latest
97+
imagePullPolicy: Always
6098
args:
61-
- --domain-filter="example.com"
62-
- --netcup-customer-id="YOUR_CUSTOMER_ID"
99+
- --log-level=debug
100+
- --domain-filter=YOUR_DOMAIN
101+
- --netcup-customer-id=YOUR_ID
63102
env:
64103
- name: NETCUP_API_KEY
65104
valueFrom:
@@ -104,7 +143,8 @@ kind: Service
104143
metadata:
105144
name: nginx
106145
annotations:
107-
external-dns.alpha.kubernetes.io/hostname: example.com
146+
external-dns.alpha.kubernetes.io/hostname: test.example.com
147+
external-dns.alpha.kubernetes.io/internal-hostname: internaltest.example.com
108148
spec:
109149
selector:
110150
app: nginx

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.3
1+
0.0.4

example/external-dns.yaml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: external-dns
5+
---
6+
apiVersion: rbac.authorization.k8s.io/v1
7+
kind: ClusterRole
8+
metadata:
9+
name: external-dns
10+
rules:
11+
- apiGroups: [""]
12+
resources: ["services","endpoints","pods"]
13+
verbs: ["get","watch","list"]
14+
- apiGroups: ["extensions","networking.k8s.io"]
15+
resources: ["ingresses"]
16+
verbs: ["get","watch","list"]
17+
- apiGroups: [""]
18+
resources: ["nodes"]
19+
verbs: ["list", "watch"]
20+
---
21+
apiVersion: rbac.authorization.k8s.io/v1
22+
kind: ClusterRoleBinding
23+
metadata:
24+
name: external-dns-viewer
25+
roleRef:
26+
apiGroup: rbac.authorization.k8s.io
27+
kind: ClusterRole
28+
name: external-dns
29+
subjects:
30+
- kind: ServiceAccount
31+
name: external-dns
32+
namespace: default
33+
---
134
apiVersion: apps/v1
235
kind: Deployment
336
metadata:
@@ -13,18 +46,22 @@ spec:
1346
labels:
1447
app: external-dns
1548
spec:
49+
serviceAccountName: external-dns
1650
containers:
1751
- name: external-dns
1852
image: registry.k8s.io/external-dns/external-dns:v0.14.0
1953
args:
54+
- --log-level=debug
2055
- --source=ingress
2156
- --source=service
2257
- --provider=webhook
2358
- name: external-dns-webhook-provider
24-
image: ghcr.io/mrueg/external-dns-netcup-webhook:main
59+
image: ghcr.io/mrueg/external-dns-netcup-webhook:latest
60+
imagePullPolicy: Always
2561
args:
26-
- --domain-filter="example.com"
27-
- --netcup-customer-id="YOUR_CUSTOMER_ID"
62+
- --log-level=debug
63+
- --domain-filter=YOUR_DOMAIN
64+
- --netcup-customer-id=YOUR_ID
2865
env:
2966
- name: NETCUP_API_KEY
3067
valueFrom:

example/nginx.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ kind: Service
2222
metadata:
2323
name: nginx
2424
annotations:
25-
external-dns.alpha.kubernetes.io/hostname: example.com
25+
external-dns.alpha.kubernetes.io/hostname: test.example.com
26+
external-dns.alpha.kubernetes.io/internal-hostname: internaltest.example.com
2627
spec:
2728
selector:
2829
app: nginx

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ func buildMetricsServer(registry prometheus.Gatherer, logger log.Logger) *http.S
150150
func buildWebhookServer(logger log.Logger) (*http.ServeMux, error) {
151151
mux := http.NewServeMux()
152152

153+
var rootPath = "/"
153154
var healthzPath = "/healthz"
154155
var recordsPath = "/records"
155156
var adjustEndpointsPath = "/adjustendpoints"
@@ -170,7 +171,7 @@ func buildWebhookServer(logger log.Logger) (*http.ServeMux, error) {
170171
})
171172

172173
// Add negotiatePath
173-
mux.HandleFunc("/", p.NegotiateHandler)
174+
mux.HandleFunc(rootPath, p.NegotiateHandler)
174175
// Add adjustEndpointsPath
175176
mux.HandleFunc(adjustEndpointsPath, p.AdjustEndpointsHandler)
176177
// Add recordsPath

0 commit comments

Comments
 (0)