Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow clustering with Kubernetes #2675

Merged
merged 6 commits into from
Jul 1, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions docs/deployment/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,95 @@ services:
- LIVEBOOK_IFRAME_PORT=8091
```

### Kubernetes

If using k8s the following template if a good starting point:
josevalim marked this conversation as resolved.
Show resolved Hide resolved

```yml
apiVersion: v1
kind: Service
metadata:
name: livebook-headless
spec:
clusterIP: None
selector:
app: livebook

---

apiVersion: v1
kind: Service
metadata:
name: livebook-loadbalancer
spec:
type: LoadBalancer
ports:
- port: 8080
targetPort: 8080
selector:
app: livebook

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: livebook
spec:
replicas: 3
selector:
matchLabels:
app: livebook
template:
metadata:
labels:
app: livebook
spec:
containers:
- name: livebook
image: ghcr.io/livebook-dev/livebook:latest
ports:
- containerPort: 8080
env:
- name: LIVEBOOK_IP
value: "0.0.0.0"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: LIVEBOOK_NODE
value: "livebook@$(POD_IP)"
- name: LIVEBOOK_CLUSTER
value: "dns:livebook-headless.$(POD_NAMESPACE).svc.cluster.local"
- name: LIVEBOOK_SECRET_KEY_BASE
aleDsz marked this conversation as resolved.
Show resolved Hide resolved
valueFrom:
secretKeyRef:
name: livebook-secret
key: LIVEBOOK_COOKIE
aleDsz marked this conversation as resolved.
Show resolved Hide resolved
- name: LIVEBOOK_COOKIE
valueFrom:
secretKeyRef:
name: livebook-secret
key: LIVEBOOK_COOKIE

---

apiVersion: v1
kind: Secret
metadata:
name: livebook-secret
namespace: livebook-namespace
aleDsz marked this conversation as resolved.
Show resolved Hide resolved
type: Opaque
data:
LIVEBOOK_PASSWORD: <base64_encoded_password>
LIVEBOOK_SECRET_KEY_BASE: <base64_encoded_password>
LIVEBOOK_COOKIE: <base64_encoded_password>
```

## Deploy notebooks as applications

It is possible to deploy any notebook as an application in Livebook. Inside the notebook, open up the Application pane on the sidebar (with a rocket icon), click "Deploy with Docker", and follow the required steps. You will be able to choose a Livebook image, preset clustering options, and more.
Expand Down
Loading