apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:      
      containers:
      - name: nginx
        image: nginx
        lifecycle:
          postStart:
            exec:
              command:
                - "curl"
                - "-X"
                - "POST"
                - "http://pruu.herokuapp.com/dump/lifecyclestart"
          preStop:
            exec:
              command:
                - "curl"
                - "-X"
                - "POST"
                - "http://pruu.herokuapp.com/dump/lifecyclestop"
        resources:
          limits:
            memory: "32Mi"
            cpu: "500m"
        ports:
        - containerPort: 80
