Prerequisites:
- Create a DNS zone
- Enable secure dynamic updates for the zone
- Enable Zone Transfers to all servers
Set the context of kubectl to the relevant cluster. For example:
kubectl config use-context tkg-wld-01-admin@tkg-wld-01Retrieve the version of the ExternalDNS package.
PKG_NAME=external-dns.tanzu.vmware.com
PKG_VERSIONS=($(tanzu package available list "$PKG_NAME" -n tanzu-package-repo-global -o json | jq -r ".[].version" | sort -t "." -k1,1n -k2,2n -k3,3n))
PKG_VERSION=${PKG_VERSIONS[-1]}
echo "$PKG_VERSION"For example: 0.10.0+vmware.1-tkg.1
Install the package.
tanzu package install external-dns \
--package-name "$PKG_NAME" \
--version "$PKG_VERSION" \
--values-file external-dns-data-values.yaml \
--namespace tkg-packages \
--create-namespaceOutput:
| Installing package 'external-dns.tanzu.vmware.com'
| Getting namespace 'tkg-packages'
| Getting package metadata for 'external-dns.tanzu.vmware.com'
| Creating service account 'external-dns-tkg-packages-sa'
| Creating cluster admin role 'external-dns-tkg-packages-cluster-role'
| Creating cluster role binding 'external-dns-tkg-packages-cluster-rolebinding'
| Creating secret 'external-dns-tkg-packages-values'
| Creating package resource
| Package install status: Reconciling
Added installed package 'external-dns' in namespace 'tkg-packages'
If you are using RFC3645 (GSS-TSIG) and need to add Kerberos configuration to your External DNS deployment:
-
Create a secret using the Kerberos overlay file.
kubectl create secret generic external-dns-kerberos-overlay -n tkg-packages \ --from-file=overlay-external-dns-kerberos.yaml \ -o yaml --dry-run=client | kubectl apply -f - -
Annotate the
external-dnspackage using the overlay.kubectl annotate packageinstalls external-dns \ ext.packaging.carvel.dev/ytt-paths-from-secret-name.0=external-dns-kerberos-overlay \ -n tkg-packages
Confirm that the external-dns package has been installed.
tanzu package installed list -n tkg-packagesOutput:
| Retrieving installed packages...
NAME PACKAGE-NAME PACKAGE-VERSION STATUS
cert-manager cert-manager.tanzu.vmware.com 1.1.0+vmware.1-tkg.2 Reconcile succeeded
contour contour.tanzu.vmware.com 1.17.1+vmware.1-tkg.1 Reconcile succeeded
external-dns external-dns.tanzu.vmware.com 0.8.0+vmware.1-tkg.1 Reconcile succeeded
Confirm that the external-dns pod is running.
kubectl get pods -n tanzu-system-service-discoveryOutput:
NAME READY STATUS RESTARTS AGE
external-dns-7ff78744d8-qj26p 1/1 Running 0 2m35s
You can also view the External DNS logs.
kubectl logs $(kubectl get pod -n tanzu-system-service-discovery -o name) -n tanzu-system-service-discoveryFor example:
time="2021-11-29T12:22:36Z" level=info msg="Instantiating new Kubernetes client"
time="2021-11-29T12:22:36Z" level=info msg="Using inCluster-config based on serviceaccount-token"
time="2021-11-29T12:22:36Z" level=info msg="Created Kubernetes client https://100.64.0.1:443"
time="2021-11-29T12:22:38Z" level=info msg="Created Dynamic Kubernetes client https://100.64.0.1:443"
time="2021-11-29T12:22:39Z" level=info msg="Configured RFC2136 with zone 'terasky.demo.' and nameserver 'demo-dc-01.terasky.demo:53'"
Reference: