2019 年 9 月手记
Kubernetes
kubernetes 生产环境性能优化
https://caicloud.io/blog/57392eca8241681100000003
容器内信息注入
kubernetes scheduler
https://ggaaooppeenngg.github.io/zh-CN/2017/09/26/kubernetes-%E6%8C%87%E5%8C%97/
https://caicloud.io/blog/57392eca8241681100000003
https://coreos.com/blog/improving-kubernetes-scheduler-performance.html
kubernetes cpu manager
https://github.com/kubernetes/kubernetes/issues/67577
https://kubernetes.io/blog/2018/07/24/feature-highlight-cpu-manager/
https://cloud.tencent.com/developer/article/1402119
https://bugzilla.kernel.org/show_bug.cgi?id=198197
https://gist.github.com/bobrik/2030ff040fad360327a5fab7a09c4ff1
https://github.com/kubernetes/kubernetes/issues/66614
https://github.com/opencontainers/runc/issues/1635
https://twitter.com/try_except_/status/1131459031376252928
debug kubernetes service
排查 kubernetes service 问题的步骤:
关于容器内 sysctl 的问题
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/sysctl.md
https://github.com/kubernetes/kubernetes/issues/29572#issuecomment-236193826
https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
https://github.com/moby/moby/issues/4611
https://github.com/moby/moby/issues/35993
docker
镜像 sha256 地址
根据镜像的 id 获取 sha256 地址:
1 | docker image inspect --format='{{index .RepoDigests 0}}' ${IMAGE} |
根据镜像的 sha256 地址拉取镜像:
1 | docker pull ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 |
Linux
exit code 和 signal 的对应关系
1 | signal = exit code - 128 |
1 | kill -l |
https://stackoverflow.com/questions/23098695/strange-return-value-134-to-call-gawk-in-bash-script
更详细的关于 linux exit code 的介绍:
http://www.tldp.org/LDP/abs/html/exitcodes.html
shell 学习
https://github.com/jlevy/the-art-of-command-line/blob/master/README-zh.md
https://github.com/dylanaraps/pure-sh-bible
Advanced Bash-Scripting Guide
https://www.tldp.org/LDP/abs/html/index.html
Golang
一个用 golang 实现的执行 cron 定时任务的库
https://github.com/robfig/cron
Testing Your (HTTP) Handlers in Go
https://blog.questionable.services/article/testing-http-handlers-go/