- Kubernetes
catagories: - Kubernetes
1. heapster简介
Heapster是容器集群监控和性能分析工具,天然的支持Kubernetes和CoreOS。
Kubernetes有个出名的监控agent—cAdvisor。在每个kubernetes Node上都会运行cAdvisor,它会收集本机以及容器的监控数据(cpu,memory,filesystem,network,uptime)。
2. heapster部署与配置
需同步部署机器和被采集机器的时间:ntpdate time.windows.com
crontab –e
30 5 * /usr/sbin/ntpdate time.windows.com //每天早晨5点半执行
–source: 指定数据获取源。这里指定kube-apiserver即可。
后缀参数:
inClusterConfig:
kubeletPort: 指定kubelet的使用端口,默认10255
kubeletHttps: 是否使用https去连接kubelets(默认:false)
apiVersion: 指定K8S的apiversion
insecure: 是否使用安全证书(默认:false)
auth: 安全认证
useServiceAccount: 是否使用K8S的安全令牌
–sink: 指定后端数据存储。这里指定influxdb数据库。
后缀参数:
user: InfluxDB用户
pw: InfluxDB密码
db: 数据库名
secure: 安全连接到InfluxDB(默认:false)
withfields: 使用InfluxDB fields(默认:false)。
3. Metrics
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 |