Updated on 2024-06-26 GMT+08:00

Grafana

Introduction

Grafana is an open-source visualized data monitoring platform. It provides you with various charts and panels for real-time monitoring, analysis, and visualization of various metrics and data sources.

Installing the Add-on

  1. Log in to the CCE console and click the cluster name to access the cluster console. Choose Add-ons in the navigation pane, locate Grafana on the right, and click Install.
  2. On the Install Add-on page, configure the specifications.

    Table 1 Add-on configuration

    Parameter

    Description

    Add-on Specifications

    The specifications can be Custom.

    Containers

    If you select Custom, you can adjust the container specifications as required.

  3. Configure the add-on parameters.

    Table 2 Grafana parameters

    Parameter

    Description

    PVC Type

    To install Grafana, you need to create a storage volume to store local data. When the Grafana is uninstalled, this storage volume will not be deleted.

    • If you select EVS, you need to select an EVS disk type. The EVS disk types supported by different regions may vary. You can select one disk type on the management console.

      EVS disks are charged by storage capacity and occupy your EVS disk quotas.

    • If you select DSS, you need to select a DSS pool. The created storage volume will be in the corresponding storage pool.

    Capacity (GiB)

    The EVS disk size is 5 GiB by default. You can expand the disk capacity after the disk is created. For details, see Related Operations.

    AOM

    Enable this function to report Prometheus data to AOM. After this function is enabled, you can select the corresponding AOM instance. The collected basic metrics are free of charge. Custom metrics are charged by AOM. For details, see Product Pricing Details. To interconnect with AOM, you must have certain permissions. Only Huawei Cloud accounts, Huawei IDs, and users in the admin user group can perform this operation.

  4. Configure scheduling policies for the add-on.

    Table 3 Configurations for add-on scheduling

    Parameter

    Description

    Node Affinity

    • Not configured: Node affinity is disabled for the add-on.
    • Node Affinity: Specify the nodes where the add-on is deployed. If you do not specify the nodes, the add-on will be randomly scheduled based on the default cluster scheduling policy.
    • Specified Node Pool Scheduling: Specify the node pool where the add-on is deployed. If you do not specify the node pool, the add-on will be randomly scheduled based on the default cluster scheduling policy.
    • Custom Policies: Enter the labels of the nodes where the add-on is to be deployed for more flexible scheduling policies. If you do not specify node labels, the add-on will be randomly scheduled based on the default cluster scheduling policy.

      If multiple custom affinity policies are configured, ensure that there are nodes that meet all the affinity policies in the cluster. Otherwise, the add-on cannot run.

    Toleration

    Using both taints and tolerations allows (not forcibly) the add-on Deployment to be scheduled to a node with the matching taints, and controls the Deployment eviction policies after the node where the Deployment is located is tainted.

    The add-on adds the default tolerance policy for the node.kubernetes.io/not-ready and node.kubernetes.io/unreachable taints, respectively. The tolerance time window is 60s.

    For details, see Configuring Tolerance Policies.

  5. Click Install.

    After the add-on is installed, select the cluster and click Add-ons in the navigation pane. On the displayed page, view the add-on in the Add-ons Installed area.

Components

Table 4 Add-on components

Component

Description

Resource Type

grafana

This component provides the data visualization capability for Grafana.

Deployment

How to Use

To access Grafana charts through a public network, you need to bind a LoadBalancer service to the Grafana container.

  1. Log in to the CCE console, and click the name of the cluster with the Grafana add-on installed to access the cluster console. On the displayed page, choose Services & Ingresses in the navigation pane.
  2. Click Create from YAML in the upper right corner to create a public network LoadBalancer Service for Grafana.

    apiVersion: v1
    kind: Service
    metadata:
      name: grafana-lb     # Service name, which is customizable
      namespace: monitoring
      labels:
        app: grafana
      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: 80     #Service port, which can be customized.
          targetPort: 3000     # Default Grafana port. Retain the default value.
      selector:
        app: grafana
      type: LoadBalancer

  3. After the creation, visit load balancer public IP:Service port to access Grafana and select a proper dashboard to view the aggregated data.

    Figure 1 Grafana panel

Change History

Table 5 Release history

Add-on Version

Supported Cluster Version

New Feature

1.2.0

v1.17

v1.19

v1.21

v1.23

v1.25

v1.27

v1.28

v1.29

CCE 1.29 clusters are supported.

1.1.0

v1.17

v1.19

v1.21

v1.23

v1.25

v1.27

v1.28

Supported the open source Grafana.