kind: Pod
apiVersion: v1
metadata:
  name: ksh-pod
  labels:
    app: ksh
spec:
  containers:
  - name: klog-pod
    image: cn007b/ubuntu
    command: [
      'sh',
      '-c',
      "while true; do curl -i -XPOST 'https://realtimelog.herokuapp.com:443/rkc8q6llprn' -H 'Content-Type: application/json' -d '{\"code\":\"100\", \"status\": \"ok from pod\", \"env\":\"'$APP_ENV'\"}'; sleep 5; done",
    ]
    env:
    - name: APP_ENV
      value: "local"
    lifecycle:
      postStart:
        exec:
          command: [
            "/bin/sh",
            "-c",
            "curl -i -XPOST 'https://realtimelog.herokuapp.com:443/rkc8q6llprn' -H 'Content-Type: application/json' -d '{\"status\": \"pod postStart\", \"env\":\"'$APP_ENV'\"}'",
          ]
      preStop:
        exec:
          command: [
            "/bin/sh",
            "-c",
            "curl -i -XPOST 'https://realtimelog.herokuapp.com:443/rkc8q6llprn' -H 'Content-Type: application/json' -d '{\"status\": \"pod preStop\", \"env\":\"'$APP_ENV'\"}'",
          ]
    volumeMounts:
    - mountPath: /gh
      name: xvol
  - name: klog-pod-2
    image: cn007b/go
    volumeMounts:
    - mountPath: /gh
      name: xvol
    command: [
      'sh',
      '-c',
      "while true; do curl -i -XPOST 'https://realtimelog.herokuapp.com:443/rkc8q6llprn' -H 'Content-Type: application/json' -d '{\"code\":\"100\", \"status\": \"ok from pod-2\"}'; sleep 5; done",
    ]
  volumes:
  - name: xvol
    hostPath:
      path: /gh
      type: DirectoryOrCreate
