---
# Source: mayastor-control-plane/templates/msp-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: msp-operator
  namespace: mayastor
  labels:
    app: msp-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      app: msp-operator
  template:
    metadata:
      labels:
        app: msp-operator
    spec:
      serviceAccount: mayastor-service-account
      imagePullSecrets:
        - name: regcred
      initContainers:
        - command:
          - sh
          - -c
          - trap "exit 1" TERM; until nc -vz nats 4222; do echo "Waiting for nats..."; sleep
            1; done;
          image: busybox:latest
          name: nats-probe
        - command:
          - sh
          - -c
          - trap "exit 1" TERM; until nc -vz mayastor-etcd 2379; do echo "Waiting for etcd...";
            sleep 1; done;
          image: busybox:latest
          name: etcd-probe
      containers:
        - name: msp-operator
          resources:
            limits:
              cpu: 100m
              memory: 32Mi
            requests:
              cpu: 50m
              memory: 16Mi
          image: mayadata/mcp-msp-operator:e2e-nightly
          imagePullPolicy: Always
          args:
            - "-e http://rest:8081"
            - "--interval=30s"
          env:
            - name: RUST_LOG
              value: info,msp_operator=info
            - name: MY_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
