apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: dummy
  labels:
    app: dummy
spec:
  selector:
    matchLabels:
      app: dummy
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: dummy
    spec:
      terminationGracePeriodSeconds: 5
      containers:
        - name: dummy
          image: local/dummy
          imagePullPolicy: Never
          lifecycle:
            preStop:
              exec:
                command:
                  - pkill -f "sleep"
          env:
            - name: REDIS_ADDRESS
              value: "redis.default:6379"
            - name: MYSQL_PASSWORD
              value: "keda-talk"
            - name: MYSQL_CONN
              value: "root@tcp(mysql:3306)/mysql"