Browse Source

Merge pull request #87 from j0hnL/issue-86

moved jupyterhub install
Lucas A. Wilson 4 years ago
parent
commit
0d90a3ce73

+ 22 - 0
kubernetes/jupyterhub.yaml

@@ -0,0 +1,22 @@
+#  Copyright 2020 Dell Technologies
+#
+#  Licensed 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.
+
+---
+#Playbook for installing JupyterHub v1.1.0 in Omnia
+ 
+# Start K8s worker servers
+- hosts: master
+  gather_facts: false
+  roles:
+    - jupyterhub

+ 1 - 1
kubernetes/roles/startservices/files/jupyter_config.yaml

@@ -32,7 +32,7 @@ singleuser:
   cpu:
     limit: 1
   memory:
-    limit: 100G
+    limit: 5G
     guarantee: 1G
   defaultUrl: "/lab"
 

+ 26 - 0
kubernetes/roles/jupyterhub/tasks/main.yml

@@ -0,0 +1,26 @@
+#  Copyright 2020 Dell Technologies
+#
+#  Licensed 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.
+
+---
+- name: Helm - Add JupyterHub Repo
+  shell: helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
+
+- name: Helm - Update Repo
+  shell: helm repo update
+
+- name: JupyterHub Custom Config (files)  
+  copy: src=jupyter_config.yaml dest=/root/k8s/jupyter_config.yaml owner=root group=root mode=655
+ 
+- name: jupyterHub deploy
+  shell: helm install jupyterhub/jupyterhub  --namespace default --version 0.9.0 --values /root/k8s/jupyter_config.yaml --generate-name --wait --timeout 60m

+ 0 - 16
kubernetes/roles/startservices/files/jhub-db-pv.yaml

@@ -1,16 +0,0 @@
-apiVersion: v1
-kind: PersistentVolume
-metadata:
-  name: jupyterhub-db-pv
-spec:
-  capacity:
-    storage: 1Gi
-  accessModes:
-  - ReadWriteOnce
-  - ReadOnlyMany
-  - ReadWriteMany
-  nfs:
-    server: 10.0.0.1
-    path: /work/k8s/jhub-db
-  persistentVolumeReclaimPolicy: Recycle
-

+ 0 - 50
kubernetes/roles/startservices/files/jupyter-pvc.yaml

@@ -1,50 +0,0 @@
-apiVersion: v1 
-kind: PersistentVolume 
-metadata: 
-  name: jupyter-nfs
-spec: 
-  capacity: 
-    storage: 1Gi 
-  accessModes: 
-    - ReadWriteMany 
-  nfs: 
-    server: 10.0.0.1
-    path: "/work/jupyter1" 
-
----
-apiVersion: v1 
-kind: PersistentVolume 
-metadata: 
-  name: jupyter-hub-nfs
-spec: 
-  capacity: 
-    storage: 1Gi 
-  accessModes: 
-    - ReadWriteMany 
-  nfs: 
-    server: 10.0.0.1
-    path: "/work/jupyter2" 
- 
---- 
-kind: PersistentVolumeClaim 
-apiVersion: v1 
-metadata: 
-  name: jupyter-nfs-pvc
-spec: 
-  accessModes: 
-    - ReadWriteMany 
-  storageClassName: "nfs" 
-  resources: 
-    requests: 
-
---- 
-kind: PersistentVolumeClaim 
-apiVersion: v1 
-metadata: 
-  name: jupyter-hub-nfs-pvc
-spec: 
-  accessModes: 
-    - ReadWriteMany 
-  storageClassName: "nfs" 
-  resources: 
-    requests: 

+ 0 - 48
kubernetes/roles/startservices/tasks/main.yml

@@ -41,34 +41,6 @@
   shell: kubectl apply -f /root/k8s/metal-config.yaml
   tags: init
 
-#- name: Helm - create service account
-  #shell: kubectl create serviceaccount --namespace kube-system tiller
-  #tags: init
-
-#- name: Helm - create clusterRole Binding for tiller-cluster-rule
-  #shell: kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
-  #tags: init
-
-#- name: Helm - create clusterRoleBinding for admin
-  #shell: kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
-  #tags: init
-
-#- name: Helm - init
-  #shell: helm init  --upgrade
-  #tags: init
-
-#- name: Wait for tiller to start 
-  #shell: kubectl rollout status deployment/tiller-deploy -n kube-system
-  #tags: init
-
-#- name: Helm - patch cluster Role Binding for tiller
-  #shell:  kubectl --namespace kube-system patch deploy tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
-  #tags: init
-
-#- name: Wait for tiller to start 
-  #shell: kubectl rollout status deployment/tiller-deploy -n kube-system
-  #tags: init
-
 - name: Start K8S Dashboard
   shell: kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta6/aio/deploy/recommended.yaml
   tags: init
@@ -77,10 +49,6 @@
   shell: helm repo add stable https://kubernetes-charts.storage.googleapis.com/
   tags: init
 
-- name: Helm - Add JupyterHub Repo
-  shell: helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
-  tags: init
-
 - name: Helm - Update Repo
   shell: helm repo update
   tags: init
@@ -93,22 +61,6 @@
   shell: "kubectl patch storageclasses.storage.k8s.io nfs-client -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}'"
   tags: init
 
-- name: JupyterHub Persistent Volume Creation (files)  
-  copy: src=jhub-db-pv.yaml dest=/root/k8s/jhub-db-pv.yaml owner=root group=root mode=655
-  tags: init
-
-- name: jupyterHub Persistent Volume creation
-  shell: kubectl create -f /root/k8s/jhub-db-pv.yaml
-  tags: init
-
-- name: JupyterHub Custom Config (files)  
-  copy: src=jupyter_config.yaml dest=/root/k8s/jupyter_config.yaml owner=root group=root mode=655
-  tags: init
- 
-- name: jupyterHub deploy
-  shell: helm install jupyterhub/jupyterhub  --namespace default --version 0.9.0 --values /root/k8s/jupyter_config.yaml --generate-name
-  tags: init
-
 - name: Prometheus deployment
   shell: helm install stable/prometheus --set alertmanager.persistentVolume.storageClass=nfs-client,server.persistentVolume.storageClass=nfs-client,server.service.type=LoadBalancer --generate-name
   tags: init