Skip to content

Commit

Permalink
Remove Seldon Cluster Roles by default (kubeflow#2039)
Browse files Browse the repository at this point in the history
* Remove Cluster Roles by default

* Fix jsonnet formatting
  • Loading branch information
ukclivecox authored and Kam D Kasravi committed Feb 8, 2019
1 parent 699770e commit ac97a48
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions kubeflow/seldon/prototypes/core.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// @optionalParam operatorJavaOpts string null cluster manager java opts
// @optionalParam grpcMaxMessageSize string 4194304 Max gRPC message size
// @optionalParam seldonVersion string 0.2.3 Seldon version
// @optionalParam withClusterRole string false Whether to add cluster roles

local k = import "k.libsonnet";
local core = import "kubeflow/seldon/core.libsonnet";
Expand All @@ -22,6 +23,7 @@ local namespace = env.namespace;
local withRbac = import "param://withRbac";
local withApife = import "param://withApife";
local withAmbassador = import "param://withAmbassador";
local withClusterRole = import "param://withClusterRole";

// APIFE
local apifeImage = "seldonio/apife:" + seldonVersion;
Expand All @@ -46,17 +48,20 @@ local apife = [

local rbac2 = [
core.parts(name, namespace, seldonVersion).rbacServiceAccount(),
core.parts(name, namespace, seldonVersion).rbacClusterRole(),
core.parts(name, namespace, seldonVersion).rbacRole(),
core.parts(name, namespace, seldonVersion).rbacRoleBinding(),
core.parts(name, namespace, seldonVersion).rbacClusterRoleBinding(),
];

local rbac1 = [
core.parts(name, namespace, seldonVersion).rbacServiceAccount(),
core.parts(name, namespace, seldonVersion).rbacRoleBinding(),
];

local rbac3 = [
core.parts(name, namespace, seldonVersion).rbacClusterRole(),
core.parts(name, namespace, seldonVersion).rbacClusterRoleBinding(),
];

local rbac = if std.startsWith(seldonVersion, "0.1") then rbac1 else rbac2;

// Core
Expand All @@ -82,5 +87,6 @@ local l1 = if withRbac == "true" then rbac + coreComponents else coreComponents;
local l2 = if withApife == "true" then l1 + apife else l1;
local l3 = if withAmbassador == "true" && withRbac == "true" then l2 + ambassadorRbac else l2;
local l4 = if withAmbassador == "true" then l3 + ambassador else l3;
local l5 = if withClusterRole == "true" then l4 + rbac3 else l4;

l4
l5

0 comments on commit ac97a48

Please sign in to comment.