apiVersion: apps/v1
kind: Deployment
metadata:
  name: haproxy-lb
  labels:
    app: haproxy-lb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: haproxy-lb
  template:
    metadata:
      labels:
        app: haproxy-lb
    spec:
      containers:
      - image: haproxytech/haproxy-alpine:2.0.4
        imagePullPolicy: Always
        name: haproxy
        ports:
        - containerPort: 8443
          protocol: TCP
        - containerPort: 8080
          protocol: TCP
        volumeMounts:
        - mountPath: /etc/haproxy
          name: config
      volumes:
      - configMap:
          defaultMode: 420
          items:
          - key: haproxy
            path: haproxy.cfg
          name: haproxy
        name: config
