From e4cc14f70d1991616ecb7cf4584a9469300bed8d Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Mon, 25 Apr 2022 15:32:09 -0600 Subject: [PATCH] build: update min version to k8s 1.17 Support is removed for k8s for various limitations such as priority classes not working and csi driver feature incompleteness and missing snapshots. Documentation is updated with the new min version of k8s 1.17 and also the tests are updated to run on the min version of 1.17. Signed-off-by: Travis Nielsen (cherry picked from commit d26b6cf40347b2a6961db4c383fab88ff2b2f5e1) --- .../workflows/integration-test-helm-suite.yaml | 2 +- .../integration-test-object-suite.yaml | 2 +- .../workflows/integration-test-smoke-suite.yaml | 2 +- .../integration-test-upgrade-suite.yaml | 2 +- .../workflows/integration-tests-on-release.yaml | 10 +++++----- Documentation/ceph-block.md | 2 +- Documentation/ceph-cluster-crd.md | 4 ---- Documentation/development-flow.md | 2 +- Documentation/helm-ceph-cluster.md | 2 +- Documentation/helm-operator.md | 2 +- Documentation/quickstart.md | 2 +- .../rook-ceph-cluster/templates/_helpers.tpl | 4 +--- pkg/operator/ceph/cluster/osd/create.go | 12 ------------ pkg/operator/ceph/cluster/osd/create_test.go | 17 ----------------- .../framework/installer/ceph_helm_installer.go | 8 +------- tests/framework/installer/ceph_installer.go | 4 ---- tests/framework/installer/ceph_settings.go | 6 ------ tests/integration/ceph_multi_cluster_test.go | 7 ------- tests/scripts/deploy_cert_manager.sh | 9 --------- 19 files changed, 16 insertions(+), 83 deletions(-) diff --git a/.github/workflows/integration-test-helm-suite.yaml b/.github/workflows/integration-test-helm-suite.yaml index 4d7ba4add..eb9adfcc8 100644 --- a/.github/workflows/integration-test-helm-suite.yaml +++ b/.github/workflows/integration-test-helm-suite.yaml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.16.15', 'v1.23.0'] + kubernetes-versions : ['v1.17.17', 'v1.23.0'] steps: - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/integration-test-object-suite.yaml b/.github/workflows/integration-test-object-suite.yaml index ca2b29c9b..60dbabd42 100644 --- a/.github/workflows/integration-test-object-suite.yaml +++ b/.github/workflows/integration-test-object-suite.yaml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.16.15', 'v1.23.0'] + kubernetes-versions : ['v1.17.17', 'v1.23.0'] steps: - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/integration-test-smoke-suite.yaml b/.github/workflows/integration-test-smoke-suite.yaml index cfb14703c..bc05d6beb 100644 --- a/.github/workflows/integration-test-smoke-suite.yaml +++ b/.github/workflows/integration-test-smoke-suite.yaml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.16.15', 'v1.23.0'] + kubernetes-versions : ['v1.17.17', 'v1.23.0'] steps: - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/integration-test-upgrade-suite.yaml b/.github/workflows/integration-test-upgrade-suite.yaml index e3effab06..330c103be 100644 --- a/.github/workflows/integration-test-upgrade-suite.yaml +++ b/.github/workflows/integration-test-upgrade-suite.yaml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.16.15', 'v1.23.0'] + kubernetes-versions : ['v1.17.17', 'v1.23.0'] steps: - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/integration-tests-on-release.yaml b/.github/workflows/integration-tests-on-release.yaml index e7cf54b61..0f8c747b9 100644 --- a/.github/workflows/integration-tests-on-release.yaml +++ b/.github/workflows/integration-tests-on-release.yaml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.16.15','v1.18.20','v1.21.7','v1.23.0'] + kubernetes-versions : ['v1.17.17','v1.19.16','v1.21.7','v1.23.0'] steps: - name: checkout uses: actions/checkout@v2 @@ -59,7 +59,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.16.15','v1.18.20','v1.21.7','v1.23.0'] + kubernetes-versions : ['v1.17.17','v1.19.16','v1.21.7','v1.23.0'] steps: - name: checkout uses: actions/checkout@v2 @@ -99,7 +99,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.16.15','v1.18.20','v1.21.7','v1.23.0'] + kubernetes-versions : ['v1.17.17','v1.19.16','v1.21.7','v1.23.0'] steps: - name: checkout uses: actions/checkout@v2 @@ -138,7 +138,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.16.15','v1.18.20','v1.21.7','v1.23.0'] + kubernetes-versions : ['v1.17.17','v1.19.16','v1.21.7','v1.23.0'] steps: - name: checkout uses: actions/checkout@v2 @@ -220,7 +220,7 @@ jobs: strategy: fail-fast: false matrix: - kubernetes-versions : ['v1.16.15', 'v1.23.0'] + kubernetes-versions : ['v1.17.17', 'v1.23.0'] steps: - name: checkout uses: actions/checkout@v2 diff --git a/Documentation/ceph-block.md b/Documentation/ceph-block.md index 2e894dc94..a22508b19 100644 --- a/Documentation/ceph-block.md +++ b/Documentation/ceph-block.md @@ -82,7 +82,7 @@ parameters: # Delete the rbd volume when a PVC is deleted reclaimPolicy: Delete -# Optional, if you want to add dynamic resize for PVC. Works for Kubernetes 1.14+ +# Optional, if you want to add dynamic resize for PVC. # For now only ext3, ext4, xfs resize support provided, like in Kubernetes itself. allowVolumeExpansion: true ``` diff --git a/Documentation/ceph-cluster-crd.md b/Documentation/ceph-cluster-crd.md index 430448cf5..3967a9c7e 100755 --- a/Documentation/ceph-cluster-crd.md +++ b/Documentation/ceph-cluster-crd.md @@ -49,8 +49,6 @@ In a "PVC-based cluster", the Ceph persistent data is stored on volumes requeste This type of cluster is recommended in a cloud environment where volumes can be dynamically created and also in clusters where a local PV provisioner is available. -> **NOTE**: Kubernetes version 1.13.0 or greater is required to provision OSDs on PVCs. - ```yaml apiVersion: ceph.rook.io/v1 kind: CephCluster @@ -961,8 +959,6 @@ kubectl label node mynode topology.kubernetes.io/zone=zone1 kubectl label node mynode topology.rook.io/rack=zone1-rack1 ``` -> For versions previous to K8s 1.17, use the topology key: failure-domain.beta.kubernetes.io/zone or region - These labels would result in the following hierarchy for OSDs on that node (this command can be run in the Rook toolbox): ```console diff --git a/Documentation/development-flow.md b/Documentation/development-flow.md index f53c642d2..29ec2caf2 100644 --- a/Documentation/development-flow.md +++ b/Documentation/development-flow.md @@ -10,7 +10,7 @@ don't hesitate to reach out to us on our [Slack](https://Rook-io.slack.com) dev ## Prerequisites -1. [GO 1.13](https://golang.org/dl/) or greater installed +1. [GO 1.17](https://golang.org/dl/) or greater installed 2. Git client installed 3. GitHub account diff --git a/Documentation/helm-ceph-cluster.md b/Documentation/helm-ceph-cluster.md index 26660a956..5988b4268 100644 --- a/Documentation/helm-ceph-cluster.md +++ b/Documentation/helm-ceph-cluster.md @@ -17,7 +17,7 @@ This chart is a simple packaging of templates that will optionally create Rook r ## Prerequisites -* Kubernetes 1.13+ +* Kubernetes 1.17+ * Helm 3.x * Install the [Rook Operator chart](helm-operator.md) diff --git a/Documentation/helm-operator.md b/Documentation/helm-operator.md index 97893730a..606f8d7e9 100644 --- a/Documentation/helm-operator.md +++ b/Documentation/helm-operator.md @@ -16,7 +16,7 @@ This chart bootstraps a [rook-ceph-operator](https://github.com/rook/rook) deplo ## Prerequisites -* Kubernetes 1.13+ +* Kubernetes 1.17+ * Helm 3.x See the [Helm support matrix](https://helm.sh/docs/topics/version_skew/) for more details. diff --git a/Documentation/quickstart.md b/Documentation/quickstart.md index bb011db48..6c046a853 100644 --- a/Documentation/quickstart.md +++ b/Documentation/quickstart.md @@ -18,7 +18,7 @@ from other pods running in your cluster. ## Minimum Version -Kubernetes **v1.16** or higher is supported by Rook. +Kubernetes **v1.17** or higher is supported by Rook. ## Prerequisites diff --git a/deploy/charts/rook-ceph-cluster/templates/_helpers.tpl b/deploy/charts/rook-ceph-cluster/templates/_helpers.tpl index a8a6fb5e7..dbb065ffa 100644 --- a/deploy/charts/rook-ceph-cluster/templates/_helpers.tpl +++ b/deploy/charts/rook-ceph-cluster/templates/_helpers.tpl @@ -16,9 +16,7 @@ Return the target Kubernetes version. Return the appropriate apiVersion for ingress. */}} {{- define "capabilities.ingress.apiVersion" -}} -{{- if semverCompare "<1.14-0" (include "capabilities.kubeVersion" .) -}} -{{- print "extensions/v1beta1" -}} -{{- else if semverCompare "<1.19-0" (include "capabilities.kubeVersion" .) -}} +{{- if semverCompare "<1.19-0" (include "capabilities.kubeVersion" .) -}} {{- print "networking.k8s.io/v1beta1" -}} {{- else -}} {{- print "networking.k8s.io/v1" -}} diff --git a/pkg/operator/ceph/cluster/osd/create.go b/pkg/operator/ceph/cluster/osd/create.go index fd3075588..8af73fe39 100644 --- a/pkg/operator/ceph/cluster/osd/create.go +++ b/pkg/operator/ceph/cluster/osd/create.go @@ -27,7 +27,6 @@ import ( "github.com/rook/rook/pkg/operator/k8sutil" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/version" ) type createConfig struct { @@ -133,17 +132,6 @@ func (c *Cluster) startProvisioningOverPVCs(config *provisionConfig, errs *provi return sets.NewString(), nil } - // Check k8s version - k8sVersion, err := k8sutil.GetK8SVersion(c.context.Clientset) - if err != nil { - errs.addError("failed to provision OSDs on PVCs. user has specified storageClassDeviceSets, but the Kubernetes version could not be determined. minimum Kubernetes version required: 1.13.0. %v", err) - return sets.NewString(), nil - } - if !k8sVersion.AtLeast(version.MustParseSemantic("v1.13.0")) { - errs.addError("failed to provision OSDs on PVCs. user has specified storageClassDeviceSets, but the Kubernetes version is not supported. user must update Kubernetes version. minimum Kubernetes version required: 1.13.0. version detected: %s", k8sVersion.String()) - return sets.NewString(), nil - } - existingDeployments, err := c.getExistingOSDDeploymentsOnPVCs() if err != nil { errs.addError("failed to provision OSDs on PVCs. failed to query existing OSD deployments on PVCs. %v", err) diff --git a/pkg/operator/ceph/cluster/osd/create_test.go b/pkg/operator/ceph/cluster/osd/create_test.go index bf093a10b..764f1f064 100644 --- a/pkg/operator/ceph/cluster/osd/create_test.go +++ b/pkg/operator/ceph/cluster/osd/create_test.go @@ -317,7 +317,6 @@ func Test_startProvisioningOverPVCs(t *testing.T) { clusterInfo.Context = context.TODO() spec := cephv1.ClusterSpec{} - fakeK8sVersion := "v1.13.0" var errs *provisionErrors var c *Cluster @@ -325,7 +324,6 @@ func Test_startProvisioningOverPVCs(t *testing.T) { var awaitingStatusConfigMaps sets.String var err error doSetup := func() { - test.SetFakeKubernetesVersion(clientset, fakeK8sVersion) // PVCs require k8s version v1.13+ errs = newProvisionErrors() ctx := &clusterd.Context{ Clientset: clientset, @@ -408,21 +406,6 @@ func Test_startProvisioningOverPVCs(t *testing.T) { assert.Len(t, cms.Items, 2) // still just 2 configmaps should exist (the same 2 from before) }) - t.Run("error if k8s version not high enough", func(t *testing.T) { - // spec = - clientset = test.NewComplexClientset(t) // reset to empty fake k8s environment - fakeK8sVersion = "v1.12.7" - doSetup() - awaitingStatusConfigMaps, err = c.startProvisioningOverPVCs(config, errs) - assert.NoError(t, err) - assert.Equal(t, 0, awaitingStatusConfigMaps.Len()) - assert.Equal(t, 1, errs.len()) - cms, err := clientset.CoreV1().ConfigMaps(namespace).List(context.TODO(), metav1.ListOptions{}) - assert.NoError(t, err) - assert.Len(t, cms.Items, 0) - fakeK8sVersion = "v1.13.0" - }) - t.Run("error if no volume claim template", func(t *testing.T) { spec = cephv1.ClusterSpec{ Storage: cephv1.StorageScopeSpec{ diff --git a/tests/framework/installer/ceph_helm_installer.go b/tests/framework/installer/ceph_helm_installer.go index 4f06ce4b6..2c2fad488 100644 --- a/tests/framework/installer/ceph_helm_installer.go +++ b/tests/framework/installer/ceph_helm_installer.go @@ -59,18 +59,12 @@ func (h *CephInstaller) configureRookOperatorViaHelm(upgrade bool) error { "image": map[string]interface{}{"tag": h.settings.RookVersion}, "monitoring": map[string]interface{}{"enabled": true}, } - csiValues := map[string]interface{}{ + values["csi"] = map[string]interface{}{ "csiRBDProvisionerResource": nil, "csiRBDPluginResource": nil, "csiCephFSProvisionerResource": nil, "csiCephFSPluginResource": nil, } - if !utils.VersionAtLeast(h.settings.KubernetesVersion, "v1.17.0") { - // Older than K8s 1.17 cannot apply priority classes - csiValues["pluginPriorityClassName"] = "" - csiValues["provisionerPriorityClassName"] = "" - } - values["csi"] = csiValues // create the operator namespace before the admission controller is created if err := h.k8shelper.CreateNamespace(h.settings.OperatorNamespace); err != nil { diff --git a/tests/framework/installer/ceph_installer.go b/tests/framework/installer/ceph_installer.go index 8a66d9f81..f2dd2eb5c 100644 --- a/tests/framework/installer/ceph_installer.go +++ b/tests/framework/installer/ceph_installer.go @@ -152,10 +152,6 @@ func (h *CephInstaller) CreateVolumeReplicationCRDs() (err error) { logger.Info("volume replication CRDs skipped") return nil } - if !h.k8shelper.VersionAtLeast("v1.16.0") { - logger.Info("volume replication CRDs skipped on older than k8s 1.16") - return nil - } logger.Info("Creating volume replication CRDs") if _, err := h.k8shelper.KubectlWithStdin(readManifestFromURL(volumeReplicationCRDURL), createFromStdinArgs...); err != nil { diff --git a/tests/framework/installer/ceph_settings.go b/tests/framework/installer/ceph_settings.go index f9785380a..bea8a5bb0 100644 --- a/tests/framework/installer/ceph_settings.go +++ b/tests/framework/installer/ceph_settings.go @@ -22,7 +22,6 @@ import ( "strings" cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" - "github.com/rook/rook/tests/framework/utils" ) // TestCephSettings struct for handling panic and test suite tear down @@ -88,11 +87,6 @@ func (s *TestCephSettings) replaceOperatorSettings(manifest string) string { manifest = strings.ReplaceAll(manifest, `# CSI_LOG_LEVEL: "0"`, `CSI_LOG_LEVEL: "5"`) manifest = strings.ReplaceAll(manifest, `ROOK_ENABLE_DISCOVERY_DAEMON: "false"`, fmt.Sprintf(`ROOK_ENABLE_DISCOVERY_DAEMON: "%t"`, s.EnableDiscovery)) manifest = strings.ReplaceAll(manifest, `CSI_ENABLE_VOLUME_REPLICATION: "false"`, fmt.Sprintf(`CSI_ENABLE_VOLUME_REPLICATION: "%t"`, s.EnableVolumeReplication)) - if !utils.VersionAtLeast(s.KubernetesVersion, "v1.17.0") { - // Older than K8s 1.17 does not support priority classes - manifest = strings.ReplaceAll(manifest, `CSI_PLUGIN_PRIORITY_CLASSNAME: "system-node-critical"`, `CSI_PLUGIN_PRIORITY_CLASSNAME: ""`) - manifest = strings.ReplaceAll(manifest, `CSI_PROVISIONER_PRIORITY_CLASSNAME: "system-cluster-critical"`, `CSI_PROVISIONER_PRIORITY_CLASSNAME: ""`) - } return manifest } diff --git a/tests/integration/ceph_multi_cluster_test.go b/tests/integration/ceph_multi_cluster_test.go index 02bfd3283..757bd162b 100644 --- a/tests/integration/ceph_multi_cluster_test.go +++ b/tests/integration/ceph_multi_cluster_test.go @@ -24,7 +24,6 @@ import ( "github.com/rook/rook/tests/framework/clients" "github.com/rook/rook/tests/framework/installer" "github.com/rook/rook/tests/framework/utils" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) @@ -96,12 +95,6 @@ func (s *MultiClusterDeploySuite) SetupSuite() { externalSettings.ApplyEnvVars() s.externalManifests = installer.NewCephManifests(externalSettings) - k8sh, err := utils.CreateK8sHelper(s.T) - assert.NoError(s.T(), err) - if !k8sh.VersionAtLeast("v1.16.0") { - s.T().Skip("requires at least k8s 1.16, no need to run on older versions") - } - // Start the core storage cluster s.setupMultiClusterCore() s.createPools() diff --git a/tests/scripts/deploy_cert_manager.sh b/tests/scripts/deploy_cert_manager.sh index 54230fed1..c034f4ea7 100755 --- a/tests/scripts/deploy_cert_manager.sh +++ b/tests/scripts/deploy_cert_manager.sh @@ -17,15 +17,6 @@ function error_log() { trap error_log ERR -# Minimum 1.16.0 kubernetes version is required to start the admission controller -SERVER_VERSION=$(kubectl version --short | awk -F "." '/Server Version/ {print $2}') -MINIMUM_VERSION=16 - -if [ "${SERVER_VERSION}" -lt ${MINIMUM_VERSION} ]; then - echo "required minimum kubernetes version 1.$MINIMUM_VERSION.0" - exit -fi - # Set our known directories and parameters. BASE_DIR=$(cd "$(dirname "$0")"; pwd) CERT_VERSION="v1.3.1"