apiVersion: apps/v1
kind: Deployment
metadata:
  name: billing
  labels:
    app: billing
spec:
  replicas: 1
  selector:
    matchLabels:
      app: billing
  template:
    metadata:
      labels:
        app: billing
      annotations:
        linkerd.io/inject: enabled
        config.linkerd.io/proxy-cpu-request: 1m
        config.linkerd.io/proxy-memory-request: 4Mi
        config.linkerd.io/skip-outbound-ports: "4222"
    spec:
      imagePullSecrets:
        - name: ghcr
      containers:
        - name: billing
          image: busybox
          command:
            - /app/servicebin
          livenessProbe:
            exec:
              command:
                - /app/grpc_health_probe
                - -addr=:8080
          readinessProbe:
            exec:
              command:
                - /app/grpc_health_probe
                - -addr=:8080
          ports:
            - containerPort: 8080
              name: grpc
              protocol: TCP
          resources:
            requests:
              cpu: 4m
              memory: 15Mi
            limits:
              cpu: "1"
              memory: 1Gi
          env:
            - name: GRPC_PORT
              valueFrom:
                configMapKeyRef:
                  key: port
                  name: grpc
            - name: MONGODB_URL
              valueFrom:
                configMapKeyRef:
                  key: url
                  name: mongodb
            - name: STAN_CLUSTERID
              valueFrom:
                configMapKeyRef:
                  key: clusterid
                  name: stan
            - name: NATS_URL
              valueFrom:
                configMapKeyRef:
                  key: url
                  name: nats
            - name: ROBOKASSA_WEBHOOKSECRET
              valueFrom:
                secretKeyRef:
                  key: webhooksecret
                  name: robokassa
            - name: ROBOKASSA_MERCHANTLOGIN
              valueFrom:
                configMapKeyRef:
                  key: merchantlogin
                  name: robokassa
            - name: ROBOKASSA_PASSWORDONE
              valueFrom:
                secretKeyRef:
                  key: passwordone
                  name: robokassa
            - name: ROBOKASSA_PASSWORDTWO
              valueFrom:
                secretKeyRef:
                  key: passwordtwo
                  name: robokassa
            - name: SERVICE_PARSER
              valueFrom:
                configMapKeyRef:
                  key: parser
                  name: service
            - name: SERVICE_USER
              valueFrom:
                configMapKeyRef:
                  key: user
                  name: service
            - name: LOGLEVEL
              value: error
