Deploying on Kubernetes

Kubernetes is an open-source platform for managing containerized applications and workloads across clusters of servers. It automates the deployment, scaling, and orchestration of containers, and provides declarative configuration and automation features.

Requirements

In order to get started, you will need to have a working Kubernetes cluster. You can get a local Kubernetes cluster for testing using a tool like minikube.

Docker Image

The Curiosity Docker Image is available in the official Docker repository, and it is available in an always up-to-date tag (curiosityai/curiosity:latest) and a versioned tag (curiosityai/curiosity:VERSION)

We recommend you locking the image version in production, so you can have more control over deploying updates

Deployment Setup

Curiosity Workspace can be deployed using Docker images on Kubernetes. To run Curiosity on Kubernetes, you needto use a StatefulSet with attached persistent storage. A StatefulSet is a Kubernetes resource that provides stable and unique identities for each pod in the set. Attached storage is a way of providing persistent and durable data volumes for the pods. By using a StatefulSet with attached storage, users can ensure that Curiosity Workspace maintains its state and data across pod restarts and updates.

A typical YAML configuration for such deployment looks like below. Please refer to the Kubernetes documentation for the version of your cluster for more information.

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: curiosity-workspace-stateful
spec:
  replicas: 1
  updateStrategy:
    type: OnDelete
  serviceName: curiosity-workspace-service
  podManagementPolicy: OrderedReady
  volumeClaimTemplates:
    - kind: PersistentVolumeClaim
      apiVersion: v1
      metadata:
        labels: {}
        annotations: {}
        name: curiosity-pvc
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          limits:
            storage: 100Gi
          requests:
            storage: 100Gi
        volumeName: curiosity-data-volume
  template:
     spec:
      volumes:
        - name: curiosity-storage
          persistentVolumeClaim:
            claimName: curiosity-pvc
      containers:
        - name: curiosity-workspace
          image: curiosityai/curiosity:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          env:
            - name: port
              value: '8080'
            - name: storage
              value: /data
          volumeMounts:
            - name: curiosity-storage
              mountPath: /data
              subPath: ''
          resources:
            requests:
              memory: 16Gi
              cpu: '8'
            limits:
              memory: 16Gi
              cpu: '8'

Configuration

Configure Curiosity using environment variables in the template.spec.containers.env section of the deployment configuration. See Configuration for a list of all configurable variables. If not set via configuration variables, the username and password for your first log is admin. You can now follow the steps under Configure your Workspace.

You can define a fixed password for the admin account, and pass it using an environmental variable. You can store this as a secret in Kubernetes.

Last updated