Skip to content

Deploy your Python Dash WEB applications with kubernetes

Notifications You must be signed in to change notification settings

pluralsh/dash-controller

Repository files navigation

Dash controller

Dash controller is responsible to manage lifecycle of DashApplication objects.

Local Kubernets

You can spin up kubernetes cluster using kind. The following script deploy also load balancer and ingress controller.

$ example/kind/run-kind.sh

Installation

Install CRD:

kubectl create -f config/crd/bases

Now you can deploy the controller:

kubectl create -f resources/

Go to example directory to deploy your first dash application

kubectl create -f example/dash_picsum.yaml
apiVersion: dash.plural.sh/v1alpha1
kind: DashApplication
metadata:
  name: picsum
  namespace: default
spec:
  replicas: 1
  container:
    image: "zreigz/dash-picsum:0.1.0"
    containerPort: 8050
  ingress:
    ingressClassName: "nginx"
    path: "/picsum"

The controller will create Deployment, Service and Ingress with the DashApplication name: picsum When you deployed kind cluster the application will be available on this address: http://localhost/picsum