Skip to content

Commit

Permalink
add doc to manually tag dns
Browse files Browse the repository at this point in the history
Signed-off-by: Ashutosh Kumar <sonasingh46@gmail.com>
  • Loading branch information
sonasingh46 committed Dec 1, 2021
1 parent 08ba489 commit 2979b8c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions azure/services/privatedns/privatedns.go
Expand Up @@ -70,7 +70,9 @@ func (s *Service) Reconcile(ctx context.Context) error {
isManaged = true
}
if !isManaged {
s.Scope.V(2).Info("Skipping reconciliation of unmanaged private DNS zone", "private DNS", zoneSpec.ZoneName)
s.Scope.V(1).Info("Skipping reconciliation of unmanaged private DNS zone", "private DNS", zoneSpec.ZoneName)
s.Scope.V(1).Info("Tag the DNS manually from azure to manage it with capz."+
"Please see https://capz.sigs.k8s.io/topics/custom-dns.html#manage-dns-via-capz-tool", "private DNS", zoneSpec.ZoneName)
return nil
}
// Create the private DNS zone.
Expand Down Expand Up @@ -188,7 +190,7 @@ func (s *Service) Delete(ctx context.Context) error {
}

if !isManaged {
s.Scope.V(2).Info("Skipping private DNS zone deletion for unmanaged private DNS zone", "private DNS", zoneSpec.ZoneName)
s.Scope.V(1).Info("Skipping private DNS zone deletion for unmanaged private DNS zone", "private DNS", zoneSpec.ZoneName)
return nil
}
s.Scope.V(2).Info("deleting private dns zone", "private dns zone", zoneSpec.ZoneName)
Expand Down
15 changes: 15 additions & 0 deletions docs/book/src/topics/custom-dns.md
Expand Up @@ -35,3 +35,18 @@ spec:
resourceGroup: cluster-example

```
# Manage DNS Via CAPZ Tool

Private DNS when created by CAPZ can be managed by CAPZ tool itself automatically. To give the flexibility to have BYO
as well as managed DNS zone, an enhancement is made that causes all the managed zones created in the CAPZ version before
the enhancement changes to be treated as unmanaged. The enhancement is captured in PR
[1791](https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/1791)

To manage the private DNS via CAPZ please tag it manually from azure portal.

Steps to tag:

- Go to azure portal and search for `Private DNS zones`.
- Select the DNS zone that you want to be managed.
- Go to `Tags` section add key as `sigs.k8s.io_cluster-api-provider-azure_cluster_<clustername>`
value as `owned`. (Note: clustername is the name of the cluster that you created)

0 comments on commit 2979b8c

Please sign in to comment.