From 9898e00ac598c2fdd1c685f165443b5b17f2d31d Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Mon, 11 Jan 2021 13:16:40 +0530 Subject: [PATCH 1/2] ceph: update admission controller to v1 from v1beta1 this commit update admission controller to v1 from v1beta1. v1beta1 is deprecated in v1.16+ and unavailable in v1.22+. Signed-off-by: subhamkrai --- design/ceph/admission-controller.md | 2 +- tests/scripts/webhook-config.yaml | 6 +++--- tests/scripts/webhook-create-signed-cert.sh | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/design/ceph/admission-controller.md b/design/ceph/admission-controller.md index b0f5a6443..76a3a580b 100644 --- a/design/ceph/admission-controller.md +++ b/design/ceph/admission-controller.md @@ -104,7 +104,7 @@ Using the above approach, the dev/admins will have the responsibility of rotatin Below is an excerpt of what a ValidatingWebhookConfig looks like ``` -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: name: demo-webhook diff --git a/tests/scripts/webhook-config.yaml b/tests/scripts/webhook-config.yaml index d20ee39ab..ac4766078 100644 --- a/tests/scripts/webhook-config.yaml +++ b/tests/scripts/webhook-config.yaml @@ -1,4 +1,4 @@ -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: name: ${WEBHOOK_CONFIG_NAME} @@ -16,7 +16,7 @@ webhooks: namespace: ${NAMESPACE} path: /validate-ceph-rook-io-v1-cephcluster caBundle: ${CA_BUNDLE} - admissionReviewVersions: ["v1beta1"] + admissionReviewVersions: ["v1", "v1beta1"] # API server will try to use first version in the list which it supports. sideEffects: None timeoutSeconds: 5 - name: cephblockpool-wh-${SERVICE_NAME}-${NAMESPACE}.rook.io @@ -31,6 +31,6 @@ webhooks: namespace: ${NAMESPACE} path: /validate-ceph-rook-io-v1-cephblockpool caBundle: ${CA_BUNDLE} - admissionReviewVersions: ["v1beta1"] + admissionReviewVersions: ["v1", "v1beta1"] # API server will try to use first version in the list which it supports. sideEffects: None timeoutSeconds: 5 diff --git a/tests/scripts/webhook-create-signed-cert.sh b/tests/scripts/webhook-create-signed-cert.sh index e6345a351..f42ddd8d2 100755 --- a/tests/scripts/webhook-create-signed-cert.sh +++ b/tests/scripts/webhook-create-signed-cert.sh @@ -132,4 +132,3 @@ kubectl create secret generic ${secret} \ --from-file=tls.crt=${tmpdir}/server-cert.pem \ --dry-run -o yaml | kubectl -n ${namespace} apply -f - - From f17f908c3153e94dd7f19afc439d565c239472fb Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Thu, 21 Jan 2021 13:05:03 +0530 Subject: [PATCH 2/2] ceph: disable admission controller for CephUpgradeSuite disabling admission controller for the upgrade test. Upgrade test was using older controller runtime version and api v1 need latest version controller runtime(v0.7). Signed-off-by: subhamkrai --- tests/framework/installer/ceph_installer.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/framework/installer/ceph_installer.go b/tests/framework/installer/ceph_installer.go index b58224739..00b558d8d 100644 --- a/tests/framework/installer/ceph_installer.go +++ b/tests/framework/installer/ceph_installer.go @@ -123,7 +123,10 @@ func (h *CephInstaller) CreateCephOperator(namespace string) (err error) { return fmt.Errorf("failed to create namespace %q. %v", namespace, err) } } - if !utils.IsPlatformOpenShift() { + + // disable admission controller for upgrade test as api version v1 require minimum v0.7 controller runtime and upgrade test still using + // older version of controller runtime. + if !utils.IsPlatformOpenShift() && namespace != "upgrade-ns-system" { err = h.startAdmissionController(namespace) if err != nil { return fmt.Errorf("Failed to start admission controllers: %v", err) @@ -515,7 +518,7 @@ func (h *CephInstaller) InstallRook(namespace, storeType string, usePVC bool, st } logger.Infof("installed rook operator and cluster : %s on k8s %s", namespace, h.k8sVersion) - if !utils.IsPlatformOpenShift() && h.k8shelper.VersionAtLeast("v1.15.0") { + if !utils.IsPlatformOpenShift() && h.k8shelper.VersionAtLeast("v1.15.0") && namespace != "upgrade-ns" { if !h.k8shelper.IsPodInExpectedState("rook-ceph-admission-controller", onamespace, "Running") { assert.Fail(h.T(), "admission controller is not running") }