---
# Source: mayastor-control-plane/templates/rest-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rest
  namespace: mayastor
  labels:
    app: rest
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rest
  template:
    metadata:
      labels:
        app: rest
    spec:
      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: rest
          resources:
            limits:
              cpu: 100m
              memory: 64Mi
            requests:
              cpu: 50m
              memory: 32Mi
          image: mayadata/mcp-rest:e2e-nightly
          imagePullPolicy: Always
          args:
            - "--dummy-certificates"
            - "--no-auth"
            - "-nnats"
            - "--http=0.0.0.0:8081"
            - "--request-timeout=5s"
          ports:
            - containerPort: 8080
            - containerPort: 8081
          env:
            - name: RUST_LOG
              value: info
