---
apiVersion: v1
kind: Namespace
metadata:
  name: auto-pause
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: auto-pause-proxy
  namespace: auto-pause
  labels:
    app: auto-pause-proxy
    auto-pause-skip: "true"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: auto-pause-proxy
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: auto-pause-proxy
    spec:
      volumes:
      - name: ha-cfg
        hostPath:
          path: /var/lib/minikube/haproxy.cfg
          type: File
      - name: lua-script
        hostPath:
          path: /var/lib/minikube/unpause.lua
          type: File
      containers:
        - name: auto-pause
          image: "haproxy:2.3.5-alpine"
          ports:
            - name: https
              containerPort: 6443
              hostPort: 32443
              protocol: TCP
          volumeMounts:
          - name: ha-cfg
            mountPath: /usr/local/etc/haproxy/haproxy.cfg
            readOnly: true
          - name: lua-script
            mountPath: /etc/haproxy/unpause.lua