apiVersion: apps/v1
kind: Deployment
metadata:
  name: pact-broker
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pact-broker
  template:
    metadata:
      labels:
        app: pact-broker
    spec:
      containers:
      - image: pactfoundation/pact-broker:2.81.0.1
        imagePullPolicy: Always
        securityContext:
          runAsNonRoot: True
          runAsUser: 100
        name: app
        readinessProbe:
          tcpSocket:
            port: 9292
        ports:
        - containerPort: 9292
          name: http
        env:
        - name: PACT_BROKER_PORT
          value: "9292"
        - name: PACT_BROKER_ALLOW_PUBLIC_READ
          value: "true"
        - name: PACT_BROKER_DATABASE_USERNAME
          valueFrom:
            secretKeyRef:
              name: database
              key: username
        - name: PACT_BROKER_DATABASE_PASSWORD
          valueFrom:
            secretKeyRef:
              name: database
              key: password
        - name: PACT_BROKER_DATABASE_HOST
          valueFrom:
            secretKeyRef:
              name: database
              key: host
        - name: PACT_BROKER_DATABASE_NAME
          valueFrom:
            secretKeyRef:
              name: database
              key: name
        - name: PACT_BROKER_BASIC_AUTH_USERNAME
          valueFrom:
            secretKeyRef:
              name: basic-auth
              key: username
        - name: PACT_BROKER_BASIC_AUTH_PASSWORD
          valueFrom:
            secretKeyRef:
              name: basic-auth
              key: password
