Create Helm Chart
About OpenBB
Section titled “About OpenBB”The OpenBB Platform is a unified financial data interface that simplifies API management for developers and analysts.
Key Benefits:
- Single API Access — Connect to multiple data providers without managing separate integrations
- High-Quality Data — Access reliable market data across stocks, crypto, forex, and more
- Easy Integration — Deploy as a containerized service for consistent environments
Overview
Section titled “Overview”This guide demonstrates how to containerize the OpenBB API Server using Helm charts, enabling you to deploy it consistently across Kubernetes clusters with standard deployment tools.
Prerequisites
Section titled “Prerequisites”Before proceeding, ensure you have the following tools installed:
- Helm 3.x or later — Installation Guide
- Docker — For building custom OpenBB images
Build Custom Docker Image
Section titled “Build Custom Docker Image”Since the official image might be outdated, we recommend building your own Docker image from the latest source code.
-
Clone the OpenBB repository
Start by cloning the repository and checking out a stable version:
Terminal window git clone https://github.com/OpenBB-finance/OpenBB.gitcd OpenBB# Switch to a specific version (e.g., v4.6.0)git checkout v4.6.0 -
Build and push the Docker image
The OpenBB repository includes a pre-configured Dockerfile at
build/docker/platform.dockerfile. Use this directly:Terminal window # Build the image with the version tagdocker build -f build/docker/platform.dockerfile -t <registry_url>/openbb:v4.6.0 .After building, push the image to your registry:
Terminal window docker push <registry_url>/openbb:v4.6.0
Create and Package Helm Chart
Section titled “Create and Package Helm Chart”-
Create a new Helm chart
Terminal window helm create openbbThis generates a directory named
openbbwith the standard Helm chart structure, including templates for Deployment, Service, and ConfigMaps. -
Configure the Helm
Edit
openbb/Chart.yamlto match your release metadata. You can add additional details likeicon,home, andmaintainersfor better discoverability:openbb/Chart.yaml apiVersion: v2name: openbbdescription: A Helm chart for deploying the OpenBB Platform APItype: applicationversion: 0.1.0appVersion: "v4.6.0"icon: https://raw.githubusercontent.com/OpenBB-finance/OpenBBTerminal/main/images/openbb_logo.pnghome: https://openbb.cosources:- https://github.com/OpenBB-finance/OpenBBmaintainers:- name: Your NameEdit
openbb/values.yamlto configure the image and health check settings. Point the image to your custom registry image and configure probes to use/docs(since the root path/might return 404):openbb/values.yaml image:repository: <registry_url>/openbbpullPolicy: IfNotPresenttag: "v4.6.0"service:type: NodePortport: 8000targetPort: 8000nodePort: 30080 # Optional: Fixed NodePort for easier testinglivenessProbe:httpGet:path: /docs # Use /docs instead of root pathport: httpreadinessProbe:httpGet:path: /docs # Use /docs instead of root pathport: http -
Package the Helm chart
Terminal window helm package openbbThis creates a compressed archive:
openbb-0.1.0.tgz. -
Push the chart to your registry
Terminal window helm push openbb-0.1.0.tgz oci://<registry_url>/charts --plain-httpReplace
<registry_url>with your actual registry address.Once uploaded, navigate to the Applications Store to deploy the chart with your custom image.
Test with Python
Section titled “Test with Python”Once your OpenBB API Server is deployed and running, you can interact with it programmatically using Python.
API Interaction
Section titled “API Interaction”Use the following Python script to fetch data from your OpenBB API:
import requests
# Configuration# Replace with your actual Node IP and the NodePort from values.yamlBASE_URL = "http://<node_ip>:30080"
def check_health(): """Check if the OpenBB API server is reachable.""" try: response = requests.get(f"{BASE_URL}/docs") if response.status_code == 200: print("✓ API is online!") return True else: print(f"✗ API returned status: {response.status_code}") return False except requests.exceptions.RequestException as e: print(f"✗ Failed to connect: {e}") return False
def get_market_data(ticker="AAPL", provider="yfinance"): """Fetch market data for a given ticker.""" endpoint = f"{BASE_URL}/api/v1/equity/price/quote" params = {"symbol": ticker, "provider": provider}
try: print(f"\nFetching {ticker} data from {provider}...") response = requests.get(endpoint, params=params)
if response.status_code == 200: data = response.json() print("✓ Data received:") print(data) else: print(f"✗ Error {response.status_code}: {response.text}") except Exception as e: print(f"✗ Error: {e}")
if __name__ == "__main__": if check_health(): get_market_data("AAPL") # get_market_data("MSFT")