k8s-infra icon indicating copy to clipboard operation
k8s-infra copied to clipboard

Implement playbook/roles that manages GoDaddy DNS records

Open jacobdotcosta opened this issue 2 years ago • 1 comments

TODO

  • [x] Evaluate if we could use this project to create/delete a DNS entry for a RHOS ocp4 cluster
  • [x] 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

jacobdotcosta avatar May 31 '23 08:05 jacobdotcosta

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}"

cmoulliard avatar Jun 06 '23 14:06 cmoulliard