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

Commit

Permalink
add k8s v1.9.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis committed Jan 5, 2018
1 parent e492c75 commit c477bc9
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/k8s-upgrade/v1.8.4.json.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ACSE_POSTDEPLOY=examples/k8s-upgrade/k8s-upgrade.sh
EXPECTED_ORCHESTRATOR_VERSION=1.9.0
EXPECTED_ORCHESTRATOR_VERSION=1.9.1
2 changes: 1 addition & 1 deletion examples/kubernetes.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
"secret": ""
}
}
}
}
28 changes: 28 additions & 0 deletions pkg/acsengine/k8s_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,34 @@ import (

// KubeConfigs represents Docker images used for Kubernetes components based on Kubernetes versions (major.minor.patch)
var KubeConfigs = map[string]map[string]string{
common.KubernetesVersion1Dot9Dot1: {
"hyperkube": "hyperkube-amd64:v1.9.1",
"ccm": "cloud-controller-manager-amd64:v1.9.1",
"dockerEngineVersion": "1.12.*",
DefaultDashboardAddonName: "kubernetes-dashboard-amd64:v1.8.1",
"exechealthz": "exechealthz-amd64:1.2",
"addonresizer": "addon-resizer:1.7",
"heapster": "heapster-amd64:v1.4.2",
"dns": "k8s-dns-kube-dns-amd64:1.14.5",
"addonmanager": "kube-addon-manager-amd64:v6.5",
"dnsmasq": "k8s-dns-dnsmasq-nanny-amd64:1.14.5",
"pause": "pause-amd64:3.0",
DefaultTillerAddonName: DefaultTillerImage,
DefaultReschedulerAddonName: DefaultReschedulerImage,
"windowszip": "v1.9.1-1int.zip",
"nodestatusfreq": DefaultKubernetesNodeStatusUpdateFrequency,
"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
"podeviction": DefaultKubernetesCtrlMgrPodEvictionTimeout,
"routeperiod": DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
"backoffretries": strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
"backoffjitter": strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
"backoffduration": strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
"backoffexponent": strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
"ratelimitqps": strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
"ratelimitbucket": strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
"gchighthreshold": strconv.Itoa(DefaultKubernetesGCHighThreshold),
"gclowthreshold": strconv.Itoa(DefaultKubernetesGCLowThreshold),
},
common.KubernetesVersion1Dot9Dot0: {
"hyperkube": "hyperkube-amd64:v1.9.0",
"ccm": "cloud-controller-manager-amd64:v1.9.0",
Expand Down
4 changes: 4 additions & 0 deletions pkg/api/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const (
)

const (
// KubernetesVersion1Dot9Dot1 is the major.minor.patch string for the 1.9.1 version of kubernetes
KubernetesVersion1Dot9Dot1 string = "1.9.1"
// KubernetesVersion1Dot9Dot0 is the major.minor.patch string for the 1.9.0 version of kubernetes
KubernetesVersion1Dot9Dot0 string = "1.9.0"
// KubernetesVersion1Dot8Dot0 is the major.minor.patch string for the 1.8.0 version of kubernetes
Expand Down Expand Up @@ -125,6 +127,7 @@ var AllKubernetesSupportedVersions = map[string]bool{
KubernetesVersion1Dot8Dot4: true,
KubernetesVersion1Dot8Dot6: true,
KubernetesVersion1Dot9Dot0: true,
KubernetesVersion1Dot9Dot1: true,
}

// GetSupportedKubernetesVersion verifies that a passed-in version string is supported, or returns a default version string if not
Expand Down Expand Up @@ -159,6 +162,7 @@ var AllKubernetesWindowsSupportedVersions = map[string]bool{
KubernetesVersion1Dot8Dot4: true,
KubernetesVersion1Dot8Dot6: true,
KubernetesVersion1Dot9Dot0: true,
KubernetesVersion1Dot9Dot1: false, // TODO turn on when image is uploaded
}

const (
Expand Down
10 changes: 10 additions & 0 deletions pkg/api/common/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ func Test_GetValidPatchVersion(t *testing.T) {
if version != KubernetesVersion1Dot8Dot6 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot8Dot6)
}

version = GetValidPatchVersion(Kubernetes, "1.9.1")
if version != KubernetesVersion1Dot9Dot1 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot9Dot1)
}
}

func Test_RationalizeReleaseAndVersion(t *testing.T) {
Expand All @@ -35,6 +40,11 @@ func Test_RationalizeReleaseAndVersion(t *testing.T) {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot6Dot13)
}

version = RationalizeReleaseAndVersion(Kubernetes, "1.9", "")
if version != KubernetesVersion1Dot9Dot1 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot9Dot1)
}

version = RationalizeReleaseAndVersion(Kubernetes, "", "1.6.11")
if version != KubernetesVersion1Dot6Dot11 {
t.Errorf("It is not Kubernetes version %s", KubernetesVersion1Dot6Dot11)
Expand Down
12 changes: 6 additions & 6 deletions pkg/api/orchestrators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ func TestOrchestratorUpgradeInfo(t *testing.T) {
}
orch, e = GetOrchestratorVersionProfile(csOrch)
Expect(e).To(BeNil())
// 1.8.6, 1.9.0
Expect(len(orch.Upgrades)).To(Equal(2))
// 1.8.6, 1.9.0, 1.9.1
Expect(len(orch.Upgrades)).To(Equal(3))

// 1.9.0 is not upgradable
// 1.9.1 is not upgradable
csOrch = &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: "1.9.0",
OrchestratorVersion: "1.9.1",
}
orch, e = GetOrchestratorVersionProfile(csOrch)
Expect(e).To(BeNil())
Expand All @@ -112,12 +112,12 @@ func TestOrchestratorUpgradeInfo(t *testing.T) {
// v20170930 - all orchestrators
list, e := GetOrchestratorVersionProfileListV20170930("", "")
Expect(e).To(BeNil())
Expect(len(list.Properties.Orchestrators)).To(Equal(27))
Expect(len(list.Properties.Orchestrators)).To(Equal(28))

// v20170930 - kubernetes only
list, e = GetOrchestratorVersionProfileListV20170930(common.Kubernetes, "")
Expect(e).To(BeNil())
Expect(len(list.Properties.Orchestrators)).To(Equal(22))
Expect(len(list.Properties.Orchestrators)).To(Equal(23))
}

func TestKubernetesInfo(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/vlabs/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ func (a *KubernetesConfig) Validate(k8sVersion string) error {
const minKubeletRetries = 4
// k8s versions that have cloudprovider backoff enabled
var backoffEnabledVersions = map[string]bool{
common.KubernetesVersion1Dot9Dot0: true,
common.KubernetesVersion1Dot9Dot1: true,
common.KubernetesVersion1Dot8Dot0: true,
common.KubernetesVersion1Dot8Dot1: true,
common.KubernetesVersion1Dot8Dot2: true,
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ func Test_KubernetesConfig_Validate(t *testing.T) {
// Tests that apply to 1.6 and later releases
for _, k8sVersion := range []string{common.KubernetesVersion1Dot6Dot11, common.KubernetesVersion1Dot6Dot12, common.KubernetesVersion1Dot6Dot13,
common.KubernetesVersion1Dot7Dot7, common.KubernetesVersion1Dot7Dot9, common.KubernetesVersion1Dot7Dot10, common.KubernetesVersion1Dot7Dot12,
common.KubernetesVersion1Dot8Dot1, common.KubernetesVersion1Dot8Dot2, common.KubernetesVersion1Dot8Dot4, common.KubernetesVersion1Dot8Dot6} {
common.KubernetesVersion1Dot8Dot1, common.KubernetesVersion1Dot8Dot2, common.KubernetesVersion1Dot8Dot4, common.KubernetesVersion1Dot8Dot6,
common.KubernetesVersion1Dot9Dot0, common.KubernetesVersion1Dot9Dot1} {
c := KubernetesConfig{
CloudProviderBackoff: true,
CloudProviderRateLimit: true,
Expand Down

0 comments on commit c477bc9

Please sign in to comment.