apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: fleet-webserver
  labels:
    app: fleet-webserver
spec:
  replicas: 2
  selector:
    matchLabels:
      app: fleet-webserver
  template:
    metadata:
      labels:
        app: fleet-webserver
    spec:
      volumes:
        - name: fleet-tls
          secret:
            secretName: fleet-tls
      containers:
        - name: fleet-webserver
          image: fleetdm/fleet:4.0.1
          command: ["fleet", "serve"]
          ports:
            - containerPort: 443
          volumeMounts:
            - name: fleet-tls
              mountPath: "/secrets/fleet-tls"
              readOnly: true
          env:
            - name: FLEET_MYSQL_ADDRESS
              value: fleet-database-mysql:3306
            - name: FLEET_MYSQL_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: fleet-database-mysql
                  key: mysql-password
            - name: FLEET_REDIS_ADDRESS
              value: fleet-cache-redis:6379
            - name: FLEET_REDIS_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: fleet-cache-redis
                  key: redis-password
            - name: FLEET_SERVER_ADDRESS
              value: "0.0.0.0:443"
            - name: FLEET_SERVER_CERT
              value: "/secrets/fleet-tls/tls.crt"
            - name: FLEET_SERVER_KEY
              value: "/secrets/fleet-tls/tls.key"
