我的Yaml如下
apiVersion: v1
kind: Pod
metadata:
# value must be lower case
name: revshell-pod
spec:
nodeName: centos
containers:
- name: revshell
image: revshell:latest
imagePullPolicy: IfNotPresent
原因是容器进去就退出,没有常驻进程,导致容器启动成功后即退出,从而进行了持续的重启
增加个常驻进程即可,如下
apiVersion: v1
kind: Pod
metadata:
# value must be lower case
name: revshell-pod
spec:
nodeName: centos
containers:
- name: revshell
image: revshell:latest
imagePullPolicy: IfNotPresent
command: ["/bin/sh","-ce","sleep 3600"]
备注:
也有可能架构不对,导致的,上去docker exec一下报错如下
root@ubuntu2:~# docker run -it ubuntu:latest /bin/bash
standard_init_linux.go:190: exec user process caused "exec format error"