Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions docs/examples/echo_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ In this walkthrough, you'll

## Setup external-DNS to manage DNS automatically

1. Ensure your nodes (on which External DNS runs) have the correct IAM permission required for external-dns. See https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/aws.md#iam-permissions.
1. Ensure your nodes (on which External DNS runs) have the correct IAM permission required for external-dns. See https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#iam-permissions.

1. Download external-dns to manage Route 53.
1. Download the sample external-dns manifest

```bash
wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/examples/external-dns.yaml
wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/examples/external-dns.yaml
```

1. Edit the `--domain-filter` flag to include your hosted zone(s)
Expand All @@ -245,6 +245,17 @@ In this walkthrough, you'll
kubectl apply -f external-dns.yaml
```

1. Annotate the ingress with the external-dns specific configuration

```yaml
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing

# external-dns specific configuration for creating route53 record-set
external-dns.alpha.kubernetes.io/hostname: my-app.test-dns.com # give your domain name here
```

1. Verify the DNS has propagated

```bash
Expand Down
27 changes: 13 additions & 14 deletions docs/examples/external-dns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,29 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: external-dns
labels:
app.kubernetes.io/name: external-dns
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: external-dns
labels:
app.kubernetes.io/name: external-dns
rules:
- apiGroups: [""]
resources: ["services"]
resources: ["services", "endpoints", "pods", "nodes"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get","watch","list"]
- apiGroups: ["extensions"]
- apiGroups: ["extensions", "networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list"]
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get","watch","list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: external-dns-viewer
labels:
app.kubernetes.io/name: external-dns
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -41,23 +38,25 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: external-dns
labels:
app.kubernetes.io/name: external-dns
spec:
selector:
matchLabels:
app: external-dns
app.kubernetes.io/name: external-dns
strategy:
type: Recreate
template:
metadata:
labels:
app: external-dns
app.kubernetes.io/name: external-dns
spec:
serviceAccountName: external-dns
securityContext:
fsGroup: 65534
containers:
- name: external-dns
image: bitnami/external-dns:0.7.4
image: bitnami/external-dns:0.13.1
# must specify env AWS_REGION in AWS china regions
# env:
# - name: AWS_REGION
Expand Down
20 changes: 15 additions & 5 deletions docs/guide/integrations/external_dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

## Prerequisites
### Role Permissions
Adequate roles and policies must be configured in AWS and available to the node(s) running the external-dns. See https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/aws.md#iam-permissions.
Adequate roles and policies must be configured in AWS and available to the node(s) running the external-dns. See https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#iam-permissions.

## Installation
1. Download sample `external-dns` manifest

```bash
wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/docs/examples/external-dns.yaml
wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/examples/external-dns.yaml
```

2. Edit the `--domain-filter` flag to include your hosted zone(s)
Expand Down Expand Up @@ -47,21 +47,31 @@ Adequate roles and policies must be configured in AWS and available to the node(
```

## Usage
1. To create a record set in the subdomain, from your ingress which has been created by the ingress-controller, simply add the following annotation in the ingress object specification and apply the manifest:
1. To create a record set in the subdomain, from your ingress which has been created by the ingress-controller, add the following annotation in the ingress objectresource:

```yaml
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing

# for creating record-set
# external-dns specific configuration for creating route53 record-set
external-dns.alpha.kubernetes.io/hostname: my-app.test-dns.com # give your domain name here
```

2. Similar entries should appear in the ExternalDNS pod log:
2. A snippet of the external-dns pod log indicating route53 update:

```
time="2019-12-11T10:26:08Z" level=info msg="Desired change: CREATE my-app.test-dns.com A"
time="2019-12-11T10:26:08Z" level=info msg="Desired change: CREATE my-app.test-dns.com TXT"
time="2019-12-11T10:26:08Z" level=info msg="2 record(s) in zone my-app.test-dns.com. were successfully updated"
```

3. External DNS configures `Simple` routing policy for the route53 records. You can configure `Weighted` policy by specifying the weight and the identifier via annotation. `Weighted` policy allows you to split the traffic between multiple load balancers. Here is an example to specify weight and identifier:
```yaml
annotations:
# For creating weighted route53 records
external-dns.alpha.kubernetes.io/hostname: my-app.test-dns.com
external-dns.alpha.kubernetes.io/aws-weight: "100"
external-dns.alpha.kubernetes.io/set-identifier: "3"
```
You can refer to the External DNS documentation for further details [[link](https://kubernetes-sigs.github.io/external-dns/latest/tutorials/aws/#routing-policies)].
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ nav:
- Examples:
- EchoServer: examples/echo_server.md
- gRPCServer: examples/grpc_server.md
- Setup External DNS: guide/integrations/external_dns.md
- RBAC to access OIDC Secret: examples/secrets_access.md


Expand Down