Skip to content

Commit

Permalink
Merge branch 'master' into issue-638
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/CHANGELOG.md
  • Loading branch information
Amper committed Sep 27, 2023
2 parents ffef1ac + 958ce2b commit b89ad9d
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 6 deletions.
9 changes: 8 additions & 1 deletion config/examples/operator_rbac_for_single_namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ metadata:
name: vm-operator-single-ns-only
namespace: default
rules:
- apiGroups:
- "discovery.k8s.io"
resources:
- endpointslices
verbs:
- 'list'
- 'watch'
- 'get'
- apiGroups:
- ""
resources:
- endpoints
- endpointslices
verbs:
- 'list'
- 'watch'
Expand Down
2 changes: 1 addition & 1 deletion config/examples/vmagent_rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ kind: ClusterRole
metadata:
name: vmagent
rules:
- apiGroups: ["","networking.k8s.io","extensions"]
- apiGroups: ["","networking.k8s.io","extensions","discovery.k8s.io"]
resources:
- nodes
- nodes/metrics
Expand Down
9 changes: 8 additions & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ rules:
- get
- patch
- update
- apiGroups:
- "discovery.k8s.io"
resources:
- endpointslices
verbs:
- 'list'
- 'watch'
- 'get'
- apiGroups:
- ""
resources:
Expand All @@ -286,7 +294,6 @@ rules:
- services
- endpoints
- pods
- endpointslices
- configmaps
verbs:
- get
Expand Down
24 changes: 22 additions & 2 deletions controllers/factory/vmagent/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ import (

var (
singleNSPolicyRules = []rbacV1.PolicyRule{
{
APIGroups: []string{"discovery.k8s.io"},
Verbs: []string{
"get",
"list",
"watch",
},
Resources: []string{
"endpointslices",
},
},
{
APIGroups: []string{""},
Verbs: []string{
Expand All @@ -26,7 +37,6 @@ var (
"services",
"endpoints",
"pods",
"endpointslices",
"secrets",
"configmaps",
},
Expand All @@ -44,6 +54,17 @@ var (
},
}
clusterWidePolicyRules = []rbacV1.PolicyRule{
{
APIGroups: []string{"discovery.k8s.io"},
Verbs: []string{
"get",
"list",
"watch",
},
Resources: []string{
"endpointslices",
},
},
{
APIGroups: []string{""},
Verbs: []string{
Expand All @@ -58,7 +79,6 @@ var (
"services",
"endpoints",
"pods",
"endpointslices",
"configmaps",
"namespaces",
"secrets",
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ title: CHANGELOG

- [vmcluster](./api.html#vmcluster): remove redundant annotation `operator.victoriametrics/last-applied-spec` from created workloads like vmstorage statefulset.
- [vmoperator](./README.md): properly resize statefulset's multiple pvc when needed and allowable, before they could be updated with wrong size.
- [vmoperator](./README.md): fix wrong api group of endpointsices, before vmagent won't able to access endpointsices resources with default rbac rule.

<a name="v0.38.0"></a>
## [v0.38.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.38.0) - 11 Sep 2023
Expand Down
2 changes: 1 addition & 1 deletion hack/bundle_csv_vmagent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ spec:
spec:
clusterPermissions:
- rules:
- apiGroups: [ "","networking.k8s.io","extensions" ]
- apiGroups: [ "","networking.k8s.io","extensions","discovery.k8s.io" ]
resources:
- nodes
- nodes/metrics
Expand Down

0 comments on commit b89ad9d

Please sign in to comment.