-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from cliveseldon/ksonnet
Ksonnet - initial integration
- Loading branch information
Showing
15 changed files
with
4,185 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: '0.1' | ||
kind: ksonnet.io/registry | ||
libraries: | ||
seldon-core: | ||
version: master | ||
path: seldon-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
local k = import 'k.libsonnet'; | ||
local deployment = k.extensions.v1beta1.deployment; | ||
local container = k.apps.v1beta1.deployment.mixin.spec.template.spec.containersType; | ||
local service = k.core.v1.service.mixin; | ||
local baseApife = import 'json/apife-deployment.json'; | ||
local apifeService = import 'json/apife-service.json'; | ||
local operatorDeployment = import 'json/operator-deployment.json'; | ||
local redisDeployment = import 'json/redis-deployment.json'; | ||
local redisService = import 'json/redis-service.json'; | ||
local rbacServiceAccount = import 'json/rbac-service-account.json'; | ||
local rbacClusterRoleBinding = import 'json/rbac-cluster-binding.json'; | ||
local crdDefn = import 'crd.libsonnet'; | ||
|
||
{ | ||
parts(namespace):: { | ||
|
||
apife(apifeImage,withRbac):: | ||
|
||
local c = baseApife.spec.template.spec.containers[0] + | ||
container.withImage(apifeImage) + | ||
container.withImagePullPolicy("IfNotPresent"); | ||
|
||
local apiFeBase = | ||
baseApife + | ||
deployment.mixin.metadata.withNamespace(namespace) + | ||
deployment.mixin.spec.template.spec.withContainers([c]); | ||
|
||
if withRbac == "true" then | ||
apiFeBase + | ||
deployment.mixin.spec.template.spec.withServiceAccountName("seldon") | ||
else | ||
apiFeBase, | ||
|
||
|
||
apifeService(serviceType):: | ||
|
||
apifeService + | ||
service.metadata.withNamespace(namespace) + | ||
service.spec.withType(serviceType), | ||
|
||
deploymentOperator(engineImage, clusterManagerImage, springOpts, javaOpts, withRbac): | ||
local env = [ | ||
{ name: "JAVA_OPTS", value: javaOpts }, | ||
{ name: "SPRING_OPTS", value: springOpts }, | ||
{ name: "ENGINE_CONTAINER_IMAGE_AND_VERSION", value: engineImage }, | ||
]; | ||
|
||
local c = operatorDeployment.spec.template.spec.containers[0] + | ||
container.withImage(clusterManagerImage) + | ||
container.withEnvMixin(env) + | ||
container.withImagePullPolicy("IfNotPresent"); | ||
|
||
local depOp = operatorDeployment + | ||
deployment.mixin.metadata.withNamespace(namespace) + | ||
deployment.mixin.spec.template.spec.withContainers([c]); | ||
|
||
if withRbac == "true" then | ||
depOp + | ||
deployment.mixin.spec.template.spec.withServiceAccountName("seldon") | ||
else | ||
depOp, | ||
|
||
redisDeployment(): | ||
|
||
redisDeployment + | ||
deployment.mixin.metadata.withNamespace(namespace), | ||
|
||
redisService(): | ||
|
||
redisService + | ||
service.metadata.withNamespace(namespace), | ||
|
||
rbacServiceAccount(): | ||
|
||
rbacServiceAccount, | ||
|
||
rbacClusterRoleBinding(): | ||
|
||
rbacClusterRoleBinding, | ||
|
||
crd(): | ||
|
||
crdDefn.crd(), | ||
|
||
}, // parts | ||
} |
Oops, something went wrong.