Skip to content

Commit

Permalink
test: Extend coredns clusterrole with additional resource permissions
Browse files Browse the repository at this point in the history
Commit 398d55c didn't add permissions for `endpointslices` resource to the
coredns `cluterrole` on k8s < 1.20. As a result, core-dns deployments
failed on the these versions with the error -

`2021-11-30T14:09:43.349414540Z E1130 14:09:43.349292 1 reflector.go:138] pkg/mod/k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.EndpointSlice: failed to list *v1beta1.EndpointSlice: endpointslices.discovery.k8s.io is forbidden: User "system:serviceaccount:kube-system:coredns" cannot list resource "endpointslices" in API group "discovery.k8s.io" at the cluster scope`

Fixes: 398d55c
Signed-off-by: Aditi Ghag <aditi@cilium.io>
  • Loading branch information
aditighag committed Dec 2, 2021
1 parent af6b795 commit 80f872f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/provision/manifest/1.16/coredns_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ rules:
- nodes
verbs:
- get
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
7 changes: 7 additions & 0 deletions test/provision/manifest/1.17/coredns_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ rules:
- nodes
verbs:
- get
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
7 changes: 7 additions & 0 deletions test/provision/manifest/1.18/coredns_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ rules:
- nodes
verbs:
- get
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
7 changes: 7 additions & 0 deletions test/provision/manifest/1.19/coredns_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ rules:
- nodes
verbs:
- get
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down

0 comments on commit 80f872f

Please sign in to comment.