You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by ji...@apache.org on 2020/07/08 00:23:00 UTC

[submarine] branch master updated: SUBMARINE-557. Install notebook controller with helm chart

This is an automated email from the ASF dual-hosted git repository.

jiwq pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new c5b256f  SUBMARINE-557. Install notebook controller with helm chart
c5b256f is described below

commit c5b256ffcbb46d8a491c3fb9a4112610ca740e33
Author: Ryan Lo <lo...@gmail.com>
AuthorDate: Sun Jul 5 11:17:40 2020 +0800

    SUBMARINE-557. Install notebook controller with helm chart
    
    ### What is this PR for?
    Create a notebook-controller chart which used to deploy a notebook controller and upload the Notebook CRD.
    
    ### What type of PR is it?
    [Improvement]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    [SUBMARINE-557](https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-557)
    
    ### How should this be tested?
    [Travis CI](https://travis-ci.org/github/lowc1012/submarine/builds/704929973)
    
    ### Screenshots (if appropriate)
    <img width="626" alt="image1" src="https://user-images.githubusercontent.com/52355146/86514274-f8887480-be43-11ea-829c-db7fe6d6b587.png">
    <img width="700" alt="image2" src="https://user-images.githubusercontent.com/52355146/86514292-1524ac80-be44-11ea-8edd-b82bc5af07a0.png">
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Ryan Lo <lo...@gmail.com>
    
    Closes #340 from lowc1012/SUBMARINE-557 and squashes the following commits:
    
    2d69805 [Ryan Lo] SUBMARINE-557. update helm.md
    0a09b51 [Ryan Lo] SUBMARINE-557. Install notebook controller with helm chart
---
 docs/userdocs/k8s/helm.md                          |  14 ++-
 .../charts/notebook-controller/.helmignore         |  39 +++++++
 .../charts/notebook-controller/Chart.yaml          |  37 ++++++
 .../charts/notebook-controller/crds/crd.yaml       |  80 +++++++++++++
 .../templates/cluster-role-binding.yaml            |  30 +++++
 .../templates/cluster-role.yaml                    | 128 +++++++++++++++++++++
 .../notebook-controller/templates/deployment.yaml  |  49 ++++++++
 .../templates/service-account.yaml                 |  22 ++++
 .../notebook-controller/templates/service.yaml     |  28 +++++
 .../charts/notebook-controller/values.yaml         |  16 +++
 10 files changed, 438 insertions(+), 5 deletions(-)

diff --git a/docs/userdocs/k8s/helm.md b/docs/userdocs/k8s/helm.md
index 28997ff..aab95e0 100644
--- a/docs/userdocs/k8s/helm.md
+++ b/docs/userdocs/k8s/helm.md
@@ -67,11 +67,12 @@ kubectl get pods
 ```
 
 ```bash
-NAME                                 READY     STATUS    RESTARTS   AGE
-pytorch-operator-54854bf847-x65nk    1/1       Running   0          5m
-submarine-database-5f74f747d-dzmf6   1/1       Running   0          5m
-submarine-server-6f449bc967-cqkkv    1/1       Running   0          5m
-tf-job-operator-c9cd7ccbd-4dzcs      1/1       Running   0          5m
+NAME                                              READY   STATUS    RESTARTS   AGE
+notebook-controller-deployment-5db8b6cbf7-k65jm   1/1     Running   0          5s
+pytorch-operator-7ff5d96d59-gx7f5                 1/1     Running   0          5s
+submarine-database-8d95d74f7-ntvqp                1/1     Running   0          5s
+submarine-server-b6cd4787b-7bvr7                  1/1     Running   0          5s
+tf-job-operator-7844656dd-lfgmd                   1/1     Running   0          5s
 ```
 
 ### Enable local access to Submarine Server
@@ -111,3 +112,6 @@ Build submarine database image:
 ```bash
 ./dev-support/docker-images/database/build.sh
 ```
+
+### Using Jupyter notebooks in Submarine
+Please refer to [Notebook guide](notebook.md) if you want to use jupyter notebook in Submarine.
diff --git a/helm-charts/submarine/charts/notebook-controller/.helmignore b/helm-charts/submarine/charts/notebook-controller/.helmignore
new file mode 100644
index 0000000..7887c2c
--- /dev/null
+++ b/helm-charts/submarine/charts/notebook-controller/.helmignore
@@ -0,0 +1,39 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/helm-charts/submarine/charts/notebook-controller/Chart.yaml b/helm-charts/submarine/charts/notebook-controller/Chart.yaml
new file mode 100644
index 0000000..f7024f3
--- /dev/null
+++ b/helm-charts/submarine/charts/notebook-controller/Chart.yaml
@@ -0,0 +1,37 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v2
+name: notebook-controller
+description: A Helm chart for Kubernetes
+
+# A chart can be either an 'application' or a 'library' chart.
+#
+# Application charts are a collection of templates that can be packaged into versioned archives
+# to be deployed.
+#
+# Library charts provide useful utilities or functions for the chart developer. They're included as
+# a dependency of application charts to inject those utilities and functions into the rendering
+# pipeline. Library charts do not define any templates and therefore cannot be deployed.
+type: application
+
+# This is the chart version. This version number should be incremented each time you make changes
+# to the chart and its templates, including the app version.
+version: 0.1.0
+
+# This is the version number of the application being deployed. This version number should be
+# incremented each time you make changes to the application.
+appVersion: 1.0.0
diff --git a/helm-charts/submarine/charts/notebook-controller/crds/crd.yaml b/helm-charts/submarine/charts/notebook-controller/crds/crd.yaml
new file mode 100644
index 0000000..390f5c7
--- /dev/null
+++ b/helm-charts/submarine/charts/notebook-controller/crds/crd.yaml
@@ -0,0 +1,80 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: notebooks.kubeflow.org
+spec:
+  group: kubeflow.org
+  names:
+    kind: Notebook
+    plural: notebooks
+    singular: notebook
+  scope: Namespaced
+  subresources:
+    status: {}
+  versions:
+  - name: v1alpha1
+    served: true
+    storage: false
+  - name: v1beta1
+    served: true
+    storage: true
+  - name: v1
+    served: true
+    storage: false
+  validation:
+    openAPIV3Schema:
+      properties:
+        apiVersion:
+          description: 'APIVersion defines the versioned schema of this representation
+            of an object. Servers should convert recognized schemas to the latest
+            internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
+          type: string
+        kind:
+          description: 'Kind is a string value representing the REST resource this
+            object represents. Servers may infer this from the endpoint the client
+            submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
+          type: string
+        metadata:
+          type: object
+        spec:
+          properties:
+            template:
+              description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+                Important: Run "make" to regenerate code after modifying this file'
+              properties:
+                spec:
+                  type: object
+              type: object
+          type: object
+        status:
+          properties:
+            conditions:
+              description: Conditions is an array of current conditions
+              items:
+                properties:
+                  type:
+                    description: Type of the confition/
+                    type: string
+                required:
+                - type
+                type: object
+              type: array
+          required:
+          - conditions
+          type: object
diff --git a/helm-charts/submarine/charts/notebook-controller/templates/cluster-role-binding.yaml b/helm-charts/submarine/charts/notebook-controller/templates/cluster-role-binding.yaml
new file mode 100644
index 0000000..f06b165
--- /dev/null
+++ b/helm-charts/submarine/charts/notebook-controller/templates/cluster-role-binding.yaml
@@ -0,0 +1,30 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: notebook-controller-role-binding
+  labels:
+    app: notebook-controller
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: role
+subjects:
+- kind: ServiceAccount
+  name: notebook-controller-service-account
+  namespace: {{ .Release.Namespace }}
diff --git a/helm-charts/submarine/charts/notebook-controller/templates/cluster-role.yaml b/helm-charts/submarine/charts/notebook-controller/templates/cluster-role.yaml
new file mode 100644
index 0000000..bf7e976
--- /dev/null
+++ b/helm-charts/submarine/charts/notebook-controller/templates/cluster-role.yaml
@@ -0,0 +1,128 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: notebook-controller-role
+  labels:
+    app: notebook-controller
+rules:
+- apiGroups:
+  - apps
+  resources:
+  - statefulsets
+  - deployments
+  verbs:
+  - '*'
+- apiGroups:
+  - ""
+  resources:
+  - pods
+  verbs:
+  - get
+  - list
+  - watch
+- apiGroups:
+  - ""
+  resources:
+  - services
+  verbs:
+  - '*'
+- apiGroups:
+  - ""
+  resources:
+  - events
+  verbs:
+  - get
+  - list
+  - watch
+  - create
+- apiGroups:
+  - kubeflow.org
+  resources:
+  - notebooks
+  - notebooks/status
+  - notebooks/finalizers
+  verbs:
+  - '*'
+- apiGroups:
+  - networking.istio.io
+  resources:
+  - virtualservices
+  verbs:
+  - '*'
+
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: kubeflow-notebooks-admin
+  labels:
+    app: notebook-controller
+    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-admin: "true"
+aggregationRule:
+  clusterRoleSelectors:
+  - matchLabels:
+      rbac.authorization.kubeflow.org/aggregate-to-kubeflow-notebooks-admin: "true"
+rules: []
+
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: kubeflow-notebooks-edit
+  labels:
+    app: notebook-controller
+    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-edit: "true"
+    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-notebooks-admin: "true"
+rules:
+- apiGroups:
+  - kubeflow.org
+  resources:
+  - notebooks
+  - notebooks/status
+  verbs:
+  - get
+  - list
+  - watch
+  - create
+  - delete
+  - deletecollection
+  - patch
+  - update
+
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: kubeflow-notebooks-view
+  labels:
+    app: notebook-controller
+    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-view: "true"
+rules:
+- apiGroups:
+  - kubeflow.org
+  resources:
+  - notebooks
+  - notebooks/status
+  verbs:
+  - get
+  - list
+  - watch
diff --git a/helm-charts/submarine/charts/notebook-controller/templates/deployment.yaml b/helm-charts/submarine/charts/notebook-controller/templates/deployment.yaml
new file mode 100644
index 0000000..ae6a59e
--- /dev/null
+++ b/helm-charts/submarine/charts/notebook-controller/templates/deployment.yaml
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: notebook-controller-deployment
+  labels:
+    app: notebook-controller
+spec:
+  selector:
+    matchLabels:
+      app: notebook-controller
+  template:
+    metadata:
+      annotations:
+        sidecar.istio.io/inject: "false"
+      labels:
+        app: notebook-controller
+    spec:
+      containers:
+      - name: manager
+        image: gcr.io/kubeflow-images-public/notebook-controller:v1.1.0-g253890cb
+        command:
+          - /manager
+        imagePullPolicy: IfNotPresent
+        env:
+        - name: USE_ISTIO
+          value: "false"
+        livenessProbe:
+          httpGet:
+            path: /metrics
+            port: 8080
+          initialDelaySeconds: 30
+          periodSeconds: 30
+      serviceAccountName: notebook-controller-service-account
diff --git a/helm-charts/submarine/charts/notebook-controller/templates/service-account.yaml b/helm-charts/submarine/charts/notebook-controller/templates/service-account.yaml
new file mode 100644
index 0000000..54aa359
--- /dev/null
+++ b/helm-charts/submarine/charts/notebook-controller/templates/service-account.yaml
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: notebook-controller-service-account
+  labels:
+    app: notebook-controller
diff --git a/helm-charts/submarine/charts/notebook-controller/templates/service.yaml b/helm-charts/submarine/charts/notebook-controller/templates/service.yaml
new file mode 100644
index 0000000..d133a68
--- /dev/null
+++ b/helm-charts/submarine/charts/notebook-controller/templates/service.yaml
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v1
+kind: Service
+metadata:
+  name: notebook-controller-service
+  labels:
+    app: notebook-controller
+spec:
+  type: ClusterIP
+  selector:
+    app: notebook-controller
+  ports:
+  - port: 443
diff --git a/helm-charts/submarine/charts/notebook-controller/values.yaml b/helm-charts/submarine/charts/notebook-controller/values.yaml
new file mode 100644
index 0000000..cce3aca
--- /dev/null
+++ b/helm-charts/submarine/charts/notebook-controller/values.yaml
@@ -0,0 +1,16 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org