Merge "Support K8s 1.22.0 and newer."

This commit is contained in:
Zuul 2022-04-08 17:00:40 +00:00 committed by Gerrit Code Review
commit 153a13319f
3 changed files with 10 additions and 6 deletions

View File

@ -7,8 +7,6 @@
post-run: playbooks/nodepool-functional-k8s/post.yaml
required-projects:
- zuul/nodepool
vars:
minikube_version: v1.22.0 # NOTE(corvus): 1.23.0 failed with 404 on create_namespaced_role
- job:
description: |

View File

@ -39,7 +39,7 @@ class KubernetesProvider(Provider, QuotaSupport):
self._zk = None
self.ready = False
_, _, self.k8s_client, self.rbac_client = get_client(
self.log, provider.context, k8s_client.RbacAuthorizationV1beta1Api)
self.log, provider.context, k8s_client.RbacAuthorizationV1Api)
self.namespace_names = set()
for pool in provider.pools.values():
self.namespace_names.add(pool.name)
@ -181,7 +181,7 @@ class KubernetesProvider(Provider, QuotaSupport):
role_name = "zuul-restricted"
role_body = {
'kind': 'Role',
'apiVersion': 'rbac.authorization.k8s.io/v1beta1',
'apiVersion': 'rbac.authorization.k8s.io/v1',
'metadata': {
'name': role_name,
},
@ -207,7 +207,7 @@ class KubernetesProvider(Provider, QuotaSupport):
role_name = "zuul"
role_body = {
'kind': 'Role',
'apiVersion': 'rbac.authorization.k8s.io/v1beta1',
'apiVersion': 'rbac.authorization.k8s.io/v1',
'metadata': {
'name': role_name,
},
@ -225,7 +225,7 @@ class KubernetesProvider(Provider, QuotaSupport):
# Give service account admin access
role_binding_body = {
'apiVersion': 'rbac.authorization.k8s.io/v1beta1',
'apiVersion': 'rbac.authorization.k8s.io/v1',
'kind': 'RoleBinding',
'metadata': {'name': 'zuul-role'},
'roleRef': {

View File

@ -0,0 +1,6 @@
---
other:
- |
Kubernetes 1.8 or newer is required by the Kubernetes driver.
This was necessary to support Kubernetes 1.22.0 and newer which
requires using APIs that are not supported before version 1.8.