apiVersion: apps/v1
kind: Deployment
metadata:
  name: rating-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: rating-operator
  template:
    metadata:
      labels:
        name: rating-operator
    spec:
      imagePullSecrets:
        - name: rating-regcred
      serviceAccountName: rating-operator
      containers:
        - name: rating-operator
          resources: {}
          image: alterwayrnd/rating-operator:latest
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            # Every variable that exist here AND in watches.yaml can be overrided at runtime
            - name: OPERATOR_NAME
              value: "rating-operator"
            - name: PULLSECRETS_API
              value: rating-regcred
            - name: PULLSECRETS_MANAGER
              value: rating-regcred
            - name: PULLSECRETS_FRONTEND
              value: rating-regcred-front
            - name: POSTGRESQL_PASSWORD
              value: notasecret
            - name: RATING_ADMIN_API_KEY
              value: thisisadmintoken
            - name: GRAFANA
              value: "true"
            - name: GRAFANA_BACKEND_URL
              value: "prometheus-grafana.rating.svc.cluster.local"
            - name: FRONTEND_URL
              value: "localhost:3000"
            - name: ALLOW_ORIGIN
              value: "http://localhost:8080"
            - name: CLUSTER_AUTH
              value: "false"