silenceshell

Results 10 comments of silenceshell

> I think what we actually want is to control this with `kubectl.kubernetes.io/default-container` > > https://kubernetes.io/docs/reference/labels-annotations-taints/#kubectl-kubernetes-io-default-container This is a good choice, my only concern is backward compatible, as `default-container-annotation` is...

现在确实是不支持的。未来有时间可以实现

是的,开发的时候有注意到,这是由于topic使用的[termui](https://github.com/gizak/termui)没有提供可以定制退出行为的选项。 我会尝试向termui提需求。

would you help to provide some details: 1. run`cat /sys/fs/cgroup/memory/memory.max_usage_in_bytes` in container 2. run `cat /sys/fs/cgroup/memory/memory.limit_in_bytes` in container 3. run `docker stats` on host where the container is running

topic和top一样,计算进程的内存使用率是 驻留内存(res)/总内存 ,docker stats的计算方法也是类似的。 kubernetes top计算的内存使用率,使用的是 container_memory_working_set_bytes ,它包括了驻留内存、dirty memory、kernel memory,它的值比res要大,比usage要小。注意oom是按照kubectl top的值来计算的。 [Understanding Kubernetes Memory Metrics](https://www.magalix.com/blog/memory_working_set-vs-memory_rss)

sidecar无法修改app container的容器文件系统,所以不能直接替换app container的top命令。 可以将topic装载到configmap或者其他形式的volume,然后通过 volume subpath 的方式将topic命令挂载到`/bin/top`。