Kubernetes Using Helm

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

#Setup

Instill Core currently supports deploying on Kubernetes.

#Cluster setup

We recommend using one of the local Kubernetes solutions:

#kubectl setup

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

Make sure kubectl is configured to connect to the local cluster by


kubectl config use-context <cluster-name>

#Helm setup

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

Check out the Core Helm repository on ArtifactHub.

To add the Core Helm repository, simply run


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

, and


helm repo update

You can then run


helm search repo instill-ai --devel

to see the charts:


NAME CHART VERSION APP VERSION DESCRIPTION
instill-ai/core <chart-version> <app-version> The Helm chart of Instill Core

INFO

Instill Core and its Helm chart are still in a pre-release Alpha version, so the --devel flag is necessary for the access of Helm charts.

#Install

Install the Instill Core chart:


helm install core instill-ai/core --devel --namespace instill-ai --create-namespace --set tags.prometheusStack=true

And visit the api-gateway (http://localhost:8080) and Console (http://localhost:3000) by port forwarding:


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}")
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}")
export JAEGER_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=query,app.kubernetes.io/instance=core" -o jsonpath="{.items[0].metadata.name}")
export JAEGER_CONTAINER_PORT=$(kubectl get pod --namespace instill-ai $JAEGER_POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
export PROMETHEUS_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=metrics,app.kubernetes.io/instance=core" -o jsonpath="{.items[0].metadata.name}")
export PROMETHEUS_CONTAINER_PORT=$(kubectl get pod --namespace instill-ai $PROMETHEUS_POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
export GRAFANA_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=core" -o jsonpath="{.items[0].metadata.name}")
export GRAFANA_CONTAINER_PORT=$(kubectl get pod --namespace instill-ai $GRAFANA_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}
kubectl --namespace instill-ai port-forward $CONSOLE_POD_NAME 3000:${CONSOLE_CONTAINER_PORT}

Access to the observability stack Jaeger (http://localhost:16686), and the Prometheus stack Prometheus (http://localhost:9090) and Grafana (http://localhost:3002) by port forwarding:


kubectl --namespace instill-ai port-forward $JAEGER_POD_NAME 16686:${JAEGER_CONTAINER_PORT}
kubectl --namespace instill-ai port-forward $PROMETHEUS_POD_NAME 9090:${PROMETHEUS_CONTAINER_PORT}
kubectl --namespace instill-ai port-forward $GRAFANA_POD_NAME 3002:${GRAFANA_CONTAINER_PORT}

#Uninstall

To uninstall the chart:


helm uninstall core --namespace instill-ai

and clean up all Instill Core related persistent volumes:


kubectl delete pvc --all -n instill-ai
kubectl delete namespace instill-ai

Last updated: 3/21/2024, 1:42:31 PM