splunk / splunk-operator

Splunk Operator for Kubernetes
Other
209 stars 115 forks source link

Operator projects using the removed APIs in k8s 1.22 requires changes. #495

Closed camilamacedo86 closed 2 years ago

camilamacedo86 commented 3 years ago

Problem Description

Kubernetes has been deprecating API(s), which will be removed and are no longer available in 1.22. Operators projects using these APIs versions will not work on Kubernetes 1.22 or any cluster vendor using this Kubernetes version(1.22), such as OpenShift 4.9+. Following the APIs that are most likely your projects to be affected by:

Therefore, looks like this project distributes solutions in the repository and does not contain any version compatible with k8s 1.22/OCP 4.9. (More info). Following some findings by checking the distributions published:

NOTE: The above findings are only about the manifests shipped inside of the distribution. It is not checking the codebase.

How to solve

It would be very nice to see new distributions of this project that are no longer using these APIs and so they can work on Kubernetes 1.22 and newer and published in the community-operators collection. OpenShift 4.9, for example, will not ship operators anymore that do still use v1beta1 extension APIs.

Due to the number of options available to build Operators, it is hard to provide direct guidance on updating your operator to support Kubernetes 1.22. Recent versions of the OperatorSDK greater than 1.0.0 and Kubebuilder greater than 3.0.0 scaffold your project with the latest versions of these APIs (all that is generated by tools only). See the guides to upgrade your projects with OperatorSDK Golang, Ansible, Helm or the Kubebuilder one. For APIs other than the ones mentioned above, you will have to check your code for usage of removed API versions and upgrade to newer APIs. The details of this depend on your codebase.

If this projects only need to migrate the API for CRDs and it was built with OperatorSDK versions lower than 1.0.0 then, you maybe able to solve it with an OperatorSDK version >= v0.18.x < 1.0.0:

$ operator-sdk generate crds --crd-version=v1 INFO[0000] Running CRD generator.
INFO[0000] CRD generation complete.

Alternatively, you can try to upgrade your manifests with controller-gen (version >= v0.4.1) :

If this project does not use Webhooks:

$ controller-gen crd:trivialVersions=true,preserveUnknownFields=false rbac:roleName=manager-role paths="./..."

If this project is using Webhooks:

  1. Add the markers sideEffects and admissionReviewVersions to your webhook (Example with sideEffects=None and admissionReviewVersions={v1,v1beta1}: memcached-operator/api/v1alpha1/memcached_webhook.go):

  2. Run the command:

    $ controller-gen crd:trivialVersions=true,preserveUnknownFields=false rbac:roleName=manager-role webhook paths="./..."

For further information and tips see the comment.

camilamacedo86 commented 3 years ago

Hi, would we have any update on this?

See that we are very close to the release data and fix the projects seems not very hard. See how to fix it in the first comment. Then, would be great to be able to check a new version of your project distributed which is compatible with 4.9.

p3lim commented 2 years ago

In ~2 weeks (dec 28th) support for 1.20 ends, which means this operator only works on 1 out of 3 supported version of Kubernetes. People relying on Splunk will be unable to upgrade past 1.21, and others will be unable to start using the operator at all since major distributions of Kubernetes default to using stable/latest (1.22 and 1.23), and downgrading just for this operator is out of the question.

Related: #402

Considering that issue has been open for 6 months, and 1.21 support ends in 4 months, you ought to prioritize this. No response in either issue doesn't inspire confidence in this operator.

vivekr-splunk commented 2 years ago

@camilamacedo86 @p3lim , thanks for comments and apologies for delayed response

As a separate activity we are also working on migrating splunk-operator to latest operator sdk and should be part of forthcoming releases

camilamacedo86 commented 2 years ago

Hi @p3lim,

however cluster-role continues to use rbac.authorization.k8s.io/v1beta1, we are currently assessing the impact of this on 1.22+ cluster

rbac.authorization.k8s.io/v1beta1 does not work on 1.22+ because it does not exist on this version. So, if you try to apply any manifest using it any vendor using 1.22+ or in any K8s version 1.22+ you will face the issue. That is really not possible.

Screenshot 2021-12-16 at 12 16 30

https://kubernetes.io/docs/reference/using-api/deprecation-guide/

Also, see:

Therefore, looks like this project distributes solutions in the repository and does not contain any version compatible with k8s 1.22/OCP 4.9. (More info). Following some findings by checking the distributions published:

splunk.v0.1.0: this distribution is using APIs which were deprecated and removed in v1.22. More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22. Migrate the API(s) for CRD: (["indexerclusters.enterprise.splunk.com" "licensemasters.enterprise.splunk.com" "searchheadclusters.enterprise.splunk.com" "sparks.enterprise.splunk.com" "standalones.enterprise.splunk.com"])

IMPORTANT:

If you can change the project in the repo. However, until you publish a new version that can work on 4.9 in: https://github.com/redhat-openshift-ecosystem/community-operators-prod/tree/main/operators/splunk your users are unable to upgrade their OCP cluster from 4.8 to 4.9 with your project installed.

OCP/OLM users are unable to install your project on 4.9+ and it is no longer more distributed in the latest versions.

smohan-splunk commented 2 years ago

Splunk Operator 1.0.5 has been released which has replaced the rbac.authorization.k8s.io/v1beta1 API with rbac.authorization.k8s.io/v1 . As already clarified earlier, the other reported deprecated APIs are no longer applicable for the latest release of the Operator. In the future releases, we intend upgrade to the latest Operator SDK.

@camilamacedo86 Kindly review