k8s 每个 node 如果大于 cpu 核数
node_load15 > (count without(cpu, mode) (node_cpu_seconds_total{mode="idle"}) * 0.8)
查看一个 namespace 有多少个 pod
kube_pod_info{namespace="app"}
k8s 每个 node 如果大于 cpu 核数
node_load15 > (count without(cpu, mode) (node_cpu_seconds_total{mode="idle"}) * 0.8)
查看一个 namespace 有多少个 pod
kube_pod_info{namespace="app"}
文件描述符不够
在 systemd 的配置文件 filebeat.service 中,配置 limit
[Unit] Description=Filebeat sends log files to Logstash or directly to Elasticsearch. Documentation=https://www.elastic.co/products/beats/filebeat Wants=network-online.target After=network-online.target [Service] ExecStart=/usr/share/filebeat/bin/filebeat -c /etc/filebeat/filebeat.yml -path.home /usr/share/filebeat -path.config /etc/filebeat -path.data /var/lib/filebeat -path.logs /var/log/filebeat Restart=always LimitNOFILE=1000000 LimitNPROC=1000000 [Install] WantedBy=multi-user.target
对于 dhcp 获取 ip 的 vpc ecs,会强制更改 /etc/resolv.conf,使用如下方式防止替换
/etc/sysconfig/network-scripts/ifcfg-eth0 添加 PEERDNS=no
1 问题:
FAILED! => {“changed”: false, “module_stderr”: “sudo: sorry, you must have a tty to run sudo\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}
解决 visudo,将 Defaults requiretty 注释掉
2.
FAILED! => {“changed”: false, “msg”: “Failed to reload sysctl: vm.max_map_count = 262144\nnet.ipv4.ip_forward = 1\nsysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such file or directory\nsysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such file or directory\n”}
解决:
modprobe br_netfilter
集群和 namespace 信息配置在
~/.kube/config
查看当前的 context
kubectl config current-context
切换 namespace
alias kcd='kubectl config set-context $(kubectl config current-context) --namespace'
切换集群
kubectl config use-context dev-admin@dev
使用工具进行快速切换
https://github.com/ahmetb/kubectx
brew install kubectx
查看 config 配置
kubectl config view
windows 自带的 terminal 太难用了,用 git bash
https://stackoverflow.com/questions/20573213/embed-git-bash-in-pycharm-as-external-tool-and-work-with-it-in-pycharm-window-w
git bash upgrade
$ git version
git version 2.24.0.windows.2
$ git update-git-for-windows
Or download from official site
https://git-scm.com/downloads