Skip to main content

Manually Advertise a Service

There may be cases where you want to use the power of the Smart Traffic Director with External DNS to advertise IP addresses that do not reside inside your Kubernetes cluster. With External DNS, this is as easy as creating a small ExternalName service that specifies the required IP address and domain.

All available annotations may be used with the ExternalName service.

Create a Service YAML File

Create a service YAML file using the following template.

apiVersion: v1
kind: Service
metadata:
name: service-name # Required: Service Name
annotations:
external-dns.alpha.kubernetes.io/hostname: subdomain.domain.tld # Required: Domain
spec:
type: ExternalName
externalName: external-ip-address # Required: Desired External IP Address

Verify the Record Creation

As the External DNS container checks for record changes to be created, updated, or deleted every 60 seconds, give a minute or two for your changes to propagate. You can also view the logs of the external-dns pod to see your DNS records change in real time.

After sufficient time has passed, either check the user interface of the DNS provider or use dig, nslookup, or another similar DNS lookup tool to confirm changes are published.