we have several clusters. Right now, we want to upgrade a K8S cluster replacing it for new one.
We handle the deployments with CICD, so, when the new cluster is ready, we will start to move apps to the new cluster running the pipelines. We're facing a problem with DNS.
All the apps in the kubernetes cluster is resolved by a wildcard DNS. Besides, we need to do the migration in multiple steps, so, we can't change the wildcard to the new cluster, because the old cluster is going to host some apps for a while and need to interact between them
Any good solution or alternative to get the migration done smoothly?
And what would be a best practice about DNS to avoid this situation in the future?
Thank you in advance.
You can put in specific DNS records for each hostname as they need to migrate.
Say your wildcard is for *.mycompany.com
...app1.mycompany.com
is getting migratedapp2.mycompany.com
is staying put until the next batch
Add a record for app2.mycompany.com
pointing to the old cluster, and switch the wildcard record to point to the new cluster.
Now app1.mycompany.com
will resolve to the new cluster, but the more specific record for app2.mycompany.com
will trump the wildcard and keep pointing to the old cluster.
When it's time for app2
's DNS cutover, delete the record and the wildcard will take over.