An error occurred during the NSX Metrics feature deployment while the system tried to deploy the Postgres database.

Problem

The system encountered a problem while trying to deploy the Postgres database used by the NSX Metrics feature.

Cause

There are multiple reasons for the Metrics Postgres database deployment to fail.

Solution

  1. Ensure that the system deployed the NSX Application Platform successfully.
  2. If you have access to the NSX Manager command line interface (CLI), use the following steps to investigate any errors recorded in the NSX Metrics logs. If you do not have access to the NSX Manager CLI, use the information provided in step 3.
    1. Log into the NSX Manager appliance as a root user.
    2. Mark the TKG Cluster on Supervisor or upstream Kubernetes configuration for any subsequent helm and kubectl command invocation.
      export KUBECONFIG=/config/vmware/napps/.kube/config
    3. Use the following command to verify that the system has deployed the Metrics helm chart successfully.
      helm --namespace nsxi-platform list --all --filter 'metrics'

      The STATUS property must display deployed.

    4. Use the following command to verify that the setup pods were deployed and completed successfully.
      kubectl --namespace nsxi-platform get pods --selector='app.kubernetes.io/instance=metrics,app.kubernetes.io/name=postgresql-ha'
    5. Using the following command, inspect the logs for the setup pods that did not deploy or are not in the Ready state.
      kubectl --namespace nsxi-platform logs <POD_NAME>
  3. If you do not have access to the NSX Manager CLI, collect the NSX Application Platform support bundle using information in Collect the Support Bundles for the NSX Application Platform Using the UI. Inspect the support bundle logs for the TKG Cluster on Supervisor or upstream Kubernetes pods whose name start with metrics-postgresql-ha.
  4. Resolve the errors reported in the logs.
  5. After resolving the errors reported in the logs, retry deploying the NSX Application Platform using the NSX Manager UI.