snowdrop/k8s-infra

Implement playbook/roles that manages GoDaddy DNS records

jacobdotcosta opened this issue · 1 comments

TODO

  • Evaluate if we could use this project to create/delete a DNS entry for a RHOS ocp4 cluster
  • Integrate the playbook/role part of the process to create an ocp4 cluster (or when we delete it)

Subsequent additional tasks

  • Issue a certificate and/or issuer CR to allow Let's encrypt to generate a chained TLS certificate and key needed to let the oc, docker or browser clients to access the servers using HTTPs requests
  • Patch the ocp4 cluster to import the certificate & key as described hereafter

As the API of Godaddy is not too complex - see doc, we could also using curl or similar tool to create/delete/get a DNS record

YOUR_IP_ADDRESS=10.0.215.34
YOUR_DOMAIN_NAME="snowdrop.dev"
YOUR_NAME="console2-openshift-console.apps.ocp"
TYPE="A"

payload="
[{
 \"data\": \"$YOUR_IP_ADDRESS\",
 \"ttl\": 600
}]"

curl -X DELETE -H "Authorization: sso-key ${YOUR_API_KEY}:${YOUR_API_SECRET}" \
     -H "Content-Type: application/json" \
     "https://api.godaddy.com/v1/domains/${YOUR_DOMAIN_NAME}/records/${TYPE}/${YOUR_NAME}"

curl -X PUT -H "Authorization: sso-key ${YOUR_API_KEY}:${YOUR_API_SECRET}" \
     -H "Content-Type: application/json" \
     -d "$payload" \
     "https://api.godaddy.com/v1/domains/${YOUR_DOMAIN_NAME}/records/${TYPE}/${YOUR_NAME}"

curl -X GET -H "Authorization: sso-key ${YOUR_API_KEY}:${YOUR_API_SECRET}" \
     -H "Content-Type: application/json" \
     "https://api.godaddy.com/v1/domains/${YOUR_DOMAIN_NAME}/records/${TYPE}/${YOUR_NAME}"