Skip to content

Manage DNS records using Kubernetes CRD's #4

@edenreich

Description

@edenreich

Summary

Write some kind of kubernetes controller that reconciles the changes between the kubernetes cluster and cloudflare.

AC

  • There is a custom resource definition available in a cluster of kind DNSRecord with attributes like type, name, content, ttl, proxied
  • There is a custom resource definition available in a cluster of kind IPChangeDetector that has a targetRef.name for DNSRecord
  • Changes are reconciled with Cloudflare

Usage

I want to be able to create multiple DNS records as an example:

---
apiVersion: crds.cloudflare.com/v1alpha1
kind: DNSRecord
metadata:
  name: www.domain1.de
spec:
  zone: domain1.de
  record:
    type: "A"
    name: "www"
    content: "1.1.1.1"
    proxied: true
    ttl: 3600
---
apiVersion: crds.cloudflare.com/v1alpha1
kind: DNSRecord
metadata:
  name: www.domain2.de
spec:
  zone: domain2.de
  record:
    type: "A"
    name: "www"
    content: "8.8.8.8"
    proxied: true
    ttl: 3600
---
apiVersion: crds.cloudflare.com/v1alpha1
kind: IPChangeDetector
metadata:
  name: mydetector
spec:
  targetRef:
    names:
    - www.domain1.de
    - www.domain2.de
    interval: "30s"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions