Merge "Support K8s 1.22.0 and newer."
This commit is contained in:
commit
153a13319f
|
@ -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: |
|
||||
|
|
|
@ -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': {
|
||||
|
|
|
@ -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.
|
Loading…
Reference in New Issue