apiVersion: apps/v1
kind: Deployment
metadata:
  name: linkmicroservice-deployment
  labels:
    app: linkmicroservice
spec:
  replicas: 1
  selector:
    matchLabels:
      app: linkmicroservice
  template:
    metadata:
      labels:
        app: linkmicroservice
    spec:
      initContainers:
        - name: "linkmicroservice-dbmigration-init"
          image: "groundnuty/k8s-wait-for:1.3"
          args:
            - "job"
            - "linkmicroservice-dbmigration-job-release-1.0.0"
      containers:
        - name: linkmicroservice
          image: mrtech12/linkmicroservice:release-1.0.0
          ports:
            - containerPort: 7000
          env:
            - name: "ConnectionStrings_LinkContext"
              valueFrom:
                secretKeyRef:
                  name: linkmicroservice-dbconnectionstring
                  key: linkcontext
                  optional: false
            - name: "RabbitMQ_HostName"
              value: "rabbitmq-service"
            - name: "RabbitMQ_Port"
              value: "5672"
          resources:
            requests:
              memory: "128Mi"
              cpu: "128m"
            limits:
              memory: "512Mi"
              cpu: "256m"
