A dirty script to push a DNS record pointing to your dynamic IPv4 IP, using Gandi's LiveDNS service.
Usable as a K8s job.
This is based on this script, with some refinements.
A full rewrite to a proper language is planned.
kubectl create secret generic gandynamic --from-literal="API_KEY=<YOUR_GANDI_APIKEY>"
apiVersion: batch/v1
kind: CronJob
metadata:
name: gandynamic
spec:
schedule: "*/10 * * * *"
jobTemplate:
spec:
ttlSecondsAfterFinished: 600
template:
spec:
containers:
- name: gandynamic
image: ghcr.io/dekonnection/gandynamic:latest
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: gandynamic
env:
- name: API_KEY
valueFrom:
secretKeyRef:
name: gandynamic
key: API_KEY
restartPolicy: OnFailure
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gandynamic
data:
DOMAIN: <your_domain>
SUBDOMAIN: <your_dns_record>
TTL: "600" # Gandi rejects TTLs lower than 300