k8s中运行BusyBox

简介

参考百度百科

BusyBox 是一个集成了三百多个最常用Linux命令和工具的软件。

BusyBox 包含了一些简单的工具,例如ls、cat和echo等等,还包含了一些更大、更复杂的工具,例grep、find、mount以及telnet。

有些人将 BusyBox 称为 Linux 工具里的瑞士军刀。

简单的说BusyBox就好像是个大工具箱,它集成压缩了 Linux 的许多工具和命令,也包含了 Linux 系统的自带的shell。

前台运行BusyBox

1.28

1.34

方式一:

kubctl run -h

  # Start the nginx pod using a different command and custom arguments
  kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>

每3600秒RESTART 

kubectl run busybox --image=busybox:1.34 --command -- sleep 3600

如果设置的是60秒

方式二:

cat<<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: busybox
  namespace: default
spec:
  containers:
  - name: busybox
    image: busybox:1.34
    command:
      - sleep
      - "3600"
    imagePullPolicy: IfNotPresent
  restartPolicy: Always
EOF

  

============================= 好好学习 ==========================
> > > 1、咨询问题,请加作者微信: ren168632201
> > > 2、性能测试从0到实战: https://www.cnblogs.com/uncleyong/p/12311432.html
> > > 3、自动化测试实战: https://www.cnblogs.com/uncleyong/p/12016690.html
> > > 4、测试基础汇总: https://www.cnblogs.com/uncleyong/p/10530261.html
> > > 5、声明:如有侵权,请联系删除。
============================= 升职加薪 ==========================
原文地址:https://www.cnblogs.com/uncleyong/p/15434823.html