mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-08-19 04:07:42 +00:00
Add "machine-learning-ui deploy with k8s"
This commit is contained in:
@@ -33,3 +33,21 @@ Extra Build ARGs
|
||||
- ``swupd_args`` Specifies [SWUPD](https://github.com/clearlinux/swupd-client/blob/master/docs/swupd.1.rst#options) flags
|
||||
|
||||
Default build args in Docker are on: https://docs.docker.com/engine/reference/builder/#arg
|
||||
|
||||
### Deploy with Kubernetes
|
||||
|
||||
This image can also be deployed on a Kubernetes cluster, such as [minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/).The following example YAML files are provided in the repository as reference for Kubernetes deployment:
|
||||
|
||||
- [`machine-learning-ui-deployment.yaml`](https://github.com/clearlinux/dockerfiles/blob/master/machine-learning-ui/machine-learning-ui-deployment.yaml): example to provide jupyter notebook service.
|
||||
|
||||
|
||||
|
||||
Steps to deploy notebook on a Kubernetes cluster:
|
||||
|
||||
1. Deploy `machine-learning-ui-deployment.yaml`
|
||||
|
||||
```
|
||||
kubectl create -f machine-learning-ui-deployment.yaml
|
||||
```
|
||||
|
||||
2. Navigate to [http://\<nodeIP\>:30001](http://\<nodeIP\>:30001) in your browser, where 30001 is the port number defined in your service.
|
||||
@@ -0,0 +1,39 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ml-notebook
|
||||
labels:
|
||||
app: ml-notebook
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 8888
|
||||
targetPort: 8888
|
||||
nodePort: 30001
|
||||
name: jupyter
|
||||
selector:
|
||||
app: ml-notebook
|
||||
|
||||
---
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ml-notebook
|
||||
labels:
|
||||
app: ml-notebook
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ml-notebook
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ml-notebook
|
||||
spec:
|
||||
containers:
|
||||
- name: jupyter
|
||||
image: "docker.io/clearlinux/machine-learning-ui"
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8888
|
||||
name: jupyter
|
||||
Reference in New Issue
Block a user