Updated on 2024-12-04 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 Grafana 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 scheduling policies for the add-on.

    Table 2 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 Taints and Tolerations.

  4. 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 3 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 Networking 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.

Change History

Table 4 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

Clusters 1.29 are supported.

1.1.0

v1.17

v1.19

v1.21

v1.23

v1.25

v1.27

v1.28

Supported the open-source Grafana.