2019 年 9 月手记

Kubernetes

kubernetes 生产环境性能优化

https://caicloud.io/blog/57392eca8241681100000003

容器内信息注入

https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath-with-expanded-environment-variables

https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#capabilities-of-the-downward-api

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://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=de53fd7aedb100f03e5d2231cfce0e4993282425

https://bugzilla.kernel.org/show_bug.cgi?id=198197

https://gist.github.com/bobrik/2030ff040fad360327a5fab7a09c4ff1

https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/cpu-manager.md

https://www.slideshare.net/try_except_/ensuring-kubernetes-cost-efficiency-across-many-clusters-devops-gathering-2019

https://github.com/kubernetes/kubernetes/issues/66614

https://github.com/opencontainers/runc/issues/1635

https://twitter.com/try_except_/status/1131459031376252928

https://www.slideshare.net/try_except_/ensuring-kubernetes-cost-efficiency-across-many-clusters-devops-gathering-2019

debug kubernetes service

排查 kubernetes service 问题的步骤:

https://kubernetes.io/docs/tasks/debug-application-cluster/debug-service/#does-the-service-work-by-ip

关于容器内 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
2
3
4
5
6
7
8
9
10
11
12
13
14
kill -l

1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGEMT 8) SIGFPE
9) SIGKILL 10) SIGBUS 11) SIGSEGV 12) SIGSYS
13) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGUSR1
17) SIGUSR2 18) SIGCHLD 19) SIGPWR 20) SIGWINCH
21) SIGURG 22) SIGIO 23) SIGSTOP 24) SIGTSTP
25) SIGCONT 26) SIGTTIN 27) SIGTTOU 28) SIGVTALRM
29) SIGPROF 30) SIGXCPU 31) SIGXFSZ 32) SIGWAITING
33) SIGLWP 34) SIGFREEZE 35) SIGTHAW 36) SIGCANCEL
37) SIGLOST 38) SIGXRES 41) SIGRTMIN 42) SIGRTMIN+1
43) SIGRTMIN+2 44) SIGRTMIN+3 45) SIGRTMAX-3 46) SIGRTMAX-2
47) SIGRTMAX-1 48) SIGRTMAX

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://explainshell.com/

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/

Author

whypro

Posted on

2019-09-03

Updated on

2022-11-11

Licensed under

Comments

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×