Kubernetes

As the SDK is available as a Docker image, it can easily be deployed to Kubernetes. The following example shows how to deploy the SDK to Kubernetes with a simple config file.

apiVersion: v1
kind: Namespace
metadata:
  name: synthesized
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: synth
  namespace: synthesized
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 8Gi
---
apiVersion: v1
data:
  SYNTHESIZED_KEY: {YOUR_LICENSE_KEY}
kind: Secret
metadata:
  creationTimestamp: null
  name: synth
  namespace: synthesized
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: synth
  namespace: synthesized
spec:
  replicas: 1
  selector:
    matchLabels:
      tag: synth
  template:
    metadata:
      labels:
        tag: synth
    spec:
      containers:
      - name: synthesized
        image: synthesizedio/sdk-jupyter-server:{VERSION_TAG}
        envFrom:
        - secretRef:
            name: synth
---
apiVersion: v1
kind: Service
metadata:
  name: synthesized-entrypoint
  namespace: synthesized
spec:
  type: NodePort
  selector:
    tag: synth
  ports:
  - port: 8888
    targetPort: 8888
    nodePort: 30001

You should replace {YOUR_LICENCE_KEY} with your Synthesized licence key and {VERSION_TAG} with the tag of the desired image, available on Docker Hub.

The above config file creates a namespace, a persistent volume claim, a secret, and a deployment. The deployment creates a single pod with the SDK image. The pod is exposed via a service on port 8888. The service is exposed on port 30001 on the node. The secret contains the license key for the SDK.

The following command can be used to deploy the config file to Kubernetes:

kubectl apply -f synth.yaml