Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cloud Container Engine/ User Guide/ O&M/ O&M Best Practices/ Monitoring Container Network Metrics of CCE Turbo Clusters

Monitoring Container Network Metrics of CCE Turbo Clusters

Updated on 2025-01-07 GMT+08:00

CCE Network Metrics Exporter is an add-on for monitoring and managing container network traffic. It collects traffic statistics of containers that do not use the host network in CCE Turbo clusters and performs node-wide container connectivity checks. The monitoring data has been adapted to Prometheus. You can call the Prometheus API to view monitoring data.

The following describes how to view the container network metrics of a CCE Turbo cluster using Prometheus.

  1. Installing the Add-ons
  2. Monitoring Container Network Metrics
  3. (Optional) Viewing Graphs on Grafana

Prerequisites

Installing the Add-ons

  1. Log in to the CCE console and click the CCE Turbo cluster name to access the cluster console. In the navigation pane, choose Add-ons.
  2. Locate the Cloud Native Cluster Monitoring add-on and click Install.

    When you use this add-on to monitor container network metrics in a CCE Turbo cluster, pay attention to the following parameters. Other parameters of this add-on can be configured as required. For details, see Cloud Native Cluster Monitoring.
    • Local Data Storage: Enable this option. The monitoring data will be stored locally. You can determine whether to connect this add-on to AOM or a third-party monitoring platform.
    • Custom Metric Collection: Enable this option in this practice. If this option is not enabled, container network metrics cannot be collected.
    • (Optional) Install Grafana: After installing Grafana, you can view metrics in graphs.
      NOTE:

      This parameter is only available for the add-on earlier than v3.9.0. For the add-on of v3.9.0 or later, if Grafana is required, install Grafana separately.

  3. Locate the CCE Network Metrics Exporter add-on and click Install.

    No parameter needs to be configured for the current add-on.

  4. (Optional) (For Cloud Native Cluster Monitoring v3.9.0 or later, Grafana is not provided by default.) Locate the independent Grafana add-on and click Install.

    If you enable Public Access, a LoadBalancer Service named grafana-oss will be created in the monitoring namespace. If the load balancer connected to the LoadBalancer Service is bound with an EIP, you can enter {EIP}:{Port} in the address box of a browser to access Grafana.

    NOTICE:

    Enabling public access will allow open-source Grafana access over a public network. You are advised to evaluate security risks and create access control policies.

Monitoring Container Network Metrics

  1. Add the port information to the DaemonSet configuration of the CCE Network Metrics Exporter add-on.

    NOTE:

    If the add-on version is earlier than 1.3.10, you need to manually add the port information. If the add-on version is 1.3.10 or later, the port information is automatically added so you can skip this step.

    kubectl edit ds -nkube-system dolphin
    Add the following content to the file:
    ...
    spec:
      containers:
        - name: dolphin
          ports:
          - containerPort: 10001
            name: dolphin
            protocol: TCP
    ...

  2. Configure the pod-monitor.yaml file so that Prometheus automatically collects container network metrics.

    The following shows an example:

    apiVersion: monitoring.coreos.com/v1
    kind: PodMonitor
    metadata:
      name: dolphin
      namespace: monitoring
    spec:
      namespaceSelector:
        matchNames:
        - kube-system
      jobLabel: podmonitor-dolphin
      podMetricsEndpoints:
      - interval: 15s
        path: /metrics
        port: dolphin
        tlsConfig:
          insecureSkipVerify: true
      selector:
        matchLabels:
          app: dolphin

    Create a PodMonitor.

    kubectl apply -f pod-monitor.yaml

Viewing Metrics on Prometheus

  1. Create an example monitoring task. For details, see Delivering a Monitoring Task.

    apiVersion: crd.dolphin.io/v1
    kind: MonitorPolicy
    metadata:
      name: example-task            # Monitoring task name.
      namespace: kube-system        # (Mandatory) The value must be kube-system.
    spec:
        selector:                   # (Optional) Backend monitored by the add-on. The value has the same format as the labelSelector. By default, all pods on the node are monitored.
        matchLabels:
          app: nginx
        matchExpressions:
          - key: app
            operator: In
            values:
              - nginx
      podLabel: []               # (Optional) Pod label.
      ip4Tx:                        # (Optional) Whether to collect the number of sent IPv4 packets and the number of sent IPv4 bytes. This option is disabled by default.
        enable: true
      ip4Rx:                        # (Optional) Whether to collect the number of received IPv4 packets and the number of received IPv4 bytes. This option is disabled by default.
        enable: true
      ip4TxInternet:                # (Optional) Whether to collect the number of sent IPv4 packets and the number of sent IPv4 bytes. This option is disabled by default.
        enable: true
      healthCheck:                  # (Optional) Whether to collect statistics about the latest health check results and the total numbers of health checks in which pods are considered healthy and of health checks in which pods are considered unhealthy. This option is disabled by default.
        enable: true                # true false
        failureThreshold: 3         # (Optional) Number of health check failures that consider a pod is unhealthy. If there is one check failure, the pod is considered unhealthy.
        periodSeconds: 5            # (Optional) Interval between health checks, in seconds. The default value is 60.
        command: ""                 # (Optional) Health check command. The value can be ping (default), arping, or curl.
        ipFamilies: [""]            # (Optional) Health check IP address family. The value is ipv4 by default.
        port: 80                    # (Optional) Port number, which is mandatory when curl is used.
        path: ""                    # (Optional) HTTP API path, which is mandatory when curl is used.
      monitor:
        ip:
          ipReceive:
            aggregateType: flow       # (Optional) The value can be pod (monitored by pod) or flow (monitored by flow).
          ipSend:
            aggregateType: flow       # (Optional) The value can be pod (monitored by pod) or flow (monitored by flow).
        tcp:
          tcpReceive:
            aggregateType: flow       # (Optional) The value can be pod (monitored by pod) or flow (monitored by flow).
          tcpSend:
            aggregateType: flow       # (Optional) The value can be pod (monitored by pod) or flow (monitored by flow).
          tcpRetrans:
            aggregateType: flow       # (Optional) The value can be pod (monitored by pod) or flow (monitored by flow).
          tcpRtt:
            aggregateType: flow       # (Optional) The value can be flow (monitored by flow). The unit is μs.
          tcpNewConnection:
            aggregateType: pod        # (Optional) The value can be pod (monitored by pod).

  2. Create a public network LoadBalancer Service so that Prometheus can be accessed from external networks.

    apiVersion: v1
    kind: Service
    metadata:
      name: prom-lb     # Service name, which is customizable.
      namespace: monitoring
      labels:
        app: prometheus
        component: server
      annotations:
        kubernetes.io/elb.id: 038ff***     # Replace it with the ID of the public network load balancer in the VPC that the cluster belongs to.
    spec:
      ports:
        - name: cce-service-0
          protocol: TCP
          port: 88             # Service port, which is customizable.
          targetPort: 9090     # Default Prometheus port. Retain the default value.
      selector:                # The label selector can be adjusted based on the label of a Prometheus server instance.
        app.kubernetes.io/name: prometheus
        prometheus: server
      type: LoadBalancer

  3. After the Service is created, enter Public IP address of the load balancer:Service port in the address box of the browser to access Prometheus. You can search for supported monitoring items on Prometheus to check whether the metrics are successfully collected.

    Figure 1 Accessing Prometheus

(Optional) Viewing Graphs on Grafana

  1. After installing Grafana in the cluster, locate the Grafana add-on on the Add-ons page and click Access.
  2. Enter your Grafana login account and password.
  3. In the navigation pane, click Explore. Select prometheus and enter the PromQL query command, for example, rate(dolphin_ip4_send_pkt_internet[5m]). In the upper right corner, click Run query to obtain the metric graph.

    Figure 2 Grafana graph

  4. (Optional) Use common graphs as Grafana dashboards. For details, see Create a dashboard.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback