- Print
- PDF
Metrics Exporter
- Print
- PDF
Available in VPC
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.
- 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
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 keysecretkey
: Enter secret key obtained from the authentication keyignore_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 (,
).
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
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
- 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.
- Enter the command shown below in the local PC.
kubectl --kubeconfig $KUBE_CONFIG port-forward svc/grafana 3000:80
Enter http://localhost:3000 from a web browser of the local PC.
- You can access the
Grafana
dashboard.
- You can access the
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
- ID:
- See below for the initial ID and password.
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.
Click the Configuration > Data sources menus, in that order.
From the [Data source] tab, click the [Add data source] button.
Click naver-cloud-insight-k8s from the list of data sources.
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
Click the Create > Import menus in order to import the dashboard.
Click the link below to download JSON data, and copy the file's content.
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.
Check the content from the dashboard.
- You can check the data once the dashboard is created and data collection is completed.