kubernetes-notes
  • 目录
    • 序言
  • 云原生体系
    • 12-Factor
    • K8S知识体系
  • 安装与配置
    • 部署k8s集群
      • 使用kubeadm安装生产环境kubernetes
      • 使用kubespray安装kubernetes
      • 使用minikube安装kubernetes
      • 使用kind安装kubernetes
    • k8s证书及秘钥
    • k8s版本说明
  • 基本概念
    • kubernetes架构
      • Kubernetes总架构图
      • 基于Docker及Kubernetes技术构建容器云(PaaS)平台概述
    • kubernetes对象
      • 理解kubernetes对象
      • kubernetes常用对象说明
    • Pod
      • Pod介绍
      • Pod定义文件
      • Pod生命周期
      • Pod健康检查
      • Pod存储卷
      • Pod控制器
      • Pod伸缩与升级
    • 配置
      • ConfigMap
    • Workload
  • 核心原理
    • 核心组件
      • Api Server
      • Controller Manager
      • Scheduler
      • Kubelet
    • 流程图
      • Pod创建流程
      • PVC创建流程
  • 容器网络
    • Docker网络
    • K8S网络
    • 网络插件
      • Flannel介绍
    • CNI
      • CNI接口介绍
      • Macvlan介绍
  • 容器存储
    • 存储卷概念
      • Volume
      • Persistent Volume
      • Persistent Volume Claim
      • Storage Class
      • Dynamic Volume Provisioning
    • CSI
      • csi-cephfs-plugin
      • 部署csi-cephfs
      • 部署cephfs-provisioner
      • FlexVolume介绍
  • 资源隔离
    • 资源配额
    • Pod限额
    • 资源服务质量
    • Lxcfs资源视图隔离
  • 运维指南
    • kubectl工具
      • kubectl安装与配置
      • kubectl命令说明
      • kubectl命令别名
    • kubernetes集群问题排查
    • 节点调度
      • 安全迁移节点
      • 指定Node调度与隔离
    • 镜像仓库配置
      • 配置私有的镜像仓库
      • 拉取私有镜像
  • 开发指南
    • client-go的使用及源码分析
    • CSI插件开发
      • nfs-client-provisioner源码分析
      • csi-provisioner源码分析
    • operator开发
      • kubebuilder的使用
  • 问题排查
    • 节点相关问题
      • keycreate permission denied
      • Cgroup不支持pid资源
      • Cgroup子系统无法挂载
    • Pod驱逐
    • 镜像拉取失败问题
    • PVC Terminating
  • 源码分析
    • Kubernetes源码分析笔记
    • kubelet
      • NewKubeletCommand
      • NewMainKubelet
      • startKubelet
      • syncLoopIteration
      • syncPod
    • kube-controller-manager
      • NewControllerManagerCommand
      • DeploymentController
      • Informer机制
    • kube-scheduler
      • NewSchedulerCommand
      • registerAlgorithmProvider
      • scheduleOne
      • findNodesThatFit
      • PrioritizeNodes
      • preempt
    • kube-apiserver
      • NewAPIServerCommand
  • Runtime
    • Runtime
      • Runc和Containerd概述
    • Containerd
      • 安装Containerd
    • Docker
      • Docker学习笔记
    • Kata Container
      • kata容器简介
      • kata配置
    • GPU
      • nvidia-device-plugin介绍
  • Etcd
    • Etcd介绍
    • Raft算法
    • Etcd启动配置参数
    • Etcd访问控制
    • etcdctl命令工具
      • etcdctl命令工具-V3
      • etcdctl命令工具-V2
    • Etcd中的k8s数据
    • Etcd-Operator的使用
  • 多集群管理
    • k8s多集群管理的思考
    • Virtual Kubelet
      • Virtual Kubelet介绍
      • Virtual Kubelet 命令
    • Karmada
      • Karmada介绍
  • 边缘容器
    • KubeEdge介绍
    • KubeEdge源码分析
      • cloudcore
      • edgecore
    • OpenYurt部署
  • 虚拟化
    • 虚拟化相关概念
    • KubeVirt
      • KubeVirt的介绍
      • KubeVirt的使用
  • 监控体系
    • 监控体系介绍
    • cAdvisor介绍
    • Heapster介绍
    • Influxdb介绍
由 GitBook 提供支持

www.huweihuang.com

在本页
  • 1. heapster简介
  • 2. heapster部署与配置
  • 2.1. 注意事项
  • 2.2. 容器式部署
  • 2.3. 配置说明
  • 2.3.1. –source
  • 2.3.2. –sink
  • 3. Metrics
  • 4. Labels
  • 5. heapster API

这有帮助吗?

在GitHub上编辑
  1. 监控体系

Heapster介绍

1. heapster简介

Heapster是容器集群监控和性能分析工具,天然的支持Kubernetes和CoreOS。 Kubernetes有个出名的监控agent—cAdvisor。在每个kubernetes Node上都会运行cAdvisor,它会收集本机以及容器的监控数据(cpu,memory,filesystem,network,uptime)。

2. heapster部署与配置

2.1. 注意事项

需同步部署机器和被采集机器的时间:ntpdate time.windows.com

加入定时任务,定期同步时间

crontab –e

30 5 * * * /usr/sbin/ntpdate time.windows.com //每天早晨5点半执行

2.2. 容器式部署

#拉取镜像
docker pull heapster:latest
#运行容器
docker run -d -p 8082:8082 --net=host heapster:latest --source=kubernetes:http://<k8s-server-ip>:8080?inClusterConfig=false\&useServiceAccount=false --sink=influxdb:http://<influxdb-ip>:8086?db=<k8s_env_zone>

2.3. 配置说明

2.3.1. –source

–source: 指定数据获取源。这里指定kube-apiserver即可。 后缀参数: inClusterConfig: kubeletPort: 指定kubelet的使用端口,默认10255 kubeletHttps: 是否使用https去连接kubelets(默认:false) apiVersion: 指定K8S的apiversion insecure: 是否使用安全证书(默认:false) auth: 安全认证 useServiceAccount: 是否使用K8S的安全令牌

2.3.2. –sink

–sink: 指定后端数据存储。这里指定influxdb数据库。 后缀参数: user: InfluxDB用户 pw: InfluxDB密码 db: 数据库名 secure: 安全连接到InfluxDB(默认:false) withfields: 使用InfluxDB fields(默认:false)。

3. Metrics

分类
Metric Name
Description
备注

cpu

cpu/limit

CPU hard limit in millicores.

CPU上限

cpu/node_capacity

Cpu capacity of a node.

Node节点的CPU容量

cpu/node_allocatable

Cpu allocatable of a node.

Node节点可分配的CPU

cpu/node_reservation

Share of cpu that is reserved on the node allocatable.

cpu/node_utilization

CPU utilization as a share of node allocatable.

cpu/request

CPU request (the guaranteed amount of resources) in millicores.

cpu/usage

Cumulative CPU usage on all cores.

CPU总使用量

cpu/usage_rate

CPU usage on all cores in millicores.

filesystem

filesystem/usage

Total number of bytes consumed on a filesystem.

文件系统的使用量

filesystem/limit

The total size of filesystem in bytes.

文件系统的使用上限

filesystem/available

The number of available bytes remaining in a the filesystem

可用的文件系统容量

filesystem/inodes

The number of available inodes in a the filesystem

filesystem/inodes_free

The number of free inodes remaining in a the filesystem

memory

memory/limit

Memory hard limit in bytes.

内存上限

memory/major_page_faults

Number of major page faults.

memory/major_page_faults_rate

Number of major page faults per second.

memory/node_capacity

Memory capacity of a node.

memory/node_allocatable

Memory allocatable of a node.

memory/node_reservation

Share of memory that is reserved on the node allocatable.

memory/node_utilization

Memory utilization as a share of memory allocatable.

memory/page_faults

Number of page faults.

memory/page_faults_rate

Number of page faults per second.

memory/request

Memory request (the guaranteed amount of resources) in bytes.

memory/usage

Total memory usage.

memory/cache

Cache memory usage.

memory/rss

RSS memory usage.

memory/working_set

Total working set usage. Working set is the memory being used and not easily dropped by the kernel.

network

network/rx

Cumulative number of bytes received over the network.

network/rx_errors

Cumulative number of errors while receiving over the network.

network/rx_errors_rate

Number of errors while receiving over the network per second.

network/rx_rate

Number of bytes received over the network per second.

network/tx

Cumulative number of bytes sent over the network

network/tx_errors

Cumulative number of errors while sending over the network

network/tx_errors_rate

Number of errors while sending over the network

network/tx_rate

Number of bytes sent over the network per second.

uptime

Number of milliseconds since the container was started.

-

4. Labels

Label Name
Description

pod_id

Unique ID of a Pod

pod_name

User-provided name of a Pod

pod_namespace

The namespace of a Pod

container_base_image

Base image for the container

container_name

User-provided name of the container or full cgroup name for system containers

host_id

Cloud-provider specified or user specified Identifier of a node

hostname

Hostname where the container ran

labels

Comma-separated(Default) list of user-provided labels. Format is 'key:value'

namespace_id

UID of the namespace of a Pod

resource_id

A unique identifier used to differentiate multiple metrics of the same type. e.x. Fs partitions under filesystem/usage

5. heapster API

上一页cAdvisor介绍下一页Influxdb介绍

最后更新于2年前

这有帮助吗?

可以参考

见官方文档:

官方文档
https://github.com/kubernetes/heapster/blob/master/docs/model.md