1.用法

Heapster在openshift和k8s中默认使用,使用标签–metric_resolution可以设置数据存储周期,默认存储周期是60秒。
所有端点/metrics/{metric-name}/可以接收start和end参数,这两个参数指定了开始和结束时间序列,时间设置格式是字符串类型编码成RFC3339.类型,如该开始时间没有设定,默认值为0,如该结束时间没有设定,默认值为开始时间以后的所有数据。

2.Cluster 集群级的度量

  • /api/v1/model/metrics/ 返回一个集群级可度量列表。
  • /api/v1/model/metrics/{metric-name}?start=X&end=Y 返回一个设着李时间对的度量。
  • -

3.Node 节点级的度量

  • /api/v1/model/nodes/ 返回一个节点可度量列表。
  • /api/v1/model/nodes/{node-name}/metrics/ 返回某个node节点上,可度量的资源列表,比如cpu、memory、network等。
  • /api/v1/model/nodes/{node-name}/metrics/{metric-name}?start=X&end=Y 返回设置了起始时间对的资源度量信息。

4.Namespace 命名空间级的度量

  • /api/v1/model/namespaces/ 返回一个可度量的namespace列表
  • /api/v1/model/namespaces/{namespace-name}/metrics/ 返回某个namespace上,可度量的资源列表,比如cpu、memory等。
  • /api/v1/model/namespaces/{namespace-name}/metrics/{metric-name}?start=X&end=Y 返回一个带有时间对的某个namespace下某种资源的度量信息。

5.Pod 级别的度量

  • /api/v1/model/namespaces/{namespace-name}/pods/ 返回某个命名空间下可度量的pod列表
  • /api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/metrics/ 返回某个命名空间下指定pod的可度量资源列表,比如CPU、memory
  • /api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/metrics/{metric-name}?start=X&end=Y 返回某个pod的指定资源的度量情况。

6.Container 容器级别的度量

  • /api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/containers/ 返回一个可度量的容器列表
  • /api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/containers/{container-name}/metrics/ 返回一个容器可度量的资源列表,比如CPU
  • /api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/containers/{container-name}/metrics/{metric-name}?start=X&end=Y 容器的某个资源在某个时间对内的度量情况。

    • /api/v1/model/nodes/{node-name}/freecontainers/ 返回一个node上可度量的免费容器(系统容器)列表
  • /api/v1/model/nodes/{node-name}/freecontainers/{container-name}/metrics/ 返回一个node上可度量的免费容器(系统容器)列表的资源类型。
  • /api/v1/model/nodes/{node-name}/freecontainers/{container-name}/metrics/{metric-name}?start=X&end=Y 返回一个时间对内的容器资源监控信息。

7.Heapster可以输出的metrics类型:

Metric NameDescription
cpu/limitCPU hard limit in millicores.
cpu/node_capacityCpu capacity of a node.
cpu/node_allocatableCpu allocatable of a node.
cpu/node_reservationShare of cpu that is reserved on the node allocatable.
cpu/node_utilizationCPU utilization as a share of node allocatable.
cpu/requestCPU request (the guaranteed amount of resources) in millicores.
cpu/usageCumulative CPU usage on all cores.
cpu/usage_rateCPU usage on all cores in millicores.
filesystem/usageTotal number of bytes consumed on a filesystem.
filesystem/limitThe total size of filesystem in bytes.
filesystem/availableThe number of available bytes remaining in a the filesystem
filesystem/inodesThe number of available inodes in a the filesystem
filesystem/inodes_freeThe number of free inodes remaining in a the filesystem
memory/limitMemory hard limit in bytes.
memory/major_page_faultsNumber of major page faults.
memory/major_page_faults_rateNumber of major page faults per second.
memory/node_capacityMemory capacity of a node.
memory/node_allocatableMemory allocatable of a node.
memory/node_reservationShare of memory that is reserved on the node allocatable.
memory/node_utilizationMemory utilization as a share of memory allocatable.
memory/page_faultsNumber of page faults.
memory/page_faults_rateNumber of page faults per second.
memory/requestMemory request (the guaranteed amount of resources) in bytes.
memory/usageTotal memory usage.
memory/cacheCache memory usage.
memory/rssRSS memory usage.
memory/working_setTotal working set usage. Working set is the memory being used and not easily dropped by the kernel.
network/rxCumulative number of bytes received over the network.
network/rx_errorsCumulative number of errors while receiving over the network.
network/rx_errors_rateNumber of errors while receiving over the network per second.
network/rx_rateNumber of bytes received over the network per second.
network/txCumulative number of bytes sent over the network
network/tx_errorsCumulative number of errors while sending over the network
network/tx_errors_rateNumber of errors while sending over the network
network/tx_rateNumber of bytes sent over the network per second.
uptimeNumber of milliseconds since the container was started.
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐