apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  strategy:
    type: Recreate
  replicas: 1
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: my_nginx
        imagePullPolicy: Never
        ports:
          - name: http
            containerPort: 80
          - name: https
            containerPort: 443
        livenessProbe:
          exec:
            command:
            - sh
            - -c
            - "service telegraf status && ps nginx"
          initialDelaySeconds: 5
          periodSeconds: 5
