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
9f8b803d
Unverified
Commit
9f8b803d
authored
Feb 11, 2017
by
Jordan Liggitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create bootstrap system:kube-scheduler role
parent
a57967f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
124 additions
and
0 deletions
+124
-0
policy.go
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
+23
-0
cluster-role-bindings.yaml
.../rbac/bootstrappolicy/testdata/cluster-role-bindings.yaml
+17
-0
cluster-roles.yaml
...thorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml
+83
-0
user.go
staging/src/k8s.io/apiserver/pkg/authentication/user/user.go
+1
-0
No files found.
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
View file @
9f8b803d
...
...
@@ -315,6 +315,28 @@ func ClusterRoles() []rbac.ClusterRole {
},
},
{
// a role to use for the kube-scheduler
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:kube-scheduler"
},
Rules
:
[]
rbac
.
PolicyRule
{
eventsRule
(),
// this is for leaderlease access
// TODO: scope this to the kube-system namespace
rbac
.
NewRule
(
"create"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"endpoints"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"get"
,
"update"
,
"patch"
,
"delete"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"endpoints"
)
.
Names
(
"kube-scheduler"
)
.
RuleOrDie
(),
// fundamental resources
rbac
.
NewRule
(
Read
...
)
.
Groups
(
legacyGroup
)
.
Resources
(
"nodes"
,
"pods"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"create"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"pods/binding"
,
"bindings"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
"update"
)
.
Groups
(
legacyGroup
)
.
Resources
(
"pods/status"
)
.
RuleOrDie
(),
// things that select pods
rbac
.
NewRule
(
Read
...
)
.
Groups
(
legacyGroup
)
.
Resources
(
"services"
,
"replicationcontrollers"
)
.
RuleOrDie
(),
rbac
.
NewRule
(
Read
...
)
.
Groups
(
extensionsGroup
)
.
Resources
(
"replicasets"
)
.
RuleOrDie
(),
// things that pods use
rbac
.
NewRule
(
Read
...
)
.
Groups
(
legacyGroup
)
.
Resources
(
"persistentvolumeclaims"
,
"persistentvolumes"
)
.
RuleOrDie
(),
},
},
{
// a role for an external/out-of-tree persistent volume provisioner
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"system:persistent-volume-provisioner"
},
Rules
:
[]
rbac
.
PolicyRule
{
...
...
@@ -343,6 +365,7 @@ func ClusterRoleBindings() []rbac.ClusterRoleBinding {
rbac
.
NewClusterBinding
(
"system:node"
)
.
Groups
(
user
.
NodesGroup
)
.
BindingOrDie
(),
rbac
.
NewClusterBinding
(
"system:node-proxier"
)
.
Users
(
user
.
KubeProxy
)
.
BindingOrDie
(),
rbac
.
NewClusterBinding
(
"system:kube-controller-manager"
)
.
Users
(
user
.
KubeControllerManager
)
.
BindingOrDie
(),
rbac
.
NewClusterBinding
(
"system:kube-scheduler"
)
.
Users
(
user
.
KubeScheduler
)
.
BindingOrDie
(),
}
addClusterRoleBindingLabel
(
rolebindings
)
return
rolebindings
...
...
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-role-bindings.yaml
View file @
9f8b803d
...
...
@@ -82,6 +82,23 @@ items:
creationTimestamp
:
null
labels
:
kubernetes.io/bootstrapping
:
rbac-defaults
name
:
system:kube-scheduler
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
kind
:
ClusterRole
name
:
system:kube-scheduler
subjects
:
-
apiGroup
:
rbac.authorization.k8s.io
kind
:
User
name
:
system:kube-scheduler
-
apiVersion
:
rbac.authorization.k8s.io/v1beta1
kind
:
ClusterRoleBinding
metadata
:
annotations
:
rbac.authorization.kubernetes.io/autoupdate
:
"
true"
creationTimestamp
:
null
labels
:
kubernetes.io/bootstrapping
:
rbac-defaults
name
:
system:node
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
...
...
plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml
View file @
9f8b803d
...
...
@@ -529,6 +529,89 @@ items:
creationTimestamp
:
null
labels
:
kubernetes.io/bootstrapping
:
rbac-defaults
name
:
system:kube-scheduler
rules
:
-
apiGroups
:
-
"
"
resources
:
-
events
verbs
:
-
create
-
patch
-
update
-
apiGroups
:
-
"
"
resources
:
-
endpoints
verbs
:
-
create
-
apiGroups
:
-
"
"
resourceNames
:
-
kube-scheduler
resources
:
-
endpoints
verbs
:
-
delete
-
get
-
patch
-
update
-
apiGroups
:
-
"
"
resources
:
-
nodes
-
pods
verbs
:
-
get
-
list
-
watch
-
apiGroups
:
-
"
"
resources
:
-
bindings
-
pods/binding
verbs
:
-
create
-
apiGroups
:
-
"
"
resources
:
-
pods/status
verbs
:
-
update
-
apiGroups
:
-
"
"
resources
:
-
replicationcontrollers
-
services
verbs
:
-
get
-
list
-
watch
-
apiGroups
:
-
extensions
resources
:
-
replicasets
verbs
:
-
get
-
list
-
watch
-
apiGroups
:
-
"
"
resources
:
-
persistentvolumeclaims
-
persistentvolumes
verbs
:
-
get
-
list
-
watch
-
apiVersion
:
rbac.authorization.k8s.io/v1beta1
kind
:
ClusterRole
metadata
:
annotations
:
rbac.authorization.kubernetes.io/autoupdate
:
"
true"
creationTimestamp
:
null
labels
:
kubernetes.io/bootstrapping
:
rbac-defaults
name
:
system:node
rules
:
-
apiGroups
:
...
...
staging/src/k8s.io/apiserver/pkg/authentication/user/user.go
View file @
9f8b803d
...
...
@@ -79,4 +79,5 @@ const (
// core kubernetes process identities
KubeProxy
=
"system:kube-proxy"
KubeControllerManager
=
"system:kube-controller-manager"
KubeScheduler
=
"system:kube-scheduler"
)
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