This tutorial describes how to configure ExternalDNS to use the F5 Networks VirtualServer Source. It is meant to supplement the other provider-specific setup tutorials.
The F5 Networks VirtualServer CRD is part of this project. See more in-depth info regarding the VirtualServer CRD in the official documentation.
-
Make sure that you have the
k8s-bigip-ctlrinstalled in your cluster. The needed CRDs are bundled within the controller. -
In your Helm
values.yamladd:
sources:
- ...
- f5-virtualserver
- ...or add it in your Deployment if you aren't installing external-dns via Helm:
args:
- --source=f5-virtualserverNote that, in case you're not installing via Helm, you'll need the following in the ClusterRole bound to the service account of external-dns:
- apiGroups:
- cis.f5.com
resources:
- virtualservers
verbs:
- get
- list
- watchThe F5 VirtualServer source creates DNS records based on the following fields:
spec.host: The primary hostname for the virtual serverspec.hostAliases: Additional hostnames that should also resolve to the same targetsspec.virtualServerAddress: The IP address to use as the target (if no target annotation is set)status.vsAddress: The IP address from the status field (if no spec address or target annotation is set)
apiVersion: cis.f5.com/v1
kind: VirtualServer
metadata:
name: example-vs
namespace: default
spec:
host: www.example.com
hostAliases:
- alias1.example.com
- alias2.example.com
virtualServerAddress: 192.168.1.100This configuration will create DNS A records for:
www.example.com→192.168.1.100alias1.example.com→192.168.1.100alias2.example.com→192.168.1.100
The source follows this priority order for determining targets:
- Target annotation:
external-dns.kubernetes.io/target(highest priority) - Spec address:
spec.virtualServerAddress - Status address:
status.vsAddress
If none of these are available, the VirtualServer will be skipped.
You can set a custom TTL using the annotation:
annotations:
external-dns.kubernetes.io/ttl: "300"You can filter VirtualServers using the --annotation-filter flag to only process those with specific annotations.