随笔 - 121
文章 - 0
评论 - 2
阅读 -
69673
随笔分类 - K8S
kubeadm init 报错ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables
摘要:现象: [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1 原因: /proc
阅读全文
kubeadm 加入work 节点集群时报 http://localhost:10248/healthz处理方法
摘要:现象: [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tc
阅读全文
scheduler,kube-controller-manager 报server returned HTTP status 401 Unauthorized
摘要:现象:K8S 组件报 server returned HTTP status 401 Unauthorized,看apiserver 日志有很多Unable to authenticate the request" err="[x509: certificate has expired or is
阅读全文
K8S 使用GPU 节点资源问题配置
摘要:说明:2024/04/08 nvidia-container-runtime,现在叫 nvidia-container-toolkit gpu共享技术(提高资源利用率): 时间分片Time-Slicing多实例 GPU (MIG)多进程服务 (MPS) 启动服务 nvidia-cuda-mps-co
阅读全文
k8s coredns服务报 Readiness probe failed 8181: connect: connection refused
摘要:现象:Readiness probe failed 8181: connect: connection refused 1、分析: kubectl 直接 describe CoreDNS Pod,显示 ReadinessProbe 探针异常,导致 Pod 无法正常启动,由于 ReadinessPro
阅读全文
prometheus远程永久存储方案VictoriaMetrics 部署单机版
摘要:1、单机版下载地址: https://github.com/VictoriaMetrics/VictoriaMetrics 注:集群版选择cluster版本 2、下载解压得到二进制文件 tar -xf victoria-metrics-linux-amd64-v1.93.1.tar.gz mv vi
阅读全文
kubeadm 部署的集群升级、回滚教程
摘要:#K8S升级步骤,注意升级集群会重置coredns 自定义的域名解析,小版本升级,最好不要跨几个大版本升级 1、确定升级的集群版本,查看现有的集群版本 kubectl get nodes 2、执行如下命令确定升级的版本,目标版本是v1.27.4 yum list --showduplicates k
阅读全文
执行kubeadm 出现 FATAL: the ConfigMap "kubeadm-config" in the kube-system namespace used for getting configuration information was not found
摘要:现象: [upgrade/config] Making sure the configuration is correct:[upgrade/config] Reading configuration from the cluster...[upgrade/config] FYI: You can
阅读全文
创建pod ,分配不了ip 问题
摘要:现象:Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "84f81f2eb977db06dcafa1bd9d6000bc562d0c57b83484d
阅读全文
K8S 1.27.1版本初始化配置文件时报your configuration file uses an old API spec: "kubeadm.k8s.io/v1beta2". Please use kubeadm v1.22 instead and run 'kubeadm config migrate
摘要:现象: your configuration file uses an old API spec: "kubeadm.k8s.io/v1beta2". Please use kubeadm v1.22 instead and run 'kubeadm config migrate --old-con
阅读全文
查看K8S /etc/kubernetes/admin.conf或/root/.kube/config 过期时间
摘要:1、复制 client-certificate-data: 如下的内容 2、 执行解密 echo" client-certificate-data的内容" |base64 -d >c.crt 3、查看过期时间 cfssl certinfo -cert c.crt 查看 not_before 和not
阅读全文
现有K8S集群加入master节点(移除后加入)
摘要:现象:后加入master节点报错 error execution phase control-plane-prepare/download-certs: error downloading certs: the Secret does not include the required certifi
阅读全文
容器环境下访问服务出现 Address not available 报错
摘要:1、现象:访问服务时出现如下报错 2、原因:通过 netstat -an 查看到连接 svc 的地址,其中 estab 状态的连接数,已经到达了可用的随机端口数量阈值,无法在新建连接了 执行命令查看: netstat -tan|grep ESTABLISHED|wc -l sysctl -a|gre
阅读全文
kubelet报bootstrap-kubelet.conf: no such file or directory" 处理方法
摘要:1、 kubelet 启动 报 unable to load bootstrap kubeconfig: stat /etc/kubernetes/bootstrap-kubelet.conf: no such file or directory" 2、原因: 由于kubelet.conf配置不正确
阅读全文
hostAliases给pod增加域名解析
摘要:前言:我们知道k8s访问内部域名可以使用 pod名.namespace.svc.cluster.local,但有时需要往pod增加自定义的host解析。有一个参数可以支持,在deployment.spec.spec中添加1、添加配置如下 spec: hostAliases: - ip: 10.107
阅读全文
K8S coredns ndots 优化
摘要:解析:ndots 含义 ndots 意思就是 点号. (dot) 的个数ndots: 5 就是 5个点号5个点号 的意思就是说对于一个 域名, 如果不是完全限定名(即某个域名不是以. 结尾, a.com 不是, a.com. 是)且点号数量少于5个, 那么就按照 search 的顺序,依次解析如果点
阅读全文
pod 容器通过环境变量添加日志等级日志输出
摘要:1、日志级别有 "debug", "info", "warn", "error", "fatal", "panic" 2、给服务添加环境变量 kubectl set env LOG_LEVEL=info deployments.apps/nginx
阅读全文
生产K8S 集群优化
摘要:#数据背景: *100000+ pod *1300+node *3集群(单:11Master + 17ETCD) #遇到的问题: apiserver 调度,延时问题 Controller 不能及时从 API Server 感知到最新的变化,处理的延时较高 Scheduler 延迟高、吞吐低,无法适应
阅读全文
动态pvc 配置 样例
摘要:cat loki-pvc.yaml kind: PersistentVolumeClaim apiVersion: v1 metadata: name: loki namespace: monitoring # 指定namespace为monitoringspec: storageClassName
阅读全文