Skip to content

Commit

Permalink
Add ClusterRole and ClusterRole (kubeflow#2684)
Browse files Browse the repository at this point in the history
* Add ClusterRole and ClusterRole binding to allow Namespace and Events listing

* Remove namespace

Remove namespace from ClusterRole and ClusterRoleBinding
  • Loading branch information
prodonjs authored and k8s-ci-robot committed Mar 13, 2019
1 parent 0de698e commit c95c585
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions kubeflow/common/centraldashboard.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,65 @@
}, // role binding
centralDashboardRoleBinding:: centralDashboardRoleBinding,

local centralDashboardClusterRole = {
apiVersion: "rbac.authorization.k8s.io/v1",
kind: "ClusterRole",
metadata: {
labels: {
app: "centraldashboard",
},
name: "centraldashboard",
},
rules: [
{
apiGroups: [""],
resources: [
"namespaces",
"events"
],
verbs: [
"get",
"list",
"watch",
],
}
],
}, // clusterrole
centralDashboardClusterRole:: centralDashboardClusterRole,

local centralDashboardClusterRoleBinding = {
apiVersion: "rbac.authorization.k8s.io/v1",
kind: "ClusterRoleBinding",
metadata: {
labels: {
app: "centraldashboard",
},
name: "centraldashboard",
},
roleRef: {
apiGroup: "rbac.authorization.k8s.io",
kind: "ClusterRole",
name: "centraldashboard",
},
subjects: [
{
kind: "ServiceAccount",
name: "centraldashboard",
namespace: params.namespace,
},
],
}, // clusterrolebinding
centralDashboardClusterRoleBinding:: centralDashboardClusterRoleBinding,

parts:: self,
all:: [
self.centralDashboardDeployment,
self.centralDashboardService,
self.centralDashboardServiceAccount,
self.centralDashboardRole,
self.centralDashboardRoleBinding,
self.centralDashboardClusterRole,
self.centralDashboardClusterRoleBinding,
],

list(obj=self.all):: util.list(obj),
Expand Down

0 comments on commit c95c585

Please sign in to comment.