apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    dep: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: kystkysto/nginx:stable
        readinessProbe:
            httpGet:
              path: /basic_status
              port: 8000
        livenessProbe:
            tcpSocket:
              port: 8000
        ports:
          - containerPort: 8000
            name: port-http
      - name: nginx-exporter
        image: nginx/nginx-prometheus-exporter:0.5.0
        args: ['-nginx.scrape-uri', 'http://localhost:8000/basic_status']
        ports:
          - containerPort: 9113
            name: port-metrics
