kubeplus icon indicating copy to clipboard operation
kubeplus copied to clipboard

Migration to Kubernetes 1.22

Open devdattakulkarni opened this issue 2 years ago • 0 comments

As of 1.22 version of Kubernetes [1][2], following API related changes need to be made to KubePlus

Mutating Webhook Helper

  1. Change the admissionregistrationclient to v1 from v1beta1 https://github.com/cloud-ark/kubeplus/blob/master/mutating-webhook-helper/webhook-helper.go#L16
  2. Change apiextensionsclientset to v1 from v1beta1

Mutating Webhook:

  1. webhook.go -> change admissionregistrationv1beta1 to v1
  2. types.go -> change apiextensionsclientset to v1
  3. utils.go -> change apiextensionsclientset to v1

Platform Controller:

  1. apiextensionsv1beta1 -> change apiextensionsv1beta1 to v1
  2. apiextensionsclientset -> change apiextensionsclientset to v1

deploy:

  1. Change mutatingwebhook.yaml to v1 MutatingWebhookConfiguration
  2. Change mutatingwebook-ca-bundle.yaml
  3. Change kubeplus-non-pod-resources.yaml
    • change spec.version to spec.versions
    • add structural schema validation (spec.versions[*].schema.openAPIV3Schema) for each CRD.
    • Note that we will have to update the Platform Controller as well to define these fields as part of registering the client API.
  4. Change CertificateSigningRequest in webhook-create-signed-cert-new.sh
  5. Update CertificateSigningRequest in webhook-create-signed-cert.sh

Kubediscovery:

  1. Change discovery.go (https://github.com/cloud-ark/kubediscovery/blob/master/pkg/discovery/discovery.go#L17)
  2. Change operatordocs.go (https://github.com/cloud-ark/kubediscovery/blob/master/pkg/discovery/operatordocs.go#L11)

README:

  1. Change reference to Kubernetes version (e.g.: https://github.com/cloud-ark/kubeplus#try)

Testing: In order to test the changes we will have to spin up Kubernetes version 1.22 and try KubePlus on it. Using Vagrant setup with freshly cloned copies of kubePlus and kubediscovery repo is a good option for this. Check the steps here: https://cloud-ark.github.io/kubeplus/docs/html/html/compile-components.html#work-on-the-code

Reference: [1] https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22 [2] https://github.com/cloud-ark/kubeplus/issues/930

devdattakulkarni avatar Feb 20 '22 21:02 devdattakulkarni