busybox yaml file

发布时间 2023-06-25 19:18:36作者: Jims-Li

简单的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