apiVersion: apps/v1
kind: Deployment
metadata:
  name: openim-msgtransfer-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: openim-msgtransfer-server
  template:
    metadata:
      labels:
        app: openim-msgtransfer-server
    spec:
      imagePullSecrets:
        - name: dockerhub-secret
      containers:
        - name: openim-msgtransfer-container
          image: mag1666888/openim-msgtransfer:prod
          imagePullPolicy: Always
          env:
            - name: CONFIG_PATH
              value: "/config"
            - name: IMENV_REDIS_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: openim-redis-secret
                  key: redis-password
            - name: IMENV_MONGODB_USERNAME
              valueFrom:
                secretKeyRef:
                  name: openim-mongo-secret
                  key: mongo_openim_username
            - name: IMENV_MONGODB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: openim-mongo-secret
                  key: mongo_openim_password
            - name: IMENV_KAFKA_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: openim-kafka-secret
                  key: kafka-password
          volumeMounts:
            - name: openim-config
              mountPath: "/config"
              readOnly: true
          ports:
            - containerPort: 12020
          resources:
            requests:
              cpu: "500m"
              memory: "512Mi"
            limits:
              cpu: "1000m"
              memory: "1Gi"
      volumes:
        - name: openim-config
          configMap:
            name: openim-config
