apiVersion: apps/v1
kind: Deployment
metadata:
  name: admin-bot
  labels:
    app: admin-bot
spec:
  replicas: 1
  selector:
    matchLabels:
      app: admin-bot
  template:
    metadata:
      labels:
        app: admin-bot
      annotations:
        linkerd.io/inject: enabled
        config.linkerd.io/skip-outbound-ports: "80,443,4222"
        config.linkerd.io/proxy-cpu-request: 1m
        config.linkerd.io/proxy-memory-request: 4Mi
    spec:
      imagePullSecrets:
        - name: ghcr
      containers:
        - name: admin-bot
          image: busybox
          command:
            - /app/servicebin
          livenessProbe:
            httpGet:
              path: /healthz
              port: 81
          readinessProbe:
            httpGet:
              path: /healthz
              port: 81
          ports:
            - containerPort: 80
              name: http
              protocol: TCP
          resources:
            requests:
              cpu: 1m
              memory: 11Mi
            limits:
              cpu: "1"
              memory: 1Gi
          env:
            - name: HTTP_PORT
              valueFrom:
                configMapKeyRef:
                  key: port
                  name: http
            - name: STAN_CLUSTERID
              valueFrom:
                configMapKeyRef:
                  key: clusterid
                  name: stan
            - name: NATS_URL
              valueFrom:
                configMapKeyRef:
                  key: url
                  name: nats
            - name: STAN_SUBJECTREVIEWMODERATION
              valueFrom:
                configMapKeyRef:
                  key: subjectreviewmoderation
                  name: stan
            - name: TELEGRAM_ADMINBOTWEBHOOKURL
              valueFrom:
                configMapKeyRef:
                  key: adminbotwebhookurl
                  name: telegram
            - name: TELEGRAM_ADMINBOTTOKEN
              valueFrom:
                secretKeyRef:
                  key: adminbottoken
                  name: telegram
            - name: TELEGRAM_ADMINUSERID
              valueFrom:
                secretKeyRef:
                  key: adminuserid
                  name: telegram
            - name: SERVICE_PARSER
              valueFrom:
                configMapKeyRef:
                  key: parser
                  name: service
            - name: LOGLEVEL
              value: error
