apiVersion: alloydbomni.dbadmin.goog/v1
kind: Sidecar
metadata:
  name: cv-sidecar-config
  namespace: db
spec:
  additionalVolumes:
  - name: commcell-secret
    secret:
      secretName: commcell-secret
  - configMap:
      name: cvconfigmap
    name: commvault-env-store2
  sidecars:
  - envFrom:
    - configMapRef:
        name: cvconfigmap
    image: commvault/postgresql:11.32.59
    resources:
      limits:
        cpu: "1"
        memory: 1Gi
      requests:
        cpu: "1"
        memory: 1Gi
    lifecycle:
      preStop:
        exec:
          command:
          - /bin/sh
          - -c
          - cp /opt/commvault/Base/FwConfig* /etc/CommVaultRegistry/Galaxy/FwConfig/
    name: commvault-pgsqlagent
    ports:
    - containerPort: 8400
      name: cvdport
      protocol: TCP
    securityContext:
      runAsUser: 0
    volumeMounts:
    - mountPath: /archive/
      name: logdisk
    - mountPath: /tmp
      name: tmp-socket
    - mountPath: /opt/cvdocker_env
      name: commvault-env-store2
      readOnly: true
    - mountPath: /etc/CommVaultRegistry
      name: backupdisk
      subPath: Registry
    - mountPath: /var/log/commvault/Log_Files
      name: backupdisk
      subPath: Log_Files
    - mountPath: /opt/commvault/MediaAgent/IndexCache
      name: backupdisk
      subPath: IndexCache
    - mountPath: /opt/commvault/iDataAgent/jobResults
      name: backupdisk
      subPath: jobResults
    - mountPath: /opt/commvault/appdata
      name: backupdisk
      subPath: certificates
    - mountPath: /mnt/disks/pgsql
      name: datadisk
    - mountPath: /opt/commcell_secret
      name: commcell-secret