Skip to content

Commit dfb9314

Browse files
committed
Generate README from yaml via embedmd
1 parent aedd9b7 commit dfb9314

File tree

4 files changed

+81
-2
lines changed

4 files changed

+81
-2
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ lint:
1515
.PHONY: test
1616
test:
1717
go test ./...
18+
19+
.PHONY: generate
20+
generate:
21+
embedmd -w `find . -path ./vendor -prune -o -name "*.md" -print`

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Then apply one of the following manifests file to deploy external-dns.
3131

3232
### Manifest (for clusters without RBAC enabled)
3333

34+
[embedmd]:# (example/external-dns.yaml)
3435
```yaml
3536
apiVersion: apps/v1
3637
kind: Deployment
@@ -49,13 +50,13 @@ spec:
4950
spec:
5051
containers:
5152
- name: external-dns
52-
image: registry.k8s.io/external-dns/external-dns:latest
53+
image: registry.k8s.io/external-dns/external-dns:v0.14.0
5354
args:
5455
- --source=ingress
5556
- --source=service
5657
- --provider=webhook
5758
- name: external-dns-webhook-provider
58-
image: ghcr.io/mrueg/external-dns-netcup-webhook:latest
59+
image: ghcr.io/mrueg/external-dns-netcup-webhook:main
5960
args:
6061
- --domain-filter="example.com"
6162
- --netcup-customer-id="YOUR_CUSTOMER_ID"
@@ -77,6 +78,7 @@ spec:
7778

7879
Create a service file called 'nginx.yaml' with the following contents:
7980

81+
[embedmd]:# (example/nginx.yaml)
8082
```yaml
8183
apiVersion: apps/v1
8284
kind: Deployment
@@ -146,3 +148,4 @@ Now that we have verified that external-dns will automatically manage Netcup DNS
146148
```
147149
$ kubectl delete -f nginx.yaml
148150
$ kubectl delete -f externaldns.yaml
151+
```

example/external-dns.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: external-dns
5+
spec:
6+
strategy:
7+
type: Recreate
8+
selector:
9+
matchLabels:
10+
app: external-dns
11+
template:
12+
metadata:
13+
labels:
14+
app: external-dns
15+
spec:
16+
containers:
17+
- name: external-dns
18+
image: registry.k8s.io/external-dns/external-dns:v0.14.0
19+
args:
20+
- --source=ingress
21+
- --source=service
22+
- --provider=webhook
23+
- name: external-dns-webhook-provider
24+
image: ghcr.io/mrueg/external-dns-netcup-webhook:main
25+
args:
26+
- --domain-filter="example.com"
27+
- --netcup-customer-id="YOUR_CUSTOMER_ID"
28+
env:
29+
- name: NETCUP_API_KEY
30+
valueFrom:
31+
secretKeyRef:
32+
key: NETCUP_API_KEY
33+
name: netcup-api-key
34+
- name: NETCUP_API_PASSWORD
35+
valueFrom:
36+
secretKeyRef:
37+
key: NETCUP_API_PASSWORD
38+
name: netcup-api-password
39+

example/nginx.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: nginx
5+
spec:
6+
selector:
7+
matchLabels:
8+
app: nginx
9+
template:
10+
metadata:
11+
labels:
12+
app: nginx
13+
spec:
14+
containers:
15+
- image: nginx
16+
name: nginx
17+
ports:
18+
- containerPort: 80
19+
---
20+
apiVersion: v1
21+
kind: Service
22+
metadata:
23+
name: nginx
24+
annotations:
25+
external-dns.alpha.kubernetes.io/hostname: example.com
26+
spec:
27+
selector:
28+
app: nginx
29+
type: LoadBalancer
30+
ports:
31+
- protocol: TCP
32+
port: 80
33+
targetPort: 80

0 commit comments

Comments
 (0)