Linux随记(十八)

一、k8s的node节点磁盘 /data已使用率超过 85% , 出现disk pressure ,驱逐pod现象

evicted , the node had condition:[DiskPressure]

shell 复制代码
#修改/var/lib/kubelet/config.yaml
]# cat /var/lib/kubelet/config.yaml
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
  anonymous:
    enabled: false
  webhook:
    cacheTTL: 0s
    enabled: true
  x509:
    clientCAFile: /etc/kubernetes/pki/ca.crt
authorization:
  mode: Webhook
  webhook:
    cacheAuthorizedTTL: 0s
    cacheUnauthorizedTTL: 0s
cgroupDriver: systemd
clusterDNS:
- 10.96.0.10
clusterDomain: cluster.local
cpuManagerReconcilePeriod: 0s
evictionPressureTransitionPeriod: 0s
fileCheckFrequency: 0s
healthzBindAddress: 127.0.0.1
healthzPort: 10248
httpCheckFrequency: 0s
imageMinimumGCAge: 0s
kind: KubeletConfiguration
logging:
  flushFrequency: 0
  options:
    json:
      infoBufferSize: "0"
  verbosity: 0
memorySwap: {}
nodeStatusReportFrequency: 0s
nodeStatusUpdateFrequency: 0s
rotateCertificates: true
runtimeRequestTimeout: 0s
shutdownGracePeriod: 0s
shutdownGracePeriodCriticalPods: 0s
staticPodPath: /etc/kubernetes/manifests
streamingConnectionIdleTimeout: 0s
syncFrequency: 0s
volumeStatsAggPeriod: 0s

#202506 添加:
evictionHard:
  imagefs.available: 1%
  memory.available: 100Mi
  nodefs.available: 1%
  nodefs.inodesFree: 1%



#重启该node节点的 kubelet
systemctl restart kubelet
systemctl status kubelet
shell 复制代码
#参考文章:
https://blog.csdn.net/qq_59634082/article/details/136868417   《k8s资源不足时驱赶pod阈值调整》
https://stackoverflow.com/questions/54155534/kubernetes-eviction-manager-evicting-control-plane-pods-to-reclaim-ephemeral-sto/60068671#60068671  
https://devpress.csdn.net/k8s/62ffc7fac67703293080625f.html  《Kubernetes 驱逐管理器驱逐控制平面 pod 以回收临时存储》

END

二、删除ES索引和其数据。

shell 复制代码
k8s上部署3个ES节点 , 版本elasticsearch:7.6.0 。 删除索引名称带202407的索引。

 kubectl exec -it  es-new-0 -n test bash
#查看索引名称
curl -s "http://192.168.1.100:9200/_cat/indices?h=index"  | grep -i "202407"
#删除索引 【三个ES节点的IP 都要执行】
curl -X DELETE "http://192.168.1.100:9200/api_xxx_202407*"
curl -X DELETE "http://192.168.1.101:9200/api_xxx_202407*"
curl -X DELETE "http://192.168.1.102:9200/api_xxx_202407*"


###查看占用容量 , 单位MB
curl "http://192.168.1.100:9200/_cat/allocation?v&bytes=gb"
curl "http://192.168.1.100:9200/_cat/indices/api_xxx_202407*?v&h=index,store.size,pri.store.size,status&bytes=mb&s=store.size:desc"
shell 复制代码
参考文章:
https://blog.csdn.net/weixin_44711737/article/details/125833601  《ES索引清理脚本-总结》 (清理脚本:ES有密码,索引按(周、日)时间命名的清理脚本)

END

相关推荐
敲上瘾33 分钟前
Linux系统cgroups资源精细化控制基础
linux·测试工具·docker·压力测试·cgroups
起个昵称吧1 小时前
线程相关编程、线程间通信、互斥锁
linux·算法
sunflower_w1 小时前
linux I2C核心、总线与设备驱动
linux·运维·服务器
myzzb2 小时前
基于uiautomation的自动化流程RPA开源开发演示
运维·python·学习·算法·自动化·rpa
Ronin3052 小时前
【Linux系统】进程间通信:System V IPC——共享内存
linux·服务器·system v 共享内存
网硕互联的小客服3 小时前
Apache 如何支持SHTML(SSI)的配置方法
运维·服务器·网络·windows·php
基于python的毕设3 小时前
C语言栈的实现
linux·c语言·ubuntu
落日漫游4 小时前
K8s核心组件全解析
运维·docker·运维开发
luoqice4 小时前
linux下找到指定目录下最新日期log文件
linux·算法
林开落L4 小时前
库的制作与原理
linux·开发语言·动静态库·库的制作