-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Exoscale as Provider #625
Merged
njuettner
merged 16 commits into
kubernetes-sigs:master
from
FaKod:external-dns-exoscale
Jul 13, 2018
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8003a3f
initial Exoscale Provider
FaKod a487d38
exoscale: rename exo into exoscale
07e7103
implemented dryRun
FaKod 635427f
did not match domains
FaKod 14cefa0
added UpdateNew
FaKod 56e4fe8
added an Exoscale tutorial
FaKod df03cb8
added version tag
FaKod f38c347
Merge branch 'master' into external-dns-exoscale
njuettner 717ee84
Merge branch 'master' into external-dns-exoscale
njuettner 6ed7b8d
exoscale: fix boilerplate header
826d874
Merge pull request #4 from greut/fix-header
FaKod a78b209
using defaultConfig n ow
FaKod 42ff664
fix tests
FaKod 5cf6ce9
better test
FaKod 11df25d
revert commit
FaKod 0fd3a7a
added list nodes
FaKod 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
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# Setting up ExternalDNS for Exoscale | ||
|
||
## Prerequisites | ||
|
||
Exoscale provider support was added via [this PR](https://github.com/kubernetes-incubator/external-dns/pull/625), thus you need to use external-dns v0.5.5. | ||
|
||
The Exoscale provider expects that your Exoscale zones, you wish to add records to, already exists | ||
and are configured correctly. It does not add, remove or configure new zones in anyway. | ||
|
||
To do this pease refer to the [Exoscale DNS documentation](https://community.exoscale.com/documentation/dns/). | ||
|
||
Additionally you will have to provide the Exoscale...: | ||
|
||
* API Key | ||
* API Secret | ||
* API Endpoint | ||
* Elastic IP address, to access the workers | ||
|
||
## Deployment | ||
|
||
Deploying external DNS for Exoscale is actually nearly identical to deploying | ||
it for other providers. This is what a sample `deployment.yaml` looks like: | ||
|
||
```yaml | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: external-dns | ||
spec: | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: external-dns | ||
spec: | ||
# Only use if you're also using RBAC | ||
# serviceAccountName: external-dns | ||
containers: | ||
- name: external-dns | ||
image: registry.opensource.zalan.do/teapot/external-dns:v0.5.5 | ||
args: | ||
- --source=ingress # or service or both | ||
- --provider=exoscale | ||
- --domain-filter={{ my-domain }} | ||
- --policy=sync # if you want DNS entries to get deleted as well | ||
- --txt-owner-id={{ owner-id-for-this-external-dns }} | ||
- --exoscale-endpoint={{ endpoint }} # usually https://api.exoscale.ch/dns | ||
- --exoscale-apikey={{ api-key}} | ||
- --exoscale-apisecret={{ api-secret }} | ||
``` | ||
|
||
## RBAC | ||
|
||
If your cluster is RBAC enabled, you also need to setup the following, before you can run external-dns: | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: external-dns | ||
namespace: default | ||
|
||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRole | ||
metadata: | ||
name: external-dns | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["services"] | ||
verbs: ["get","watch","list"] | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["get","watch","list"] | ||
- apiGroups: ["extensions"] | ||
resources: ["ingresses"] | ||
verbs: ["get","watch","list"] | ||
- apiGroups: [""] | ||
resources: ["nodes"] | ||
verbs: ["list"] | ||
|
||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
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 | ||
``` | ||
|
||
## Testing and Verification | ||
|
||
**Important!**: Remember to change `example.com` with your own domain throughout the following text. | ||
|
||
Spin up a simple nginx HTTP server with the following spec (`kubectl apply -f`): | ||
|
||
```yaml | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: nginx | ||
annotations: | ||
kubernetes.io/ingress.class: nginx | ||
external-dns.alpha.kubernetes.io/target: {{ Elastic-IP-address }} | ||
spec: | ||
rules: | ||
- host: via-ingress.example.com | ||
http: | ||
paths: | ||
- backend: | ||
serviceName: nginx | ||
servicePort: 80 | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nginx | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 80 | ||
selector: | ||
app: nginx | ||
|
||
--- | ||
|
||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- image: nginx | ||
name: nginx | ||
ports: | ||
- containerPort: 80 | ||
``` | ||
|
||
**Important!**: Don't run dig, nslookup or similar immediately (until you've | ||
confirmed the record exists). You'll get hit by [negative DNS caching](https://tools.ietf.org/html/rfc2308), which is hard to flush. | ||
|
||
Wait about 30s-1m (interval for external-dns to kick in), then check Exoscales [portal](https://portal.exoscale.com/dns/example.com)... via-ingress.example.com should appear as a A and TXT record with your Elastic-IP-address. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I wasn't seeing it but you have to add
to run external-dns with RBAC