Monitoring Nutanix Kubernetes (NKP) in Applications Manager via Prometheus

Monitoring Nutanix Kubernetes (NKP) in Applications Manager via Prometheus

Applications Manager monitors a Kubernetes cluster by reading the metrics the cluster's Prometheus already collects. On NKP, Prometheus is usually exposed behind a login proxy (traefik-forward-auth with Dex), which a plain integration cannot pass. APM supports this through a Form-based Login authentication mode: it logs in with the same credentials used on the NKP login page, keeps the session, and replays it on every query.

1. Prerequisites

Complete these before adding the integration.

  • Prometheus running in the cluster. NKP ships kube-prometheus-stack as a platform application; enable it per cluster or across a workspace. The deployment must include these exporters, which are the data source for APM's Kubernetes monitors:

    • node-exporter — node CPU, memory, disk, and network.
    • kube-state-metrics — Kubernetes object state (pods, deployments, nodes, replicas).
    • kubelet / cAdvisor — pod and container resource usage.
  • A discovery label on the scraped targets. APM discovers monitors by a custom label on the metrics. Without it the integration connects but discovers nothing. Add a label with:

    • the same name across clusters, for example apm_filter;
    • the same value for every exporter in a cluster, and a unique value per cluster (for example the cluster name).

    The simplest way is external_labels, which stamps the label on every series from that cluster's Prometheus:

    global:
    external_labels:
    apm_filter: "<unique-cluster-name>"

    Per-job control through relabel_configs works too, as long as the label lands on the targets you want monitored.

  • Network reachability from the APM server to the cluster's Prometheus endpoint on the required port (443 for the proxy path, 6443 for the API-server path).

2. Choose how APM reaches Prometheus

Pick one path per cluster, based on how Prometheus is exposed.

PathAPM auth modeWhen to useNeeds
Through the login proxyForm-based LoginPrometheus is behind the NKP Dex / forward-auth proxy (the default)A Dex local or LDAP username and password. Not usable if the IdP is external or enforces MFA.
Through the Kubernetes API serverService Account TokenYou can reach the API server and grant RBACPort 6443 reachable, a service account token with read access and services/proxy permission; endpoint is the API-server service-proxy path.
Through a direct ingressNo Authentication or Basic AuthenticationPrometheus is exposed without the proxyThe direct URL, plus basic credentials if any.

Form-based Login is the usual choice on NKP because it needs no cluster-side networking change.

3. Add the integration in APM

Go to Settings → Integrations (Add-On Settings) → Prometheus, then fill in:

General specifications

  • Display Name: a name for this cluster's integration.
  • Poll Interval: collection interval in minutes.
  • Mode of data collection: Exposed Prometheus API.

Prometheus Server Details

  • Host Name / IP Address: the Prometheus host (for NKP, the cluster endpoint host).
  • Prometheus API Port: 443 for the proxy path over HTTPS.
  • Endpoint: the path that serves Prometheus, for example /dkp/prometheus.
  • Protocol: HTTPS(SSL) for the proxy path.
  • Authentication: Form-based Login. Enter the Username and Password used on the NKP login page.


Discovery Specifications

  • Monitor Types: select Kubernetes.
  • Data Collection Filter Label: the label name you added in the prerequisites, for example apm_filter. This must match the label on the targets.
  • Discovery Options: Discover and monitor to create monitors automatically, or Select Monitors to choose specific instances.
  • Action on monitor if data not available: how APM treats a monitor that stops returning data.


Save. APM runs a readiness check: it logs in through the proxy, confirms the session, and then discovers monitors using the filter label.

4. Discovery and monitors

  • With Discover and monitor, APM creates monitors for the discovered Kubernetes targets and polls them each interval.
  • With Select Monitors, use the instances list (searchable) to pick which targets to monitor.
  • The proxy session is cached per integration and renewed automatically; if it expires, APM logs in again on the next poll.

5. Monitoring many clusters

Each APM integration points at one Prometheus endpoint, so for multiple clusters you either:

  • Add one integration per cluster (the default): isolated and simple, one credential set per cluster.
  • Integrate once against a federated or Thanos query endpoint, if NKP Kommander aggregates all clusters. Fewer integrations, but every series must carry the unique per-cluster label so the clusters stay distinguishable.

The per-cluster discovery label from the prerequisites is what keeps clusters apart in either model, so apply it consistently.

6. Troubleshooting

SymptomCause and fix
307 or 302 redirect error when addingA non-login auth mode was used against the proxy. Switch Authentication to Form-based Login.
"Login to the authentication proxy ... failed. Check the username and password."Wrong username or password, or an unsupported IdP. Verify the exact credentials used on the NKP login page. Form-based Login does not work with an external IdP or MFA.
"redirected to a login page that is not a supported username/password form"Dex is using an external identity provider, multiple sign-in options, or MFA. Use the Service Account Token path instead, or expose Prometheus without the proxy.
Integration saves but no monitors are discoveredThe discovery label is missing on the targets, or the Data Collection Filter Label does not match it. Confirm the label name and value on the Prometheus targets.
Connection or SSL errorsCheck reachability on the port, proxy settings, and that the protocol and port match (HTTPS on 443). NKP endpoints are commonly self-signed, which APM accepts.
Login works, polling fails after hoursThe proxy session expired and re-login did not succeed. Re-check credentials; confirm the APM server clock is in sync.