2025年12月14日

shell 判断二进制是否可用

摘要: # 结果是yes checkCmd='docker --version' res=`eval $checkCmd 1>/dev/null 2>&1; echo -n $?` resStr=`echo -n $res` if [[ "$resStr" == "0" ]]; then echo "yes 阅读全文

posted @ 2025-12-14 16:38 王景迁 阅读(2) 评论(0) 推荐(0)

shell 容器执行脚本有异常时直接退出

摘要: # pod.yaml # set -e:当脚本中有命令执行返回非0时,脚本会立即终止执行并异常退出。 # set -u:当脚本中引用了未定义的变量时,脚本会立即终止执行并异常退出。 ... containers: - name: busybox image: docker.io/library/bu 阅读全文

posted @ 2025-12-14 15:49 王景迁 阅读(3) 评论(0) 推荐(0)

k8s Etcd版本号

摘要: # 下载etcdctl二进制并放入容器 curl -O https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-amd64.tar.gz tar -zxvf etcd-v3.5.0-linux-amd64. 阅读全文

posted @ 2025-12-14 15:34 王景迁 阅读(1) 评论(0) 推荐(0)

2025年12月9日

对象存储s5cmd常用命令

摘要: # 安装s5cmd apt install -y gdebi-core apt install -y wget wget https://github.com/peak/s5cmd/releases/download/v2.2.1/s5cmd_2.2.1_linux_amd64.deb echo y 阅读全文

posted @ 2025-12-09 09:11 王景迁 阅读(18) 评论(0) 推荐(0)

shell sort排序

摘要: # sort默认按字符排序,使用数值排序 sort -n # 按照指定列排序 sort -k [第几列|1] -t [间隔符|_] # 去除重复行 sort -u # sort默认升序,使用降序排列 sort -r 阅读全文

posted @ 2025-12-09 08:57 王景迁 阅读(4) 评论(0) 推荐(0)

k8s cronjob设置定时执行周期

摘要: # 每分钟执行一次 schedule: "* * * * *"或者schedule: "*/1 * * * *" # 每小时0分执行一次 schedule: "0 * * * *" # 每天0点0时0分执行一次 schedule: "0 0 * * *" 阅读全文

posted @ 2025-12-09 08:44 王景迁 阅读(1) 评论(0) 推荐(0)

Linux SR-IOV

摘要: SR-IOV即SingleRootI/OVirtualization,是硬件辅助虚拟化标准,通过物理网卡(PF)虚拟出多个虚拟网卡(VF)来使虚拟机或者容器直接访问硬件资源。其中,PF转VF是需要硬件支持的。 具体步骤PF转VF:通过PF生成指定数量的VF。配置VF:给每个VF分配MAC地址和VLA 阅读全文

posted @ 2025-12-09 08:32 王景迁 阅读(4) 评论(0) 推荐(0)

shell eval作用

摘要: eval可以把字符串当成shell命令执行。 阅读全文

posted @ 2025-12-09 08:19 王景迁 阅读(5) 评论(0) 推荐(0)

2025年12月7日

shell脚本内使用alias

摘要: shopt -s expand_aliases放在所有alias定义前面。 root@root1:~/sh# cat test.sh #!/bin/bash shopt -s expand_aliases alias k="kubectl -n kube-system " k get pod 阅读全文

posted @ 2025-12-07 14:43 王景迁 阅读(3) 评论(0) 推荐(0)

2025年12月1日

kubeadm命令总结

摘要: # 查看k8s管理面证书过期时间 kubeadm certs check-expiration 参考资料 https://kubernetes.io/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-init-phase/ # 基于kubeadm.ya 阅读全文

posted @ 2025-12-01 07:45 王景迁 阅读(7) 评论(0) 推荐(0)

导航