mintel / dex-k8s-authenticator

A Kubernetes Dex Client Authenticator
MIT License
374 stars 146 forks source link

Helm update api version rbac #162

Open DANic-git opened 3 years ago

DANic-git commented 3 years ago

For fix warnings

W0225 11:16:31.324217 2944 warnings.go:70] rbac.authorization.k8s.io/v1beta1 ClusterRole is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRole W0225 11:16:31.383521 2944 warnings.go:70] rbac.authorization.k8s.io/v1beta1 ClusterRoleBinding is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRoleBinding W0225 11:16:31.442115 2944 warnings.go:70] rbac.authorization.k8s.io/v1beta1 Role is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 Role

nabadger commented 3 years ago

@germetist I'm thinking we should aim to support older API versions too?

i.e. using .Capabilities.KubeVersion or .Capabilities.APIVersions.Has ?

DANic-git commented 3 years ago

@nabadger Do you mean support for EOL versions of k8s?

yuripastushenko commented 3 years ago

Hi! @nabadger, @germetist are there any updates? I use kubernetes v1.22 created by minikube and when a try to create a role in API rbac.authorization.k8s.io/v1beta, I get the following error:

error: unable to recognize "role.yaml": no matches for kind "Role" in version "rbac.authorization.k8s.io/v1beta1"

When I call kubectl api-versions, in the result there are no such API version:

admissionregistration.k8s.io/v1
apiextensions.k8s.io/v1
apiregistration.k8s.io/v1
apps/v1
authentication.k8s.io/v1
authorization.k8s.io/v1
autoscaling/v1
autoscaling/v2beta1
autoscaling/v2beta2
batch/v1
batch/v1beta1
certificates.k8s.io/v1
coordination.k8s.io/v1
discovery.k8s.io/v1
discovery.k8s.io/v1beta1
events.k8s.io/v1
events.k8s.io/v1beta1
flowcontrol.apiserver.k8s.io/v1beta1
networking.k8s.io/v1
node.k8s.io/v1
node.k8s.io/v1beta1
policy/v1
policy/v1beta1
rbac.authorization.k8s.io/v1
scheduling.k8s.io/v1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1

This is because this version of api is no longer served on cluster versions >= 1.22

So the object from template can't be created in cluster.

The API rbac.authorization.k8s.io/v1 is added 4 years ago in kubernetes version 1.8 Are you sure that we should maintain such long backward compatibility (14 versions)? I think that we should not maintain backward compatibility with such old clusters (< 1.8).