apiVersion: apps/v1
kind: Deployment
metadata:
  name: webmon
spec:
  replicas: 3
  selector:
    matchLabels:
      app: webmon
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 100%
  template:
    metadata:
      labels:
        app: webmon
    spec:
      containers:
      - name: webmon
        image: pitnub/webmon:0.1
        livenessProbe:
          tcpSocket: { port: 80 }
        readinessProbe:
          httpGet:
            path: /index.html
            port: 80
        ports:
        - name: web
          containerPort: 80
      - name: exporter
        image: nginx/nginx-prometheus-exporter:0.9.0
        args: ["-nginx.scrape-uri=http://127.0.0.1/basic_status", "-nginx.retries=3"]
        ports:
        - name: exporter
          containerPort: 9113
