-
Notifications
You must be signed in to change notification settings - Fork 2
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 #57 from nlnwa/tensorflow-jupyter
Add tensorflow-jupyter to base/dev
- Loading branch information
Showing
10 changed files
with
151 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Kubernetes deployment of Tensorflow with Jupyter notebook server | ||
|
||
## Get started | ||
|
||
- [Tensorflow in notebooks](https://www.tensorflow.org/tensorboard/tensorboard_in_notebooks) | ||
|
||
## Reference | ||
|
||
1. [Tensorflow dockerfiles](https://www.tensorflow.org/install/docker) |
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,32 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tensorflow-jupyter | ||
labels: | ||
app.kubernetes.io/name: tensorflow-jupyter | ||
app.kubernetes.io/component: tensorflow | ||
|
||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: tensorflow-jupyter | ||
app.kubernetes.io/component: tensorflow | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: tensorflow-jupyter | ||
app.kubernetes.io/component: tensorflow | ||
spec: | ||
containers: | ||
- name: tensorflow-jupyter | ||
image: tensorflow/tensorflow:nightly-jupyter | ||
imagePullPolicy: Always | ||
ports: | ||
- name: http-tb | ||
containerPort: 6006 | ||
protocol: TCP | ||
- name: http-jupyter | ||
containerPort: 8888 | ||
protocol: TCP | ||
|
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: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- service.yaml | ||
- deployment.yaml |
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,21 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: tensorflow-jupyter | ||
labels: | ||
app.kubernetes.io/name: tensorflow-jupyter | ||
app.kubernetes.io/component: tensorflow | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 8888 | ||
name: http-jupyter | ||
targetPort: http-jupyter | ||
protocol: TCP | ||
- port: 6006 | ||
name: http-tb | ||
targetPort: http-tb | ||
protocol: TCP | ||
selector: | ||
app.kubernetes.io/name: tensorflow-jupyter | ||
app.kubernetes.io/component: tensorflow |
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,12 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tensorflow-jupyter | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: tensorflow-jupyter | ||
env: | ||
- name: TENSORBOARD_PROXY_URL | ||
value: https://veidemann.local/tensorboard/ |
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,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tensorflow-jupyter | ||
spec: | ||
template: | ||
spec: | ||
volumes: | ||
- name: jupyter-notebooks | ||
persistentVolumeClaim: | ||
claimName: jupyter-notebooks | ||
- name: jupyter-config | ||
configMap: | ||
name: jupyter-config | ||
containers: | ||
- name: tensorflow-jupyter | ||
volumeMounts: | ||
- name: jupyter-config | ||
mountPath: /root/.jupyter/jupyter_notebook_config.py | ||
subPath: jupyter_notebook_config.py | ||
- name: jupyter-notebooks | ||
mountPath: /tf/notebooks |
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,20 @@ | ||
apiVersion: traefik.containo.us/v1alpha1 | ||
kind: IngressRoute | ||
metadata: | ||
name: tensorflow-jupyter-ingressroute | ||
spec: | ||
entryPoints: | ||
- web | ||
- websecure | ||
routes: | ||
- match: Host(`veidemann.local`) && PathPrefix(`/tensorboard`) | ||
kind: Rule | ||
services: | ||
- name: tensorflow-jupyter | ||
port: 6006 | ||
- match: Host(`veidemann.local`) && PathPrefix(`/jupyter`) | ||
kind: Rule | ||
services: | ||
- name: tensorflow-jupyter | ||
port: 8888 | ||
tls: {} |
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,10 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: jupyter-notebooks | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: 100Mi |
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 @@ | ||
c.NotebookApp.base_url = '/jupyter/' |
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,18 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
namespace: veidemann | ||
|
||
resources: | ||
- ../../../bases/tensorflow-jupyter | ||
- ingressroute.yaml | ||
- jupyter-notebooks-pvc.yaml | ||
|
||
patchesStrategicMerge: | ||
- deployment_volume_patch.yaml | ||
- deployment_env_patch.yaml | ||
|
||
configMapGenerator: | ||
- name: jupyter-config | ||
files: | ||
- jupyter_notebook_config.py |