Install HAMi-WebUI

Alauda Build of HAMi-WebUI is an optional HAMi product-line cluster plugin. Install it when users need a HAMi-specific resource overview in addition to ACP monitoring.

Before you begin

  • Install Alauda Build of HAMi.
  • Confirm the supported HAMi-WebUI version in Versions and Components.
  • For HAMi v2.9.x, obtain the Alauda Build of HAMi-WebUI v1.10.3 cluster-plugin package for the target architecture from Customer Portal or AC CN/IO.
  • Confirm that ACP monitoring is available in the target cluster and that HAMi-WebUI can reach its Prometheus query address.
  • Obtain cluster administrator access. The generated Prometheus authentication value is a credential and must be handled as a secret.

Prepare the Prometheus settings

The plugin form requires a Prometheus address and accepts the complete value for the HTTP Authorization header. For Basic authentication, the value must include the scheme prefix:

Basic <base64(username:password)>

Use the following script to read the monitoring Feature and generate the two form values. It does not print the username or password separately.

prometheus_address=$(kubectl get feature monitoring \
  -o jsonpath='{.spec.accessInfo.database.service}')
if [ -z "$prometheus_address" ]; then
  prometheus_address=$(kubectl get feature monitoring \
    -o jsonpath='{.spec.accessInfo.database.address}')
fi

prometheus_secret=$(kubectl get feature monitoring \
  -o jsonpath='{.spec.accessInfo.database.basicAuth.secretName}')
prometheus_namespace=cpaas-system

prometheus_username=$(kubectl get secret "$prometheus_secret" \
  -n "$prometheus_namespace" -o jsonpath='{.data.username}' | base64 -d)
prometheus_password=$(kubectl get secret "$prometheus_secret" \
  -n "$prometheus_namespace" -o jsonpath='{.data.password}' | base64 -d)

prometheus_auth="Basic $(printf '%s:%s' \
  "$prometheus_username" "$prometheus_password" | base64 | tr -d '\n')"

printf 'Prometheus Address: %s\n' "$prometheus_address"
printf 'Prometheus Auth: %s\n' "$prometheus_auth"
WARNING

Do not omit the Basic prefix. HAMi-WebUI sends the configured authentication string unchanged as the Prometheus Authorization header. A base64 value without the scheme prefix can be redirected to an authorization page instead of receiving Prometheus JSON.

From a network location that can reach the returned address, verify the credentials before installing the plugin:

curl --insecure --silent --show-error --fail \
  -H "Authorization: $prometheus_auth" \
  --get --data-urlencode 'query=up' \
  "${prometheus_address%/}/api/v1/query"

A successful response has "status":"success" and a Prometheus JSON data object. An HTML page, login page, or authorization redirect is not a valid response.

Install the cluster plugin

  1. Retrieve Alauda Build of HAMi-WebUI from Customer Portal and upload the cluster plugin to ACP.

  2. In ACP, go to Administrator -> Marketplace -> Cluster Plugins, switch to the target cluster, and deploy Alauda Build of HAMi-WebUI.

  3. Fill in the plugin form:

    FieldValue
    Prometheus AddressThe address returned by the monitoring Feature.
    Prometheus AuthThe complete Basic <base64(username:password)> Authorization value.
    NodePort EnabledOptional. Enable direct node access when required by the environment and allowed by its network policy.
    Port NumberA free NodePort in the range 30000 to 32767; the form commonly defaults to 30300.
  4. Wait for the WebUI pod to become Ready:

    kubectl get pods -n cpaas-system | grep hami-webui

Access HAMi-WebUI

Use the ACP route when platform access is available:

{platform-url}/clusters/{cluster-name}/hami-webui

When NodePort is enabled, find the service port and a reachable node address:

kubectl get svc -n cpaas-system | grep hami-webui
kubectl get nodes -o wide

Open the direct task page with the selected NodePort:

http://<node-ip>:<node-port>/admin/vgpu/task/admin

Verify the Prometheus query path

For a NodePort deployment, query the same WebUI backend endpoint used by the page:

hami_webui_url=http://<node-ip>:<node-port>

curl --silent --show-error --fail \
  -H 'Content-Type: application/json' \
  --data '{"query":"up"}' \
  "${hami_webui_url}/api/vgpu/v1/monitor/query/instant-vector"

The expected response is a JSON object with a data array, for example {"data":[...]}. HTTP 523, VGPU_DOMAIN_ERROR, or an error containing an HTML document means the WebUI backend did not receive a valid Prometheus API response. See Troubleshooting.

Next steps