## Required to use an external/persistent keystore, otherwise a keystore using
## self-signed certificates will be generated
# ---
# apiVersion: v1
# kind: Secret
# metadata:
#   name:  gerrit-operator-ssl
#   namespace: gerrit-operator
# data:
#   keystore.jks: # base64-encoded Java keystore
#   keystore.password: # base64-encoded Java keystore password
# type: Opaque

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gerrit-operator
  namespace: gerrit-operator
spec:
  selector:
    matchLabels:
      app: gerrit-operator
  template:
    metadata:
      labels:
        app: gerrit-operator
    spec:
      serviceAccountName: gerrit-operator
      containers:
      - name: operator
        image: k8sgerrit/gerrit-operator
        imagePullPolicy: Always
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: INGRESS
          value: none
        ports:
        - containerPort: 80
        readinessProbe:
          httpGet:
            path: /health
            port: 8080
            scheme: HTTPS
          initialDelaySeconds: 1
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
            scheme: HTTPS
          initialDelaySeconds: 30
      ## Only required, if an external/persistent keystore is being used.
      #   volumeMounts:
      #   - name: ssl
      #     readOnly: true
      #     mountPath: /operator
      # volumes:
      # - name: ssl
      #   secret:
      #     secretName: gerrit-operator-ssl
