简单的busybox 的yaml 文件
kind: Deployment
apiVersion: apps/v1
metadata:
name: clearlog
namespace: default
labels:
app: busybox
spec:
replicas: 3
selector:
matchLabels:
app: clearlog
template:
metadata:
labels:
app: clearlog
spec:
volumes:
- name: cronfile
hostPath:
path: /
type: DirectoryOrCreate
containers:
- name: busybox
image: busybox
command: ["/bin/sh"]
args: ["-c"," sleep 3600"]
volumeMounts:
- mountPath: /logs
name: cronfile
apiVersion: v1
kind: Pod
metadata:
name: clearlog
spec:
nodeSelector:
kubernetes.io/hostname: ip-10-132-37-168.ap-east-1.compute.internal # 指定节点调度
volumes:
- name: cronfile
hostPath:
path: /
type: DirectoryOrCreate
containers:
- name: busybox
image: busybox
command: ["/bin/sh"]
args: ["-c"," sleep 3600"]
volumeMounts:
- mountPath: /logs
name: cronfile
标签:busybox,name,cronfile,app,clearlog,yaml,file
From: https://www.cnblogs.com/JimsLzm/p/17503755.html