Skip to content

zbblanton/cloudflare_dynamic_dns_controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare Dynamic DNS Kubernetes Controller

Description

A small kubernetes controller that will create Cloudflare DNS records and watch for your dynamic IP address to change and update Cloudflare with the new IP.

Deploy the controller

kubectl create namespace cloudflare-dynamic-dns-controller
kubectl create secret -n cloudflare-dynamic-dns-controller generic cloudflare --from-literal=email=INSERT-EMAIL --from-literal=token=INSERT-TOKEN --from-literal=zone=INSERT-ZONE-ID
kubectl apply -n cloudflare-dynamic-dns-controller -f deploy.yml

Creating a Cloudflare record

To use the controller add the annotations to either a service or an ingress resource. For example:

---
apiVersion: v1
kind: Service
metadata:
  name: "example-website"
  annotations:
    cloudflare-dynamic-dns.alpha.kubernetes.io/hostname: "hello.example.com"
    cloudflare-dynamic-dns.alpha.kubernetes.io/proxied: "true"
spec:
  type: NodePort
  selector:
    app: example-website
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80

Annotations

Currently there are only 2 supported annotations:

Hostname

The name of the record. Note that this must be the full domain name including the zone. For example you must use hello.example.com instead of just hello

cloudflare-dynamic-dns.alpha.kubernetes.io/hostname: "hello.example.com"

Proxied

Whether to use the Cloudflare proxy to take advantage of all the benefits of Cloudflare. This is recommended becuase it will hide your public IP.

cloudflare-dynamic-dns.alpha.kubernetes.io/proxied: "true"

About

Kubernetes Controller for Cloudflare Dynamic DNS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages