Skip to content

Commit

Permalink
Merge pull request #4045 from pluralsh/standard-sku-tier
Browse files Browse the repository at this point in the history
Replace Paid SKU tier with Standard
  • Loading branch information
k8s-ci-robot authored Sep 28, 2023
2 parents ff21c16 + 74251b1 commit c4d959b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion api/v1beta1/azuremanagedcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,17 @@ type AddonProfile struct {
}

// AzureManagedControlPlaneSkuTier - Tier of a managed cluster SKU.
// +kubebuilder:validation:Enum=Free;Paid
// +kubebuilder:validation:Enum=Free;Paid;Standard
type AzureManagedControlPlaneSkuTier string

const (
// FreeManagedControlPlaneTier is the free tier of AKS without corresponding SLAs.
FreeManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Free"
// PaidManagedControlPlaneTier is the paid tier of AKS with corresponding SLAs.
// Deprecated. It has been replaced with StandardManagedControlPlaneTier.
PaidManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Paid"
// StandardManagedControlPlaneTier is the standard tier of AKS with corresponding SLAs.
StandardManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Standard"
)

// AKSSku - AKS SKU.
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/azuremanagedcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ func (mw *azureManagedControlPlaneWebhook) Default(ctx context.Context, obj runt
ctrl.Log.WithName("AzureManagedControlPlaneWebHookLogger").Error(err, "setDefaultSSHPublicKey failed")
}

// PaidManagedControlPlaneTier has been replaced with StandardManagedControlPlaneTier since v2023-02-01.
if m.Spec.SKU != nil && m.Spec.SKU.Tier == PaidManagedControlPlaneTier {
m.Spec.SKU.Tier = StandardManagedControlPlaneTier
ctrl.Log.WithName("AzureManagedControlPlaneWebHookLogger").Info("Paid SKU tier is deprecated and has been replaced by Standard")
}

m.setDefaultNodeResourceGroupName()
m.setDefaultVirtualNetwork()
m.setDefaultSubnet()
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/azuremanagedcontrolplane_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestDefaultingWebhook(t *testing.T) {
g.Expect(amcp.Spec.NodeResourceGroupName).To(Equal("fooNodeRg"))
g.Expect(amcp.Spec.VirtualNetwork.Name).To(Equal("fooVnetName"))
g.Expect(amcp.Spec.VirtualNetwork.Subnet.Name).To(Equal("fooSubnetName"))
g.Expect(amcp.Spec.SKU.Tier).To(Equal(PaidManagedControlPlaneTier))
g.Expect(amcp.Spec.SKU.Tier).To(Equal(StandardManagedControlPlaneTier))
g.Expect(*amcp.Spec.OIDCIssuerProfile.Enabled).To(BeTrue())

t.Logf("Testing amcp defaulting webhook with overlay")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ spec:
enum:
- Free
- Paid
- Standard
type: string
required:
- tier
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/topics/managedcluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ spec:
networkPolicy: azure # or calico
networkPlugin: azure # or kubenet
sku:
tier: Free # or Paid
tier: Free # or Standard
addonProfiles:
- name: azureKeyvaultSecretsProvider
enabled: true
Expand Down

0 comments on commit c4d959b

Please sign in to comment.