Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
fd5ef6d6
Commit
fd5ef6d6
authored
Jun 13, 2018
by
David Zhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RBAC policy rules for csi-external-provisioner and csi-external-attacher
parent
ff6ac4e6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
0 deletions
+117
-0
policy.go
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
+20
-0
cluster-roles.yaml
...thorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml
+97
-0
No files found.
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
View file @
fd5ef6d6
...
@@ -459,6 +459,26 @@ func ClusterRoles() []rbac.ClusterRole {
...
@@ -459,6 +459,26 @@ func ClusterRoles() []rbac.ClusterRole {
},
},
},
},
{
{
// a role for the csi external provisioner
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:csi-external-provisioner"
},
Rules
:
[]
rbac
.
PolicyRule
{
rbac
.
NewRule
(
"create"
,
"delete"
,
"get"
,
"list"
,
"watch"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"persistentvolumes"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"get"
,
"list"
,
"watch"
,
"update"
,
"patch"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"persistentvolumeclaims"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"list"
,
"watch"
)
.
Groups
(
storageGroup
)
.
Resources
(
"storageclasses"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"get"
,
"list"
,
"watch"
,
"create"
,
"update"
,
"patch"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"events"
)
.
RuleOrDie
(),
},
},
{
// a role for the csi external attacher
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:csi-external-attacher"
},
Rules
:
[]
rbac
.
PolicyRule
{
rbac
.
NewRule
(
"get"
,
"list"
,
"watch"
,
"update"
,
"patch"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"persistentvolumes"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"get"
,
"list"
,
"watch"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"nodes"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"get"
,
"list"
,
"watch"
,
"update"
,
"patch"
)
.
Groups
(
storageGroup
)
.
Resources
(
"volumeattachments"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"get"
,
"list"
,
"watch"
,
"create"
,
"update"
,
"patch"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"events"
)
.
RuleOrDie
(),
},
},
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:aws-cloud-provider"
},
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:aws-cloud-provider"
},
Rules
:
[]
rbac
.
PolicyRule
{
Rules
:
[]
rbac
.
PolicyRule
{
rbac
.
NewRule
(
"get"
,
"patch"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"nodes"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"get"
,
"patch"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"nodes"
)
.
RuleOrDie
(),
...
...
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml
View file @
fd5ef6d6
...
@@ -627,6 +627,103 @@ items:
...
@@ -627,6 +627,103 @@ items:
creationTimestamp
:
null
creationTimestamp
:
null
labels
:
labels
:
kubernetes.io/bootstrapping
:
rbac-defaults
kubernetes.io/bootstrapping
:
rbac-defaults
name
:
system:csi-external-attacher
rules
:
-
apiGroups
:
-
"
"
resources
:
-
persistentvolumes
verbs
:
-
get
-
list
-
patch
-
update
-
watch
-
apiGroups
:
-
"
"
resources
:
-
nodes
verbs
:
-
get
-
list
-
watch
-
apiGroups
:
-
storage.k8s.io
resources
:
-
volumeattachments
verbs
:
-
get
-
list
-
patch
-
update
-
watch
-
apiGroups
:
-
"
"
resources
:
-
events
verbs
:
-
create
-
get
-
list
-
patch
-
update
-
watch
-
apiVersion
:
rbac.authorization.k8s.io/v1
kind
:
ClusterRole
metadata
:
annotations
:
rbac.authorization.kubernetes.io/autoupdate
:
"
true"
creationTimestamp
:
null
labels
:
kubernetes.io/bootstrapping
:
rbac-defaults
name
:
system:csi-external-provisioner
rules
:
-
apiGroups
:
-
"
"
resources
:
-
persistentvolumes
verbs
:
-
create
-
delete
-
get
-
list
-
watch
-
apiGroups
:
-
"
"
resources
:
-
persistentvolumeclaims
verbs
:
-
get
-
list
-
patch
-
update
-
watch
-
apiGroups
:
-
storage.k8s.io
resources
:
-
storageclasses
verbs
:
-
list
-
watch
-
apiGroups
:
-
"
"
resources
:
-
events
verbs
:
-
create
-
get
-
list
-
patch
-
update
-
watch
-
apiVersion
:
rbac.authorization.k8s.io/v1
kind
:
ClusterRole
metadata
:
annotations
:
rbac.authorization.kubernetes.io/autoupdate
:
"
true"
creationTimestamp
:
null
labels
:
kubernetes.io/bootstrapping
:
rbac-defaults
name
:
system:discovery
name
:
system:discovery
rules
:
rules
:
-
nonResourceURLs
:
-
nonResourceURLs
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment