随笔 - 121
文章 - 0
评论 - 2
阅读 -
69673
随笔分类 - K8S
K8S 集群 apiserver-advertise-address实例节点IP切换VIP
摘要:执行kubectl 时 报错现象:Unable to connect to the server: x509: certificate is valid for 10.96.0.1, 10.103.x.x, 192.168.0.x, 10.103.x.x, 10.103.x.x, 127.0.0.1
阅读全文
故障etcd 节点 加入现有集群
摘要:故障etcd 节点 加入现有集群 恢复步骤: 1、查看故障节点的etcd状态并关闭服务 systemctl status etcd && systemctl stop etcd 2、列出现有的集群节点ID ETCDCTL_API=3 /opt/etcd/bin/etcdctl --cacert=/o
阅读全文
kubeadm 部署k8s 集群时coredns 报错calico x509 错误
摘要:1、现象: Warning FailedCreatePodSandBox 4m57s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox
阅读全文
执行helm list 提示kube/config 告警问题
摘要:1.现象 WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /root/.kube/config 2.分析原因: 文件权限问题导致 3.解决方法: chmod g-rw ~/.k
阅读全文
执行kubectl api-resources 报错error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request
摘要:1、故障现象:error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request 2、分析原因
阅读全文
prometheus 配置数据保留7天时间storage.tsdb.retention.time
摘要:1.修改配置如下: 注:单位可以以h,d 小时,天数表示 默认24h添加配置:retention: 168h
阅读全文
error: You must be logged in to the server (Unauthorized) 问题处理
摘要:故障现象: 执行kubectl 命令时; 提示"error: You must be logged in to the server (Unauthorized)" 分析: 权限问题,身份认证的文件未配置 原因: 常见部署或者初始化后$HOME/.kube/config文件没有得到替换 解决方法:将
阅读全文
docker 开启 2375 远程端口
摘要:1.修改 /usr/lib/systemd/system/docker.service 配置文件 添加 "-H tcp://0.0.0.0:2375" ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H fd:// --containerd=/ru
阅读全文
k8s iptables 改造ipvs
摘要:1.修改iptables 为ipvs 模式 ipvs 采用的 hash 表,iptables 采用一条条的规则列表。集群数量越多 iptables 规则就越多,而 iptables 规则是从上到下匹配,所以效率就越是低下。因此当 service 数量达到一定规模时,hash 查表 的速度优势就会显现
阅读全文
k8s--docker状态码
摘要:最常见的退出码,来回答两个重要问题:这些退出码是什么意思?导致该退出码的动作是什么?exit code:代表一个进程的返回码,通过系统调用 exit_group 来触发。在 POSIX 中,0 代表正常的返回码,而 1-255 代表异常返回码,不过一般错误码都是 1。这里有一张附表 Appendix
阅读全文
calico 报auto-detect an IPv4 address using interface regexes [ens18]: no valid host interfaces found 问题处理
摘要:现象:.查看 calico pod 的时候 报auto-detect an IPv4 address using interface regexes [ens18]: no valid host interfaces found 分析:calico 开启了ipvs 地址自动检测的功能,然后匹配不到对
阅读全文
拉取镜像报Error response from daemon: Get https://: http: server gave HTTP response to HTTPS client
摘要:现象:拉取镜像报Error response from daemon: Get https://: http: server gave HTTP response to HTTPS client harbor默认是https协议的,如果想要通过http协议拉取harbor的镜像需要修改k8s每个节点
阅读全文
主机换ip ,导致master 节点执行 kubectl get cs 报Unable to connect to the server: x509: certificate is valid for 10.96.0.1xxxxx
摘要:1.把etcd 里面由原来ip产生的ca 文件 改成新ip重新生成新ip ca 文件,启动etcd ,验证etcd 成功后再往下走 2.查看apiserver 证书,证书没有所需要的ip地址 openssl x509 -noout -text -in /etc/kubernetes/pki/apis
阅读全文
配置docker 容器自定义ip 网段
摘要:1. 打开 cat /etc/docker/daemon.json 添加 "bip":"192.168.0.1/16", 配置如下 { "bip":"192.168.0.1/16", "data-root": "/data/bkce/public/paas_agent/docker", "exec-
阅读全文
清除calico CNI 插件脏数据
摘要:操作命令如下: rm /var/lib/cni/ -rf && rm -f /etc/cni/net.d/*systemctl restart docker containerd kubelet
阅读全文
clusterrole "prometheus-k8s" 权限配置
摘要:现象: Failed to watch *v1.Endpoints: failed to list *v1.Endpoints: endpoints is forbidden: User \"system:serviceaccount:monitoring:prometheus-k8s\" cann
阅读全文
k8s 集群节点 SLUB: Unable to allocate memory on node -1 cgroup 内存泄露问题
摘要:1.原因 cgroup 的 kmem account 特性在 3.x 内核上有内存泄露问题,如果开启了 kmem account 特性 会导致可分配内存越来越少,直到无法创建新 pod 或节点异常 几点解释: kmem account 是cgroup 的一个扩展,全称CONFIG_MEMCG_KME
阅读全文
组件apisix 报鉴权问题
摘要:现象:level=error ts=2022-06-15T02:35:42.621Z caller=klog.go:96 component=k8s_client_runtime func=ErrorDepth msg="pkg/mod/k8s.io/client-go@v0.20.5/tools/
阅读全文
k8s prometheus 找不到 etcd-ssl
摘要:现象:MountVolume.SetUp failed for volume "secret-etcd-ssl" : secret "etcd-ssl" not found 处理方法:kubectl -n monitoring create secret generic etcd-ssl --fro
阅读全文