Skip to content
Closed
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
12 changes: 12 additions & 0 deletions api/v1alpha1/trafficmanagerprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,23 @@ type TrafficManagerProfile struct {
// TrafficManagerProfileSpec defines the desired state of TrafficManagerProfile.
// For now, only the "Weighted" traffic routing method is supported.
type TrafficManagerProfileSpec struct {
// BringYourOwn defines the Azure Traffic Manager in your own resource group.
// +required
BringYourOwn *BringYourOwn `json:"bringYourOwn"`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ResourceGroup? The bring your own noun is unnecessary, as there is no not bring your now today.

// The resource ID of the resource group to contain the Azure Traffic Manager resource corresponding to this profile. Use this option if you would like to use this profile to manage the full life cycle of the traffic manager, including creation and deletion. When this profile is created, updated, or deleted, the corresponding traffic manager with the same name will be created, updated, or deleted.

Later, we can add:

// The resource ID of the Azure Traffic Manager resource corresponding to this profile. Use this option if you would like to use this profile to update an existing traffic manager, not creating or deleting it.
ResourceId;

// If none of the above is specified, we will use the default resource group passed in as an env variable.


// The endpoint monitoring settings of the Traffic Manager profile.
// +optional
MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`
}

// BringYourOwn configures the existing Azure resource.
type BringYourOwn struct {
// The Azure Resource Group of the existing resource.
// +required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="resourceGroup is immutable"
ResourceGroup string `json:"resourceGroup"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could add name in the future to support BYO ATM profile.

}

// MonitorConfig defines the endpoint monitoring settings of the Traffic Manager profile.
// https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-monitoring
type MonitorConfig struct {
Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions api/v1beta1/trafficmanagerprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,23 @@ type TrafficManagerProfile struct {
// TrafficManagerProfileSpec defines the desired state of TrafficManagerProfile.
// For now, only the "Weighted" traffic routing method is supported.
type TrafficManagerProfileSpec struct {
// BringYourOwn defines the Azure Traffic Manager in your own resource group.
// +required
BringYourOwn *BringYourOwn `json:"bringYourOwn"`

// The endpoint monitoring settings of the Traffic Manager profile.
// +optional
MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`
}

// BringYourOwn configures the existing Azure resource.
type BringYourOwn struct {
// The Azure Resource Group of the existing resource.
// +required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="resourceGroup is immutable"
ResourceGroup string `json:"resourceGroup"`
}

// MonitorConfig defines the endpoint monitoring settings of the Traffic Manager profile.
// https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-monitoring
type MonitorConfig struct {
Expand Down
20 changes: 20 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ spec:
spec:
description: The desired state of TrafficManagerProfile.
properties:
bringYourOwn:
description: BringYourOwn defines the Azure Traffic Manager in your
own resource group.
properties:
resourceGroup:
description: The Azure Resource Group of the existing resource.
type: string
x-kubernetes-validations:
- message: resourceGroup is immutable
rule: self == oldSelf
required:
- resourceGroup
type: object
monitorConfig:
description: The endpoint monitoring settings of the Traffic Manager
profile.
Expand Down Expand Up @@ -111,6 +124,8 @@ spec:
minimum: 0
type: integer
type: object
required:
- bringYourOwn
type: object
status:
description: The observed status of TrafficManagerProfile.
Expand Down Expand Up @@ -235,6 +250,19 @@ spec:
spec:
description: The desired state of TrafficManagerProfile.
properties:
bringYourOwn:
description: BringYourOwn defines the Azure Traffic Manager in your
own resource group.
properties:
resourceGroup:
description: The Azure Resource Group of the existing resource.
type: string
x-kubernetes-validations:
- message: resourceGroup is immutable
rule: self == oldSelf
required:
- resourceGroup
type: object
monitorConfig:
description: The endpoint monitoring settings of the Traffic Manager
profile.
Expand Down Expand Up @@ -291,6 +319,8 @@ spec:
minimum: 0
type: integer
type: object
required:
- bringYourOwn
type: object
status:
description: The observed status of TrafficManagerProfile.
Expand Down
Loading