You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Networking
Best practices for observability of custom Nginx Ingress controllers
Copy page
Download PDF
Best practices for observability of custom Nginx Ingress controllers
The stability of Ingresses, which function as resource objects at the access layer in clusters, affects service quality. This topic describes best practices for monitoring custom Nginx Ingress controllers in clusters.​
Background information​
VKE allows you to deploy multiple independent Nginx Ingress controllers within a cluster. Each controller operates independently.​
  • System default ingress-nginx: Deploy the ingress-nginx add-on in the cluster add-on center and follow the on-screen prompts to complete installation. For details, see Installing ingress-nginx.​
Log collection​
By default, the logs of custom Nginx Ingress controllers are not collected or persistently stored. You need to configure and enable log collection to achieve persistent collection, storage, and query of the logs for custom Nginx Ingress controllers.​
Prerequisites​
  • A log project and log topic have been created in TLS. For detailed operations, see Log projects and Log topics.​
Configuring log collection​
  1. Log in to the VKE console.​
  1. In the left navigation bar, click Cluster.​
  1. On the Cluster page, click the name of the target cluster.​
  1. In the left navigation bar of the cluster management page, click Log management.​
  1. Click the Log collection rule tab and click Create collection rule. On the page that appears, configure log collection for the custom Nginx Ingress controller.​
  • Configure the log storage location, including IAM project, Project, and Topic. After you complete the configuration, click Next step: Collection rule.​
  • Configure the log collection rule.​
  • ​
    Parameters​
    Descriptions​
    Rule name​
    Specify the name of the collection rule. The name must be unique in the same cluster.​
    Collection type​
    Specify the log collection type. For this example, select K8s container standard output.​
    Collection information​
    Configure log collection information. For this example, select Standard output - stdout and Standard error - stderr.​
    K8s collection rules​
    Select Enable, and specify the containers that require log collection based on parameters, such as Namespace and Workload name.​
    • Namespace: Configure the namespace where the custom ingress-nginx is located.​
    • Workload type: Select Enable, and select Stateless load.​
    • Workload name: Specify a custom workload name for ingress-nginx.​
    ​
  • Keep the default values for other parameters. After you complete the configuration, click Next step: Check the index configuration.​
tip​
For more configuration methods and parameter descriptions of container log collection rules, see Collecting container standard output.​
  • Configure log index checking. In this example, keep the default configurations.​
  1. Click Create collection configuration to complete the configuration.​
Viewing logs​
  1. In the left navigation bar of the cluster management page, click Log management.​
  1. Click the Container log tab. Select the target log project and log topic to view the logs of the custom Nginx Ingress controller.​
Monitoring and alerting​
You can enable the cloud-native observability feature in the cluster to achieve monitoring and alerting for the custom Nginx Ingress controller.​
Prerequisites​
  • VMP has been activated.​
Configuring metric collection​
  1. Enable cloud-native observability in the cluster. For details, see Enabling cloud-native observability.​
  1. Enable Ingress service observability. For details, see Ingress service observability.​
  1. (Optional) Configure service discovery.​
tip​
  • If your custom Nginx Ingress controller is deployed in the kube-system namespace, you can directly view the metrics and dashboard of the instance without the need to configure service discovery.​
  • If your custom Nginx Ingress controller is deployed in other namespaces, you need to configure service discovery to view the metrics and dashboard of the instance.​
  1. In the left navigation bar of the cluster management page, click Services and Ingresses > Service. On the page that appears, select the target namespace from the Namespace drop-down list.​
  1. In the service list, select the service named *-ingress-nginx-controller-metrics. * indicates the name that you define. In this example, the service name is nginx-ingress-nginx-controller-metrics.​
  1. In the Actions column, click ... > Update to configure the following annotations for the service to enable service discovery.​
  • ​
    prometheus.io/scrape: "true" # Set the value to true to enable collection.​
    prometheus.io/port: "10254" # The port number where the metrics are exposed.​
    prometheus.io/path: "/metrics" # The URI path where metrics are exposed. It is typically /metrics.​
    ​
  1. Click Confirm.​
Viewing monitoring data​
  1. In the left navigation bar of the cluster management page, click Monitoring > Dashboard.​
  1. In the left dashboard list, click Network services monitoring > Ingres-nginx monitoring to view the monitoring dashboard. ​
  • From the Namespace drop-down list, select the namespace where the Ingress is located.​
  • From the IngressClass drop-down list, select the type of Ingress. Supported types include the system default ingress-nginx and custom Nginx Ingress Controller.​
  • From the Pod drop-down list, specify a pod.​
tip​
For more details about the monitoring dashboard, see Ingress service observability.​
Configuring alerts​
VMP allows you to configure resource alerting policies. You can configure alerts in the console by using Ingress service observability. When monitoring data reaches the threshold and triggers an alert, the system sends detailed information, such as the alert resources, fault type, current value, and alert duration, to alert contacts.​
VMP supports various alert notification methods, such as email, Feishu, DingTalk, and phone. For detailed configuration methods, see the following topics:​
​
Last updated: 2026.07.23 11:53:56