Metrics Exporter
    • PDF

    Metrics Exporter

    • PDF

    Article Summary

    Available in VPC

    Note

    End of technical support and updates for Metrics Exporter.
    Cluster monitoring function is provided starting with Kubernetes version 1.23 cluster, and this function can replace Metrics Exporter.

    NAVER Cloud Platform's Ncloud Kubernetes Service has Metrics Server built in, which collects resources' metrics from Kubelet and exposes it to Kubernetes Apiserver.
    The information on the platform can be viewed from the link below.

    Average CPU usage during a set period and instant memory usage can be viewed through Metrics Server. However, the usage from the past can't be viewed. Therefore, saving the resource usage at a certain interval is required to view the past data.
    NAVER Cloud Platform's Kubernetes provides Metric Exporter which sends data from Metrics Server to Cloud Insight regularly.
    The collected data is visualized through Cloud Insight dashboard or Grafana, and users can see the resource usage trend easily through them.

    The following is needed to use Metrics Exporter and Grafana.

    • Authentication key
      • Authentication key has to be entered for the agent to link with NAVER Cloud Platform's Cloud Insight and get server information.
      • The authentication key can be created and viewed at Portal > My Page > Manage authentication key.
      • The following permissions are required for sub accounts.
        • Server - getServerInstanceList, getServerInstanceDetail
        • Cloud Insight - All(Full)
    • NRN
      • NRN of the cluster created in Ncloud Kubernetes Service needs to be entered.
      • The NRN can be viewed from Resource Manager's Resource.
      • Select Ncloud Kubernetes Service(VPC) for the Product field, and search "Cluster" for the Resource type.
      • Click the result value to get the NRN.
    Note
    • This is provided only for the Ncloud Kubernetes Service (VPC).
    • Requesting detailed monitoring is required for some indicators. Please refer to Cloud Insight guide for more information.

    Usage fees

    It follows the pricing system of Cloud Insight.
    For details about Cloud Insight's pricing standard, refer to the Portal > Service > Cloud Insight page.

    Metrics Exporter

    An agent needs to be deployed to the cluster created in NAVER Cloud Platform's Ncloud Kubernetes Service in order to collect resource usages from Metrics Server.
    This agent collects the resource usage of pods from Metrics Server regularly and sends it to Cloud Insight.

    Deploy

    Create the settings value to be used in Metrics Exporter with Kubernetes's ConfigMap.

    1. Save the file shown below as nks-insight-cm.yml.

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: nks-metrics-exporter
    data:
      baseurl: https://cw.apigw.ntruss.com
      basepath: /cw_collector/real/data
      dmn_cd: PUB
      prodkey: "526115048926613504"
      nrn: nrn:PUB:VPCKubernetesService:KR:NUM:Cluster/cluster-id-fix-me
      accesskey: 2M1ACCESSKEYFIXME63rX7
      secretkey: z3feSECRETKEYFIXMEhR6mTyl
      ignore_namespaces: kube-system
    
    1. Edit the saved content referring to the following.

      • nrn: Enter nrn of the Ncloud Kubernetes Service (VPC) cluster obtained from the Resource Manager
      • accesskey: Enter access key obtained from the authentication key
      • secretkey: Enter secret key obtained from the authentication key
      • ignore_namespaces: Enter the namespace's name in this field to not aggregate the resource usage of pods within a certain namespace. If multiple values are entered, then they can be separated by commas (,).
    2. Enter the command shown below to deploy the configuration file to the Ncloud Kubernetes Service cluster.

      kubectl --kubeconfig $KUBE_CONFIG apply -f ./nks-insight-cm.yml
      
    3. Deploy the Metrics Exporter to the cluster created in Ncloud Kubernetes Service using the file below.

    # Korea Region
    kubectl --kubeconfig $KUBE_CONFIG apply -f https://nks.apigw.ntruss.com/static/v1/metrics-exporter/latest/nks-pub-kr-insight.yml
    
    # Singapore Region
    kubectl --kubeconfig $KUBE_CONFIG apply -f https://nks.apigw.ntruss.com/static/sgn-v1/metrics-exporter/latest/nks-pub-sg-insight.yml
    
    1. Enter the command shown below to check the deployed pod in the namespace.
      kubectl --kubeconfig $KUBE_CONFIG get pod
      NAME                                   READY   STATUS    RESTARTS   AGE
      nks-metrics-exporter-96687bdc-6kqlx   1/1     Running   0          128m
      

    Grafana

    Grafana is a tool which provides visualization of time series data.
    The data sent from Metrics Exporter to Cloud Insight earlier can be viewed on the Grafana dashboard.

    Deploy

    1. Enter the command shown below to deploy Grafana.

    # Korea Region
    kubectl --kubeconfig $KUBE_CONFIG apply -f https://nks.apigw.ntruss.com/static/v1/metrics-exporter/latest/nks-pub-kr-grafana.yml
    
    # Singapore Region
    kubectl --kubeconfig $KUBE_CONFIG apply -f https://nks.apigw.ntruss.com/static/sgn-v1/metrics-exporter/latest/nks-pub-sg-grafana.yml
    

    2. Enter the command shown below to get the initial password required to access the Grafana` dashboard.

    kubectl --kubeconfig $KUBE_CONFIG get secret grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
    

    Access dashboard

    When the deployed Grafana's pod shows the Running status, use the command shown below to access the dashboard.

    1. Enter the command shown below in the local PC.
    kubectl --kubeconfig $KUBE_CONFIG port-forward svc/grafana 3000:80
    
    1. Enter http://localhost:3000 from a web browser of the local PC.

      • You can access the Grafana dashboard.
    2. Enter your ID and password at the dashboard login page to log in.

      • See below for the initial ID and password.
        • ID: admin
        • Password: Enter the initial password obtained from the deployment section above
    Note

    It's recommend to change the ID and password from the Server Admin menu before use.

    Dashboard settings

    The following describes how to visualize the Metric Server data saved in Cloud Insight.

    1. Click the Configuration > Data sources menus, in that order.

      insight-1_en

    2. From the [Data source] tab, click the [Add data source] button.

      insight-2_en

    3. Click naver-cloud-insight-k8s from the list of data sources.

      insight-3_en

    4. Enter the settings information below in the [Settings] tab, and then click the [Save & test] button.

      • Domain Code: PUB
      • regionCode: KR
      • NRN: Enter Ncloud Kubernetes Service (VPC)'s nrn
      • AccessKey, SecretKey: Enter the authentication key

      insight-4_en

    5. Click the Create > Import menus in order to import the dashboard.

      insight-5_en

    6. Click the link below to download JSON data, and copy the file's content.

    1. Paste the JSON data copied in the Step 6 to the Import via panel JASON area and click the [Load] button.

      • The dashboard is added.

      insight-6_en

    2. Check the content from the dashboard.

      • You can check the data once the dashboard is created and data collection is completed.

      insight-7_en


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.