This guide walks you through deploying and testing the Cost Management On-Premise backend services on OpenShift clusters using the Helm chart from the cost-onprem-chart repository.
The Cost Management On-Premise Helm chart is maintained in a separate repository: insights-onprem/cost-onprem-chart
The deployment scripts provide flexible options for OpenShift:
- Helm Chart Deployment: The
install-helm-chart.shscript deploys the Cost Management On-Premise services - Development Mode: Use
USE_LOCAL_CHART=trueto install from a local chart directory
- 46 OpenShift templates for complete Cost Management On-Premise stack deployment
- Automated CI/CD with lint validation, version checking, and deployment testing
- Comprehensive documentation and troubleshooting guides
Ensure your cluster has adequate resources for the deployment:
- Memory: At least 16GB RAM (24GB+ recommended)
- CPU: 8+ cores
- Storage: S3-compatible object storage (ODF, AWS S3, or other)
The deployment includes:
- PostgreSQL databases (unified)
- Kafka cluster (via AMQ Streams)
- Kruize optimization engine (1-2Gi - most memory intensive)
- Celery workers
- Various application services
Install these tools on your system:
# Install OpenShift CLI
# Download from: https://mirror.openshift.com/pub/openshift-v4/clients/ocp/
# Or use package manager
brew install openshift-cli # macOSoc version
kubectl version --client
helm versioncd /path/to/cost-onprem-chart/scripts/# Deploy AMQ Streams operator and Kafka cluster (KRaft mode)
./deploy-kafka.sh# Deploy with auto-configuration (recommended)
./install-helm-chart.shThe script will:
- ✅ Download latest Helm chart release from GitHub
- ✅ Deploy all services with OpenShift configuration
- ✅ Auto-detect and configure S3 storage
- ✅ Run comprehensive health checks
- ✅ Verify connectivity and authentication
Expected Output:
[INFO] Running health checks...
[SUCCESS] ✓ All pods are ready
[SUCCESS] ✓ Routes are accessible
[SUCCESS] All core services are healthy and operational!
# Check deployment status
./install-helm-chart.sh status
# Run health checks
./install-helm-chart.sh healthIf you prefer to manually install the Helm chart or need a specific version:
# Download and install latest chart release
LATEST_URL=$(curl -s https://api.github.com/repos/insights-onprem/cost-onprem-chart/releases/latest | jq -r '.assets[] | select(.name | endswith(".tgz")) | .browser_download_url')
curl -L -o cost-onprem-latest.tgz "$LATEST_URL"
helm install cost-onprem cost-onprem-latest.tgz -n cost-onprem --create-namespace# Install a specific version (e.g., v0.1.0)
VERSION="v0.1.0"
curl -L -o cost-onprem-${VERSION}.tgz "https://github.com/insights-onprem/cost-onprem-chart/releases/download/${VERSION}/cost-onprem-${VERSION}.tgz"
helm install cost-onprem cost-onprem-${VERSION}.tgz -n cost-onprem --create-namespace# Use local chart source
USE_LOCAL_CHART=true LOCAL_CHART_PATH=../cost-onprem ./install-helm-chart.sh
# Or direct Helm installation
helm install cost-onprem ./cost-onprem -n cost-onprem --create-namespaceAfter successful deployment, services are accessible via OpenShift Routes:
# List all routes
oc get routes -n cost-onprem| Service | Route | Description |
|---|---|---|
| ROS API | cost-onprem-main-cost-onprem.apps... |
Main REST API |
| Cost Management API | cost-onprem-api-cost-onprem.apps... |
Cost reports API |
| Ingress | cost-onprem-ingress-cost-onprem.apps... |
File upload endpoint |
| UI | cost-onprem-ui-cost-onprem.apps... |
Web interface |
| Kruize API | cost-onprem-kruize-cost-onprem.apps... |
Optimization engine |
# Get route hostnames
MAIN_ROUTE=$(oc get route cost-onprem-main -n cost-onprem -o jsonpath='{.spec.host}')
INGRESS_ROUTE=$(oc get route cost-onprem-ingress -n cost-onprem -o jsonpath='{.spec.host}')
# Test ROS API health
curl -k https://$MAIN_ROUTE/ready
# Test Ingress version
curl -k https://$INGRESS_ROUTE/api/ingress/v1/version# Run the pytest E2E test suite (~3 minutes)
NAMESPACE=cost-onprem ./scripts/run-pytest.sh --e2eThe test will:
- ✅ Create OCP provider via Koku Sources API
- ✅ Generate test data with NISE
- ✅ Upload data to S3 bucket
- ✅ Publish Kafka event for processing
- ✅ Verify data processing in PostgreSQL
- ✅ Validate cost calculations
Expected Output:
======================================================================
✅ SMOKE VALIDATION PASSED
======================================================================
📊 DATA PROOF - Actual rows from PostgreSQL:
------------------------------------------------------------------
Date Namespace CPU(h) CPU Req Mem(GB)
------------------------------------------------------------------
2025-12-01 test-namespace 6.00 12.00 12.00
------------------------------------------------------------------
Phases: 7/7 passed
✅ preflight
✅ migrations
✅ kafka_validation
✅ provider
✅ data_upload
✅ processing
✅ validation
✅ E2E SMOKE TEST PASSED
# View specific service logs
oc logs -n cost-onprem -l app.kubernetes.io/component=processor -f
# View all pods
oc get pods -n cost-onprem# Watch pods in real-time
oc get pods -n cost-onprem -w
# Check persistent volumes
oc get pvc -n cost-onprem
# View all services
oc get svc -n cost-onprem# Customize deployment
export HELM_RELEASE_NAME=my-cost-onprem
export NAMESPACE=my-namespace
# Deploy with custom settings
./install-helm-chart.sh# Create custom values file
cat > my-values.yaml << EOF
global:
storageClass: "ocs-storagecluster-ceph-rbd"
database:
storage:
size: 20Gi
resources:
application:
requests:
memory: "256Mi"
cpu: "200m"
EOF
# Deploy with custom values
helm upgrade --install cost-onprem ./cost-onprem \
--namespace cost-onprem \
--create-namespace \
-f my-values.yaml# Remove Helm release and namespace
./install-helm-chart.sh cleanup# Delete Helm release
helm uninstall cost-onprem -n cost-onprem
# Delete namespace
oc delete namespace cost-onpremUse this script to verify all services are working:
#!/bin/bash
echo "=== Cost Management On-Premise Status Check ==="
# Check pod status
echo "Pod Status:"
oc get pods -n cost-onprem
# Check services with issues
echo -e "\nPods with issues:"
oc get pods -n cost-onprem --field-selector=status.phase!=Running
# Check routes
echo -e "\nRoutes:"
oc get routes -n cost-onprem
# Check API endpoints
echo -e "\nAPI Health Checks:"
MAIN_ROUTE=$(oc get route cost-onprem-main -n cost-onprem -o jsonpath='{.spec.host}' 2>/dev/null)
if [ -n "$MAIN_ROUTE" ]; then
curl -sk https://$MAIN_ROUTE/ready >/dev/null && echo "✓ ROS API" || echo "✗ ROS API failed"
fi
echo -e "\nFor detailed troubleshooting, run: NAMESPACE=cost-onprem ./scripts/run-pytest.sh -v"After successful deployment:
- Configure JWT Authentication: See Keycloak Setup Guide
- Set Up TLS: See TLS Certificate Options
- Explore APIs: Use the access points to interact with services
- Load Test Data: Upload your own cost management files
- Monitor Metrics: Check Kruize recommendations and optimizations
For issues or questions:
- Check Troubleshooting Guide
- Run E2E test:
NAMESPACE=cost-onprem ./scripts/run-pytest.sh --e2e - Check pod logs:
oc logs -n cost-onprem <pod-name> - Verify configuration:
helm get values cost-onprem -n cost-onprem