Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for dns resource group #60

Open
wants to merge 4 commits into
base: spectro-v1beta1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/v1beta1/types_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 12 additions & 4 deletions azure/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
Expand All @@ -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(),
}
Expand All @@ -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(),
}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_image_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spectro/generated/core-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 17 additions & 1 deletion spectro/generated/core-global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,8 @@ spec:
the TCP idle connection.
format: int32
type: integer
ipAllocationMethod:
type: string
name:
type: string
sku:
Expand Down Expand Up @@ -2272,6 +2274,8 @@ spec:
the TCP idle connection.
format: int32
type: integer
ipAllocationMethod:
type: string
name:
type: string
sku:
Expand Down Expand Up @@ -2324,6 +2328,8 @@ spec:
the TCP idle connection.
format: int32
type: integer
ipAllocationMethod:
type: string
name:
type: string
sku:
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand Down