diff --git a/api/v1beta1/types_class.go b/api/v1beta1/types_class.go index 26675a02d74..bd285c9fc52 100644 --- a/api/v1beta1/types_class.go +++ b/api/v1beta1/types_class.go @@ -57,6 +57,9 @@ type NetworkClassSpec struct { // PrivateDNSZoneName defines the zone name for the Azure Private DNS. // +optional PrivateDNSZoneName string `json:"privateDNSZoneName,omitempty"` + + // +optional + PrivateDNSZoneResourceGroup string `json:"privateDNSZoneResourceGroup,omitempty"` } // VnetClassSpec defines the VnetSpec properties that may be shared across several Azure clusters. diff --git a/azure/scope/cluster.go b/azure/scope/cluster.go index 3ba3d131bc7..6ac43a7e957 100644 --- a/azure/scope/cluster.go +++ b/azure/scope/cluster.go @@ -409,7 +409,7 @@ func (s *ClusterScope) PrivateDNSSpec() (zoneSpec azure.ResourceSpecGetter, link if s.IsAPIServerPrivate() { zone := privatedns.ZoneSpec{ Name: s.GetPrivateDNSZoneName(), - ResourceGroup: s.ResourceGroup(), + ResourceGroup: s.PrivateDNSZoneResourceGroup(), ClusterName: s.ClusterName(), AdditionalTags: s.AdditionalTags(), } @@ -421,7 +421,7 @@ func (s *ClusterScope) PrivateDNSSpec() (zoneSpec azure.ResourceSpecGetter, link SubscriptionID: s.SubscriptionID(), VNetResourceGroup: s.Vnet().ResourceGroup, VNetName: s.Vnet().Name, - ResourceGroup: s.ResourceGroup(), + ResourceGroup: s.PrivateDNSZoneResourceGroup(), ClusterName: s.ClusterName(), AdditionalTags: s.AdditionalTags(), } @@ -432,7 +432,7 @@ func (s *ClusterScope) PrivateDNSSpec() (zoneSpec azure.ResourceSpecGetter, link SubscriptionID: s.SubscriptionID(), VNetResourceGroup: peering.ResourceGroup, VNetName: peering.RemoteVnetName, - ResourceGroup: s.ResourceGroup(), + ResourceGroup: s.PrivateDNSZoneResourceGroup(), ClusterName: s.ClusterName(), AdditionalTags: s.AdditionalTags(), } @@ -445,7 +445,7 @@ func (s *ClusterScope) PrivateDNSSpec() (zoneSpec azure.ResourceSpecGetter, link IP: s.APIServerPrivateIP(), }, ZoneName: s.GetPrivateDNSZoneName(), - ResourceGroup: s.ResourceGroup(), + ResourceGroup: s.PrivateDNSZoneResourceGroup(), } return zone, links, records @@ -671,6 +671,14 @@ func (s *ClusterScope) ResourceGroup() string { return s.AzureCluster.Spec.ResourceGroup } +// ResourceGroup returns the cluster resource group. +func (s *ClusterScope) PrivateDNSZoneResourceGroup() string { + if len(s.AzureCluster.Spec.NetworkSpec.PrivateDNSZoneResourceGroup) > 0 { + return s.AzureCluster.Spec.NetworkSpec.PrivateDNSZoneResourceGroup + } + return s.AzureCluster.Spec.ResourceGroup +} + // ClusterName returns the cluster name. func (s *ClusterScope) ClusterName() string { return s.Cluster.Name diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_azureclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_azureclusters.yaml index e56393c5d16..997282d5760 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_azureclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_azureclusters.yaml @@ -1805,6 +1805,8 @@ spec: description: PrivateDNSZoneName defines the zone name for the Azure Private DNS. type: string + privateDNSZoneResourceGroup: + type: string subnets: description: Subnets is the configuration for the control-plane subnet and the node subnet. diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_azureclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_azureclustertemplates.yaml index 59e6c1da99a..e2a8682a8cf 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_azureclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_azureclustertemplates.yaml @@ -389,6 +389,8 @@ spec: description: PrivateDNSZoneName defines the zone name for the Azure Private DNS. type: string + privateDNSZoneResourceGroup: + type: string subnets: description: Subnets is the configuration for the control-plane subnet and the node subnet. diff --git a/config/default/manager_image_patch.yaml b/config/default/manager_image_patch.yaml index 51d5d8453d1..599b3e58176 100644 --- a/config/default/manager_image_patch.yaml +++ b/config/default/manager_image_patch.yaml @@ -8,5 +8,5 @@ spec: spec: containers: # Change the value of image field below to your controller image URL - - image: gcr.io/spectro-dev-public/snehal/cluster-api-azure/cluster-api-azure-controller:spectro-v1.3.2-20221125 + - image: gcr.io/spectro-dev-public/snehal/cluster-api-azure/cluster-api-azure-controller:spectro-v1.3.2-20221216 name: manager diff --git a/spectro/generated/core-base.yaml b/spectro/generated/core-base.yaml index ab8d2dee686..af6b1981a63 100644 --- a/spectro/generated/core-base.yaml +++ b/spectro/generated/core-base.yaml @@ -61,7 +61,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: gcr.io/spectro-dev-public/snehal/cluster-api-azure/cluster-api-azure-controller:spectro-v1.3.2-20221102 + image: gcr.io/spectro-dev-public/snehal/cluster-api-azure/cluster-api-azure-controller:spectro-v1.3.2-20221215 imagePullPolicy: Always name: manager terminationGracePeriodSeconds: 10 diff --git a/spectro/generated/core-global.yaml b/spectro/generated/core-global.yaml index f5215b48c86..574d85e81cf 100644 --- a/spectro/generated/core-global.yaml +++ b/spectro/generated/core-global.yaml @@ -2218,6 +2218,8 @@ spec: the TCP idle connection. format: int32 type: integer + ipAllocationMethod: + type: string name: type: string sku: @@ -2272,6 +2274,8 @@ spec: the TCP idle connection. format: int32 type: integer + ipAllocationMethod: + type: string name: type: string sku: @@ -2324,6 +2328,8 @@ spec: the TCP idle connection. format: int32 type: integer + ipAllocationMethod: + type: string name: type: string sku: @@ -2337,6 +2343,8 @@ spec: description: PrivateDNSZoneName defines the zone name for the Azure Private DNS. type: string + privateDNSZoneResourceGroup: + type: string subnets: description: Subnets is the configuration for the control-plane subnet and the node subnet. @@ -3033,6 +3041,8 @@ spec: for the TCP idle connection. format: int32 type: integer + ipAllocationMethod: + type: string sku: description: SKU defines an Azure load balancer SKU. type: string @@ -3052,6 +3062,8 @@ spec: for the TCP idle connection. format: int32 type: integer + ipAllocationMethod: + type: string sku: description: SKU defines an Azure load balancer SKU. type: string @@ -3069,6 +3081,8 @@ spec: for the TCP idle connection. format: int32 type: integer + ipAllocationMethod: + type: string sku: description: SKU defines an Azure load balancer SKU. type: string @@ -3081,6 +3095,8 @@ spec: description: PrivateDNSZoneName defines the zone name for the Azure Private DNS. type: string + privateDNSZoneResourceGroup: + type: string subnets: description: Subnets is the configuration for the control-plane subnet and the node subnet. @@ -10656,7 +10672,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: gcr.io/spectro-dev-public/snehal/cluster-api-azure/cluster-api-azure-controller:spectro-v1.3.2-20221102 + image: gcr.io/spectro-dev-public/snehal/cluster-api-azure/cluster-api-azure-controller:spectro-v1.3.2-20221215 imagePullPolicy: Always livenessProbe: httpGet: