---
# Source: mayastor-control-plane/templates/core-agents-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: core-agents
  namespace: mayastor
  labels:
    app: core-agents
spec:
  replicas: 1
  selector:
    matchLabels:
      app: core-agents
  template:
    metadata:
      labels:
        app: core-agents
    spec:
      imagePullSecrets:
        - name: regcred
      initContainers:
        - 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: core
          resources:
            limits:
              cpu: 1000m
              memory: 32Mi
            requests:
              cpu: 500m
              memory: 16Mi
          image: mayadata/mayastor-core:develop
          imagePullPolicy: Always
          args:
            - "-smayastor-etcd"
            - "--request-timeout=5s"
            - "--cache-period=30s"
            - "--grpc-server-addr=https://0.0.0.0:50051"
          ports:
            - containerPort: 50051
          env:
            - name: RUST_LOG
              value: info
            - name: MY_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: MY_POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
