---
# Source: alameda/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: alameda-operator
  namespace: alameda
  labels:
    app: alameda
    component: alameda-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      app: alameda
      component: alameda-operator
  template:
    metadata:
      labels:
        app: alameda
        component: alameda-operator
    spec:
      containers:
        - name: alameda
          image: "operator:latest"
          imagePullPolicy: IfNotPresent
          env:
            - name: NAMESPACE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace   
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name 
            - name: ALAMEDA_OPERATOR_DATAHUB_ADDRESS
              value: "alameda-datahub.alameda:50050"
          resources:
            {}
            
          volumeMounts:
          - name: podinfo
            mountPath: /etc/podinfo
            readOnly: false
          readinessProbe:
            exec:
              command:
              - /usr/local/bin/manager
              - --readiness-probe
            initialDelaySeconds: 5
            failureThreshold: 20
            periodSeconds: 5
          livenessProbe:
            exec:
              command:
              - /usr/local/bin/manager
              - --liveness-probe
            initialDelaySeconds: 5
            failureThreshold: 20
            periodSeconds: 5
      volumes:
      - name: podinfo
        downwardAPI:
          items:
          - path: "labels"
            fieldRef:
              fieldPath: metadata.labels
      serviceAccountName: alameda-operator
