diff --git a/K8/JupyterNotebook/jupyter_notebook_pod_deployment.yaml b/K8/JupyterNotebook/jupyter_notebook_pod_deployment.yaml index fd2d0f6d..0d4e28ba 100644 --- a/K8/JupyterNotebook/jupyter_notebook_pod_deployment.yaml +++ b/K8/JupyterNotebook/jupyter_notebook_pod_deployment.yaml @@ -1,21 +1,18 @@ apiVersion: v1 # Jobs Default K8 API kind: Pod # This tells kubernetes what kind of class it is working with metadata: - name: stimuli-pipeline # + name: pipeline-jupyter # labels: - app: stimuli-pipeline-jupyter # Reference this in your service + app: pipeline-jupyter # Reference this in your service spec: restartPolicy: Never # Options are OnFailure, and Never. - hostNetwork: true # This option will allow the pod to use the host network for internet access volumes: - name: mnt hostPath: path: /mnt # Directory on the host machine to be mounted - imagePullSecrets: - - name: docker-credentials containers: # Container Level - - name: stimuli-pipeline # Container name (Can be set to whatever) - image: ninai/stimuli # Docker Image hosted on Docker Hub + - name: pipeline # Container name (Can be set to whatever) + image: ninai/pipeline:latest # Docker Image hosted on Docker Hub ports: - containerPort: 8888 volumeMounts: # Container reference to volumes define above @@ -47,21 +44,26 @@ spec: secretKeyRef: name: github-credentials key: GITHUB_PASSWORD + workingDir: /src command: ["/bin/bash"] # Entry point for the container - args: ["-c", "pip3 install jupyter \ - && jupyter notebook --ip='*' --port=8888 --allow-root --no-browser --NotebookApp.token=${GITHUB_PASSWORD}"] # sh commands to clone and run python script + # Override the git pull below to pull your own fork, otherwise it clones the default master one from Cajal + args: ["-c", "pip3 install jupyter &&\ + rm -r /data &&\ + git clone https://$(GITHUB_USERNAME):$(GITHUB_PASSWORD)@github.com/cajal/pipeline.git &&\ + jupyter notebook --ip='*' --port=8888 --allow-root --no-browser --NotebookApp.token=${GITHUB_PASSWORD}"] --- + +# This is the node port service. After deployment run kubectl get svc to get the nodeport that was assign to this pod then go do : (should be in the range of 30000-32767) kind: Service apiVersion: v1 metadata: - name: stimuli-pipeline-jupyter-service + name: pipeline-jupyter spec: type: NodePort selector: - app: stimuli-pipeline-jupyter + app: pipeline-jupyter ports: - protocol: TCP - nodePort: 30000 # Port might be taken so switch it to something else port: 8888 targetPort: 8888 \ No newline at end of file