-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to publish public WAN IP to DNS provider #1394
Comments
Just went to see if this is possible, would be really nice to have this ability. We are using bare metal k8s clusters and can't use external-dns for this, even just an annotation that we could specify the IP To use somewhere. |
Actually just pieced it together, there is already an annotation you can use
@onedr0p what i'm doing is using an external service to provide ddns for a single A record, then setting the target to that A record which creates a CNAME
|
@keslerm that's great! However, since I don't have a static IP address it's more of an issue to have my home IP address automatically pushed to an external DNS provider. |
@onedr0p yeah i don't have a static ip either, i use my router to do dynamic dns to the single a record |
Interesting, I am using a USG 4 Pro and I don't have my provider (CloudFlare) listed there :/ heh maybe one day. Edit, there appears to be a hacky way to do this with the USG but I am not sure about doing it :) https://christian-gmeiner.info/2019-07-13-cloudflare-ddns-usg/ |
You've already got kubernetes running, can always just deploy a software solution that does the same thing - don't have to use the router. |
I'm stuck on bare metal with the same problem. My Nginx Ingress can only publish internal IPs to ingresses and external-dns is blindly catching them. But they go nowhere outside the local network. |
@keslerm I am a little lost between the target and hostname annotations. In your setup, do you have |
@onedr0p i have my router updating the record Then in all the ingresses I set the target as the cname. external-dns sets the record for This way all the hostnames for my ingresses will resolve to the single cname that the dynamic dns script keeps up to date, i don't have to hard code any IP addresses. If my IP ever changes, the cname will be updated to my new ip and the other records will automatically follow suit without external-dns needing to do anything. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Bump! |
/remove-lifecycle stale |
/kind feature |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Update: /target didn't work for Service but did with Ingress. apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: ip
spec:
schedule: "*/30 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: ip
image: bitnami/kubectl
command:
- /bin/sh
- -c
- |
cat << EOF > /tmp/ingress.yml && kubectl apply -f /tmp/ingress.yml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ip
annotations:
kubernetes.io/ingress.class: nginx
external-dns.alpha.kubernetes.io/hostname: '$IP_HOSTNAME'
external-dns.alpha.kubernetes.io/target: '$(curl --silent ifconfig.me)'
spec:
rules:
- host: '$IP_HOSTNAME'
EOF
env:
- name: IP_HOSTNAME
value: ip.home.jamesmoriarty.xyz
restartPolicy: OnFailure Appears to work:
|
Yeah bump this one. Been trying to get clever to no avail. Shouldn't be too hard for External DNS to discover the WAN IP right? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle stale |
We had a similar requirement, so I created the following PR: #2089 |
I am running a Kubernetes cluster from my house and I don't have a static IP. After deploying
exteral-dns
I found out that it is sending my Load Balancer IP (192.168.x.x) to my DNS providers A record. This is pointless for my use-case. It would be cool if this service could look up my public WAN IP and use that instead.For example I am using this Docker image to do this, but I am missing out on all the neat features
external-dns
provides.The text was updated successfully, but these errors were encountered: