Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wikiwi/kube-dns-sync
Controller syncing Kubernetes Node IPs to a DNS service
https://github.com/wikiwi/kube-dns-sync
Last synced: about 2 months ago
JSON representation
Controller syncing Kubernetes Node IPs to a DNS service
- Host: GitHub
- URL: https://github.com/wikiwi/kube-dns-sync
- Owner: wikiwi
- License: mit
- Created: 2016-07-21T12:18:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-29T04:32:22.000Z (over 8 years ago)
- Last Synced: 2024-08-04T18:01:11.315Z (5 months ago)
- Language: Go
- Size: 53.7 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kube-dns-sync
`kube-dns-sync` is a Kubernetes Controller that syncs Kubernetes Node IPs to a DNS service.[![Build Status Widget]][Build Status]
[![Coverage Status Widget]][Coverage Status]
[![Code Climate Widget]][Code Climate]
[![MicroBadger Version Widget]][MicroBadger URL]
[![MicroBadger Image Widget]][MicroBadger URL][Build Status]: https://travis-ci.org/wikiwi/kube-dns-sync
[Build Status Widget]: https://travis-ci.org/wikiwi/kube-dns-sync.svg?branch=master
[Coverage Status]: https://coveralls.io/github/wikiwi/kube-dns-sync?branch=master
[Coverage Status Widget]: https://coveralls.io/repos/github/wikiwi/kube-dns-sync/badge.svg?branch=master
[Code Climate]: https://codeclimate.com/github/wikiwi/kube-dns-sync
[Code Climate Widget]: https://codeclimate.com/github/wikiwi/kube-dns-sync/badges/gpa.svg
[MicroBadger URL]: http://microbadger.com/#/images/wikiwi/kube-dns-sync
[MicroBadger Version Widget]: https://images.microbadger.com/badges/version/wikiwi/kube-dns-sync.svg
[MicroBadger Image Widget]: https://images.microbadger.com/badges/image/wikiwi/kube-dns-sync.svg## Use-Case
- You want to avoid using a load balancer or can't use one to expose your Kubernetes Services.
- You want to expose your Kubernetes Services using `NodePort` and need a way to discover the Nodes.
- You need to access your Nodes using a fixed DNS record.## How it works
`kube-dns-sync` watches the Kubernetes API for changes in the Node resources and syncs the IP addresses to the DNS zone. When `--apex-address-type` is set, `kube-dns-sync` will sync the IP addresses of specified type from the Nodes to the A Record of the apex zone (root domain). Setting `--address-types` will create a managed A Record for each specifed type e.g. `internalip.example.com.`, `externalip.example.com.` with the addresses from each Node.## Disadvantages
- `kube-dns-sync` only checks the health of Nodes and is unaware of your application.
- DNS changes are slow to propagate to clients. During this delay your clients might receive DNS records of unhealthy or removed Nodes.## Supported DNS service
`kube-dns-sync` uses the DNS module of Kubernetes Federation and therefore supports the same DNS services. At the time of writing the supported services are 'google-clouddns' and 'aws-route53'.## Authorization
The authorization mechanics are the same as for Kubernetes Federation. A link will be put here as soon as Kubernetes releases an official documentation for its Federation Service.*note:* `google-clouddns` requires the scope `https://www.googleapis.com/auth/ndev.clouddns.readwrite`.
## Example
Adapt and save the manifest below. Create deployment using `kubectl create -f my-deployment.yaml`.apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: kube-dns-sync
spec:
replicas: 1
template:
metadata:
labels:
app: kube-dns-sync
spec:
containers:
- name: kube-dns-sync
image: wikiwi/kube-dns-sync:0.1.0
env:
- name: KDS_ADDRESS_TYPES
value: internalip
- name: KDS_APEX_ADDRESS_TYPE
value: externalip
- name: KDS_ZONE_NAME
value: example.io.
- name: KDS_PROVIDER
value: google-clouddns
- name: KDS_SELECTOR
value: wikiwi.io/dns-sync!=false## Flags and Environment Variables
Usage:
kube-dns-sync [OPTIONS]Application Options:
--dns-provider=[aws-route53|google-clouddns] DNS provider [$KDS_PROVIDER]
--dns-provider-config= Path to config file for configuring DNS provider [$KDS_PROVIDER_CONFIG]
--zone-name= Zone name, like example.com [$KDS_ZONE_NAME]
--sync-interval= Interval for syncing with the DNS Provider (default: 60s) [$KDS_INTERVAL]
--ttl= TTL value of DNS Records (default: 60) [$KDS_TTL]
--address-types= Comma list of address types to sync [externalip|internalip|legacyhostip] [$KDS_ADDRESS_TYPES]
--apex-address-type=[externalip|internalip|legacyhostip] Address type that is synced to the Apex Zone [$KDS_APEX_ADDRESS_TYPE]
--selector= Node selector e.g. 'cloud.google.com/gke-nodepool=default-pool' [$KDS_SELECTOR]
--verbose Turn on verbose logging
-v, --version Show version numberHelp Options:
-h, --help Show this help message## Troubleshooting
- DNS zone is not created by the controller, make sure it exists.
- Make sure you use the correct DNS zone name with a dot at the end.