Kubernetes

Kubernetes offers an elastic way of managing Instill Core CE to persist services and scale resources horizontally and vertically.

Prerequisites

  • Kubernetes cluster

  • kubectl

    • Make sure the Kubernetes CLI tool kubectl has been installed in your environment. If not, please follow the official instructions to install.
  • helm

    • Make sure Helm has been installed in your environment. If not, please follow the official instructions to install.

Setup

Local Deployment

Instill Core Helm chart installation requires dependencies including MinIO, Ray, Milvus, etc., to be installed in the cluster in advance with the values.yaml file configured accordingly. For local deployment, the easiest way is by running:

git clone -b $VERSION https://github.com/instill-ai/instill-core.git && cd instill-core
make helm-run

Be sure to replace $VERSION with the latest release tag.

🚧

The code in the main branch reflects ongoing development progress for the next release and may not work as expected. If you'd like to access the cutting-edge version of Instill Core CE, simply run make latest.

Production Deployment

We provide the Instill Core CE Helm chart on Artifact Hub for you to deploy Instill Core CE in your production Kubernetes cluster, assuming the dependencies including MinIO, Ray, Milvus, etc., are already installed in the cluster.

To add the Core Helm repository, run:

helm repo add instill-ai https://helm.instill-ai.com

Then update the repository:

helm repo update

You can then run:

helm search repo instill-ai

to see the charts:

NAME            CHART VERSION   APP VERSION     DESCRIPTION                   
instill-ai/core $CHART_VERSION  $APP_VERSION    The Helm chart of Instill Core

The CHART_VERSION and APP_VERSION are the latest version of the Instill Core CE Helm chart and application respectively.

You can install the Instill Core Helm chart by running:

helm install core instill-ai/core --namespace instill-ai --create-namespace \
  --set ...

Accessing the Services

To access the api-gateway ({user.ApiBaseUrl}) and Console ({user.consoleBaseUrl}) by port forwarding, run:

export API_GATEWAY_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=api-gateway,app.kubernetes.io/instance=core" -o jsonpath="{.items[0].metadata.name}")

export API_GATEWAY_CONTAINER_PORT=$(kubectl get pod --namespace instill-ai $API_GATEWAY_POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")

kubectl --namespace instill-ai port-forward $API_GATEWAY_POD_NAME 8080:$API_GATEWAY_CONTAINER_PORT

export CONSOLE_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=console,app.kubernetes.io/instance=core" -o jsonpath="{.items[0].metadata.name}")

export CONSOLE_CONTAINER_PORT=$(kubectl get pod --namespace instill-ai $CONSOLE_POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")

kubectl --namespace instill-ai port-forward $CONSOLE_POD_NAME 3000:$CONSOLE_CONTAINER_PORT

To access Grafana (http://localhost:3001) by port forwarding, run:

export GRAFANA_POD_NAME=$(kubectl get pods --namespace observability -l "app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}")

export GRAFANA_CONTAINER_PORT=$(kubectl get pod --namespace observability $GRAFANA_POD_NAME -o jsonpath="{.spec.containers[?(@.name=='grafana')].ports[?(@.name=='grafana')].containerPort}")

kubectl --namespace observability port-forward $GRAFANA_POD_NAME 3001:$GRAFANA_CONTAINER_PORT

To access Ray (http://localhost:8265) by port forwarding, run:

export RAYCLUSTER_HEAD_POD_NAME=$(kubectl get pods --namespace ray -l "ray.io/identifier=raycluster-head" -o jsonpath="{.items[0].metadata.name}")

export RAYCLUSTER_HEAD_CONTAINER_PORT=$(kubectl get pod --namespace ray $RAYCLUSTER_HEAD_POD_NAME -o jsonpath="{.spec.containers[?(@.name=='raycluster-head')].ports[?(@.name=='dashboard')].containerPort}")

kubectl --namespace ray port-forward $RAYCLUSTER_HEAD_POD_NAME 8265:$RAYCLUSTER_HEAD_CONTAINER_PORT

Teardown

To teardown and clean up all Instill Core resources, run:

make helm-down