Deploy with Helm#
This guide provides step-by-step instructions for deploying the Wind Turbine Anomaly Detection sample application using Helm.
Prerequisites#
K8s installation on single or multi node must be done as prerequisite to continue the following deployment. Note: The Kubernetes cluster is set up with
kubeadm
,kubectl
andkubelet
packages on single and multi nodes withv1.30.2
. Refer to tutorials such as https://adamtheautomator.com/installing-kubernetes-on-ubuntu and many other online tutorials to setup kubernetes cluster on the web with host OS as Ubuntu 22.04.For Helm installation, refer to helm website
Note If Ubuntu Desktop is not installed on the target system, follow the instructions from Ubuntu to install Ubuntu desktop. The target system refers to the system where you are installing the application.
Step 1: Generate or download the Helm charts#
You can either generate or download the Helm charts.
To download the Helm charts:
Follow this procedure on the target system to install the package.
Download Helm chart with the following command:
helm pull oci://registry-1.docker.io/intel/wind-turbine-anomaly-detection-sample-app --version 1.0.0
unzip the package using the following command:
tar -xvzf wind-turbine-anomaly-detection-sample-app-1.0.0.tgz
Get into the Helm directory:
cd wind-turbine-anomaly-detection-sample-app
To generate the Helm charts:
cd edge-ai-suites/manufacturing-ai-suite/wind-turbine-anomaly-detection # path relative to git clone folder make gen_helm_charts cd helm/
Step 2: Configure and update the environment variables#
Update the following fields in
values.yaml
file of the helm chartINFLUXDB_USERNAME: INFLUXDB_PASSWORD: VISUALIZER_GRAFANA_USER: VISUALIZER_GRAFANA_PASSWORD: POSTGRES_PASSWORD: MINIO_ACCESS_KEY: MINIO_SECRET_KEY: HTTP_PROXY: # example: http_proxy: http://proxy.example.com:891 HTTPS_PROXY: # example: http_proxy: http://proxy.example.com:891
Step 3: Install Helm charts#
To install Helm charts, use one of the following options:
Note:
Uninstall the Helm charts if already installed.
Note the
helm install
command fails if the above required fields are not populated as per the rules called out invalues.yaml
file.
OPC-UA ingestion flow:
helm install ts-wind-turbine-anomaly --set env.TELEGRAF_INPUT_PLUGIN=opcua . -n ts-wind-turbine-anomaly-app --create-namespace
MQTT ingestion flow:
helm install ts-wind-turbine-anomaly --set env.TELEGRAF_INPUT_PLUGIN=mqtt_consumer . -n ts-wind-turbine-anomaly-app --create-namespace
Use the following command to verify if all the application resources got installed w/ their status:
kubectl get all -n ts-wind-turbine-anomaly-app
Step 4: Copy the windturbine_anomaly_detection udf package for helm deployment to Time Series Analytics Microservice#
To copy your own or existing model into Time Series Analytics Microservice in order to run this sample application in Kubernetes environment:
The following udf package is placed in the repository under
time_series_analytics_microservice
.- time_series_analytics_microservice/ - models/ - windturbine_anomaly_detector.pkl - tick_scripts/ - windturbine_anomaly_detector.tick - udfs/ - requirements.txt - windturbine_anomaly_detector.py
Copy your new UDF package (using the windturbine anomaly detection UDF package as an example) to the
time-series-analytics-microservice
pod:cd edge-ai-suites/manufacturing-ai-suite/wind-turbine-anomaly-detection # path relative to git clone folder cd time_series_analytics_microservice mkdir windturbine_anomaly_detector cp -r models tick_scripts udfs windturbine_anomaly_detector/. POD_NAME=$(kubectl get pods -n ts-wind-turbine-anomaly-app -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-time-series-analytics-microservice | head -n 1) kubectl cp windturbine_anomaly_detector $POD_NAME:/tmp/ -n ts-wind-turbine-anomaly-app
Note:
Run the commands only after performing the Helm install.
Step 5: Activate the New UDF Deployment Package#
Run the following command to activate the UDF deployment package:
curl -X 'GET' \
'http://<HOST_IP>:30002/config?restart=true' \
-H 'accept: application/json'
Step 6: Verify the Wind Turbine Anomaly Detection Results#
To verify the Wind Turbine Anomaly Detection Results, follow the steps here.
Uninstall Helm Charts#
To uninstall Helm charts:
helm uninstall ts-wind-turbine-anomaly -n ts-wind-turbine-anomaly-app
kubectl get all -n ts-wind-turbine-anomaly-app # It may take a few minutes for all application resources to be cleaned up.
Configure Alerts in Time Series Analytics Microservice#
To configure alerts in Time Series Analytics Microservice, follow the steps here.
Deploy the Application with a Custom UDF#
To deploy the application with a custom UDF, follow the steps here.
Deploy the Application with a Custom UDF by Uploading to the Model Registry#
To deploy a custom UDF by uploading it to the Model Registry, follow the steps here.
Troubleshooting#
Check pod details or container logs to diagnose failures:
kubectl get pods -n ts-wind-turbine-anomaly-app kubectl describe pod <pod_name> -n ts-wind-turbine-anomaly-app # Shows details of the pod kubectl logs -f <pod_name> -n ts-wind-turbine-anomaly-app # Shows logs of the container in the pod