Home

Awesome

external-dns-infoblox-webhook

Infoblox provider based on in-tree provider for ExternalDNS. Supported records:

Record TypeStatus
Asupported
CNAMEsupported
TXTsupported
PTRnot tested

Quick start

To run the provider, you must provide the following Environment Variables:

Infoblox Environment Variables:

Environment VariableDefault valueRequired
INFOBLOX_HOSTlocalhosttrue
INFOBLOX_PORT443true
INFOBLOX_WAPI_USERtrue
INFOBLOX_WAPI_PASSWORDtrue
INFOBLOX_VERSIONtrue
INFOBLOX_SSL_VERIFYtruefalse
INFOBLOX_DRY_RUNfalsefalse
INFOBLOX_VIEWdefaultfalse
INFOBLOX_MAX_RESULTS1500false
INFOBLOX_CREATE_PTRfalsefalse
INFOBLOX_DEFAULT_TTL300false

external-dns-infoblox-webhook Environment Variables:

Environment VariableDefault valueRequired
SERVER_HOST0.0.0.0true
SERVER_PORT8888true
SERVER_READ_TIMEOUTfalse
SERVER_WRITE_TIMEOUTfalse
DOMAIN_FILTERfalse
EXCLUDE_DOMAIN_FILTERfalse
REGEXP_DOMAIN_FILTERfalse
REGEXP_DOMAIN_FILTER_EXCLUSIONfalse
REGEXP_NAME_FILTERfalse

Contribution

All PRs are welcome, but before you create a PR, make sure your changes pass the linters and the apache2 license is injected into the newly added files. The make lint command will do this for you.

Another point is the tests. If you create/change functionality, make sure the tests are running, updated or necessary ones are added. The make test command is used to run the tests.

All commits MUST be SIGNED before merge into main branch.

Running locally

To run provider in a local environment, you must provide all required settings through environment variables. To run locally, set SERVER_HOST to localhost, otherwise leave it at 0.0.0.0. Infoblox Provider is a simple web server with several clearly defined routers:

RouteMethod
/healthzGET
/recordsGET
/recordsPOST
/adjustendpointsPOST

Reading Data

Read data by HTTP GET to /records, see:

curl -H 'Accept: application/external.dns.webhook+json;version=1' localhost:8888/records

If you set DOMAIN_FILTER, DNS will return all records from this domain(s). Because the returned data for a given domain can be large - in some cases tens of thousands of records, it is advisable to use filters to reduce the data to the desired result. Filters are specified via environment variables: DOMAIN_FILTER,EXCLUDE_DOMAIN_FILTER, REGEXP_DOMAIN_FILTER,REGEXP_DOMAIN_FILTER_EXCLUSION,REGEXP_NAME_FILTER.

The following example demonstrates the use of a filter:

# We are looking for all records in these two domains. 
# Unfortunately, they may contain tens of thousands of records.
DOMAIN_FILTER=org.eu.cloud.example.com,org-hq.us.cloud.example.com

# If DOMAIN_FILTER is not enough, you can use regex. Once you use REGEXP_DOMAIN_FILTER, DOMAIN_FILTER will be ignored.
# In following example we restrict zones to *.eu.cloud.example.com or *.org-hq.us.cloud.example.com.
REGEXP_DOMAIN_FILTER=(eu.cloud|org-hq.us).cloud.example.com

# Finally, we filter only those records that have `my-project.org-hq` or `.us.cloud` in the name
REGEXP_NAME_FILTER=(my-project.org-hq|.us.cloud)

Writing Data

Here are the updating rules according to which the data in the DNS server will be updated:

Based on the rules I am providing some examples of data.json creating, changing and deleting records in DNS.

curl -X POST -H 'Accept: application/external.dns.webhook+json;version=1;' -H 'Content-Type: application/external.dns.webhook+json;version=1' -d @data.json localhost:8888/records

Create test.cloud.example.com

{"Create":null,"UpdateOld":null,"UpdateNew":[{"dnsName":"test.cloud.example.com","targets":["1.3.2.1"],"recordType":"A","recordTTL":300}],"Delete":null}

Update test.cloud.example.com (DELETE one record test.cloud.example.com and CREATE two records new-test.cloud.example.com)

{"Create":null,"UpdateOld":[{"dnsName":"test.cloud.example.com","targets":["1.3.2.1"],"recordType":"A","recordTTL":300}],"UpdateNew":[{"dnsName":"new-test.cloud.example.com","targets":["1.2.3.4","4.3.2.1"],"recordType":"A","recordTTL":300}],"Delete":null}

Delete test-new.cloud.example.com

{"Create":null,"UpdateOld":[{"dnsName":"new-test.cloud.example.","targets":["1.2.3.4","4.3.2.1"],"recordType":"A","recordTTL":300}],"UpdateNew":null,"Delete":null}