This is a little whois thingy I made to track my domain name expirations in datadog.
My domains are hosted with Google Cloud DNS so it expects GOOGLE_APPLICATION_CREDENTIALS
to be /path/to/service-account.json
to fetch the managed domains.
It also expects DATADOG_URL
to be set in ENV
Ref: https://cloud.google.com/compute/docs/access/service-accounts to learn about service accounts
Cron support will be dropped as soon as kubernetes cronjobs leave alpha on GKE. See kubernetes/enhancements#19 for details
Edit crontab
with the GCP or script you want to run
@kelseyhightower has a great tutorial for service accounts: https://github.com/kelseyhightower/gke-service-accounts-tutorial
# exported variable
export DATADOG_URL=datadog.kube-public.svc.cluster.local:8125
./go-check-dns -project kubesec
# runtime variable
DATADOG_URL=127.0.0.1:8125 ./go-check-dns -project kubesec
# or use make for 127.0.0.1:8125 and specify a runtime gcp project
PROJECT=kubesec make run
Thanks to https://github.com/muchlearning/kubernetes-cron for cronspiration