Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

chore: deprecate support for creating new 1.16 clusters #4256

Merged
merged 3 commits into from
Feb 11, 2021

Conversation

jackfrancis
Copy link
Member

Reason for Change:

This PR removes support for creating new v1.16.n clusters. In addition, lots of UT TLC to make the next version deprecation easier!

Issue Fixed:

Credit Where Due:

Does this change contain code from or inspired by another project?

  • No
  • Yes

If "Yes," did you notify that project's maintainers and provide attribution?

  • No
  • Yes

Requirements:

Notes:

@codecov
Copy link

codecov bot commented Feb 11, 2021

Codecov Report

Merging #4256 (fc0eaf6) into master (91d1e11) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4256      +/-   ##
==========================================
- Coverage   72.08%   72.07%   -0.02%     
==========================================
  Files         141      141              
  Lines       21715    21676      -39     
==========================================
- Hits        15653    15622      -31     
+ Misses       5107     5105       -2     
+ Partials      955      949       -6     
Impacted Files Coverage Δ
pkg/api/common/versions.go 96.37% <ø> (ø)
pkg/api/vlabs/validate.go 81.35% <ø> (+0.44%) ⬆️
pkg/api/defaults-apiserver.go 100.00% <100.00%> (ø)
pkg/api/defaults-cloud-controller-manager.go 92.85% <100.00%> (-0.25%) ⬇️
pkg/api/mocks.go 100.00% <100.00%> (ø)
cmd/rotate_certs.go 11.03% <0.00%> (-0.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91d1e11...fc0eaf6. Read the comment docs.

@@ -97,11 +97,7 @@ func (cs *ContainerService) setAPIServerConfig() {

// RBAC configuration
if to.Bool(o.KubernetesConfig.EnableRbac) {
if common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.7.0") {
Copy link
Member Author

Choose a reason for hiding this comment

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

Getting rid of these unnecessary version checks

@@ -113,12 +109,6 @@ func (cs *ContainerService) setAPIServerConfig() {
admissionControlKey, admissionControlValues := getDefaultAdmissionControls(cs)
defaultAPIServerConfig[admissionControlKey] = admissionControlValues

// Enable VolumeSnapshotDataSource feature gate for Azure Disk CSI Driver
// which is disabled from 1.13 to 1.16 by default
if !common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.17.0") {
Copy link
Member Author

Choose a reason for hiding this comment

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

ditto (we're always >= 1.17.0 starting with this PR)

@@ -261,16 +261,6 @@ func TestAPIServerConfigEnableRbac(t *testing.T) {
a["--authorization-mode"])
}

// Test EnableRbac = true with 1.6 cluster
Copy link
Member Author

Choose a reason for hiding this comment

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

these tests are no longer relevant

@@ -495,27 +475,17 @@ func TestAPIServerCosmosEtcd(t *testing.T) {
}

func TestAPIServerFeatureGates(t *testing.T) {
// Test 1.13 <= k8s <= 1.16
Copy link
Member Author

Choose a reason for hiding this comment

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

these tests are no longer relevant

@@ -32,11 +30,8 @@ func (cs *ContainerService) setCloudControllerManagerConfig() {
"--v": "2",
}

// Add new arguments for Azure cloud-controller-manager component.
Copy link
Member Author

Choose a reason for hiding this comment

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

no longer relevant

cs := CreateMockContainerService("testcluster", k8sVersion, 3, 2, false)
cs.setCloudControllerManagerConfig()
cm := cs.Properties.OrchestratorProfile.KubernetesConfig.CloudControllerManagerConfig
if cm["--controllers"] != "*,-cloud-node" {
t.Fatalf("got unexpected '--controllers' Cloud Controller Manager config value for Kubernetes %s: %s",
k8sVersion, cm["--controllers"])
}

k8sVersion = "1.15.4"
Copy link
Member Author

Choose a reason for hiding this comment

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

no longer a relevant test

@@ -3161,15 +3161,8 @@ func TestEnableAggregatedAPIs(t *testing.T) {
}

func TestCloudControllerManagerEnabled(t *testing.T) {
// test that 1.16 defaults to false
Copy link
Member Author

Choose a reason for hiding this comment

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

this test is no longer relevant

@@ -53,7 +53,11 @@ func CreateMockContainerService(containerServiceName, orchestratorVersion string

cs.Properties.OrchestratorProfile = &OrchestratorProfile{}
cs.Properties.OrchestratorProfile.OrchestratorType = Kubernetes
cs.Properties.OrchestratorProfile.OrchestratorVersion = orchestratorVersion
if orchestratorVersion == "" {
Copy link
Member Author

Choose a reason for hiding this comment

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

This addition of giving significance to "" means that we can invoke this mock func without passing an explicit version, and interpret that as "just make me a mock cluster config with the current default version". This way as the set of supported versions evolves over time we don't have to keep manually updating a bunch of UT.

@@ -229,10 +229,6 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
if err != nil {
return err
}
minVersion, err := semver.Make("1.7.0")
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't need to validate against >= 1.7.0 anymore

@@ -254,30 +246,11 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
}

if to.Bool(o.KubernetesConfig.EnableEncryptionWithExternalKms) {
minVersion, err := semver.Make("1.10.0")
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't need to validate against >= 1.10.0 anymore

if to.Bool(a.OrchestratorProfile.KubernetesConfig.UseManagedIdentity) && a.OrchestratorProfile.KubernetesConfig.UserAssignedID == "" {
log.Warnf("Clusters with enableEncryptionWithExternalKms=true and system-assigned identity are not upgradable! You will not be able to upgrade your cluster using `aks-engine upgrade`")
}
}

if o.KubernetesConfig.EnableRbac != nil && !o.KubernetesConfig.IsRBACEnabled() {
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't need to validate against >= 1.15.0 anymore

@@ -295,14 +268,6 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
}

if o.KubernetesConfig.LoadBalancerSku == StandardLoadBalancerSku {
minVersion, err := semver.Make("1.11.0")
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't need to validate against >= 1.11.0 anymore

@@ -727,14 +687,6 @@ func (a *Properties) validateAddons(isUpdate bool) error {
}
}
}
case "nvidia-device-plugin":
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't need to validate against >= 1.10.0 anymore

@@ -801,14 +753,6 @@ func (a *Properties) validateAddons(isUpdate bool) error {
} else {
return errors.Errorf("%s addon is deprecated for new clusters", common.FlannelAddonName)
}
case "azure-policy":
Copy link
Member Author

Choose a reason for hiding this comment

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

we don't need to validate against >= 1.14.0 anymore

@@ -92,35 +92,11 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
},
expectedError: "enableAggregatedAPIs requires the enableRbac feature as a prerequisite",
},
"should error when KubernetesConfig has enableRBAC disabled for >= 1.15": {
Copy link
Member Author

Choose a reason for hiding this comment

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

got rid of a bunch of obsolete version-specific UT

setupValidVersions(map[string]bool{
"1.10.13": true,
Copy link
Member Author

Choose a reason for hiding this comment

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

strictly speaking this change wasn't necessary (it didn't traverse the versions allow list flow), but (IMO) it's good practice not to pin to a static version that eventually doesn't make sense (in this case 1.10.13 hasn't made sense for a long time)

@@ -6,7 +6,6 @@
},
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorRelease": "1.20",
Copy link
Member Author

Choose a reason for hiding this comment

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

@aramase is it important to include this 1.20 config here (for example, because this dualstack example doesn't work on versions older than 1.20) ?

Copy link
Member

Choose a reason for hiding this comment

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

The dual-stack configurations should work for 1.17+. But we want to set to 1.20 because that's the recommended version for dual-stack.

Copy link
Member Author

Choose a reason for hiding this comment

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

added back, thanks for clarifying!

@@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.17",
Copy link
Member Author

Choose a reason for hiding this comment

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

got rid of unnecessary version declarations in these configs so we don't have to be annoyed by them in the future

@@ -15,9 +15,6 @@ Here is an [example of a Kubernetes cluster with Availability Zones support](../
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
Copy link
Member Author

Choose a reason for hiding this comment

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

if I observed documentation referencing an older version I got rid of that

@@ -1,38 +0,0 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

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

these are no longer valid example api models at all, so cleaning them up while I'm here

@@ -668,53 +671,63 @@ func Test_IsSupportedKubernetesVersion(t *testing.T) {
}

func Test_IsValidMinVersion(t *testing.T) {
orchestratorRelease := "1.16"
defaultVersion := RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false)
Copy link
Member Author

Choose a reason for hiding this comment

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

these new foo allow us to UT the IsValidMinVersion helper func in a resilient way doesn't depend upon a particular version being supported or unsupported

@@ -263,8 +263,8 @@ var AllKubernetesSupportedVersionsAzureStack = map[string]bool{
"1.16.10": false,
"1.16.11": false,
"1.16.13": false,
"1.16.14": true,
"1.16.15": true,
"1.16.14": false,
Copy link
Member

Choose a reason for hiding this comment

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

map AllKubernetesWindowsSupportedVersionsAzureStack (a few lines below) also needs to be updated.

@jadarsie
Copy link
Member

/lgtm

@acs-bot
Copy link

acs-bot commented Feb 11, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis, jadarsie

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [jackfrancis,jadarsie]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jackfrancis jackfrancis merged commit 6a8a5af into Azure:master Feb 11, 2021
@jackfrancis jackfrancis deleted the deprecate-1.16 branch February 11, 2021 18:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants