apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.21.0 (992df58d8)
  creationTimestamp: null
  labels:
    io.kompose.service: worker-service
  name: worker-service
spec:
  replicas: {{ .Values.services.worker.replicaCount }}

  selector:
    matchLabels:
      io.kompose.service: worker-service
  strategy:
    type: RollingUpdate
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.21.0 (992df58d8)
      creationTimestamp: null
      labels:
        io.kompose.service: worker-service
    spec:
      containers:
      - env:
        - name: CLUSTER_PORT
          value: {{ .Values.services.worker.port | quote }}
        - name: COUCH_DB_USER
          valueFrom:
            secretKeyRef:
              name: {{ template "couchdb.fullname" . }}
              key: adminUsername
        - name: COUCH_DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: {{ template "couchdb.fullname" . }}
              key: adminPassword
        - name: COUCH_DB_URL
          {{ if .Values.services.couchdb.url }}
          value: {{ .Values.services.couchdb.url }}
          {{ else }}
          value: http://{{ .Release.Name }}-svc-couchdb:{{ .Values.services.couchdb.port }}
          {{ end }}
        - name: INTERNAL_API_KEY
          valueFrom:
            secretKeyRef:
              name: {{ template "budibase.fullname" . }}
              key: internalApiKey
        - name: JWT_SECRET
          valueFrom:
            secretKeyRef:
              name: {{ template "budibase.fullname" . }}
              key: jwtSecret
        {{ if .Values.services.objectStore.region }}
        - name: AWS_REGION
          value: {{ .Values.services.objectStore.region }}
        {{ end }}
        - name: MINIO_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: {{ template "budibase.fullname" . }}
              key: objectStoreAccess
        - name: MINIO_SECRET_KEY
          valueFrom:
            secretKeyRef:
              name: {{ template "budibase.fullname" . }}
              key: objectStoreSecret
        - name: MINIO_URL
          value: {{ .Values.services.objectStore.url }}
        - name: PORT
          value: {{ .Values.services.worker.port | quote }}
        - name: MULTI_TENANCY
          value: {{ .Values.globals.multiTenancy | quote }}
        - name: LOG_LEVEL
          value: {{ default "info" .Values.services.worker.logLevel | quote }}
        - name: REDIS_PASSWORD
          value: {{ .Values.services.redis.password | quote }}
        - name: REDIS_URL
          {{ if .Values.services.redis.url }}
          value: {{ .Values.services.redis.url }}
          {{ else }}
          value: redis-service:{{ .Values.services.redis.port }}
          {{ end }}
        - name: SELF_HOSTED
          value: {{ .Values.globals.selfHosted | quote }}
        - name: SENTRY_DSN
          value: {{ .Values.globals.sentryDSN }}
        - name: ACCOUNT_PORTAL_URL
          value: {{ .Values.globals.accountPortalUrl | quote }}
        - name: ACCOUNT_PORTAL_API_KEY
          value: {{ .Values.globals.accountPortalApiKey | quote }}
        - name: PLATFORM_URL
          value: {{ .Values.globals.platformUrl | quote }}
        - name: COOKIE_DOMAIN
          value: {{ .Values.globals.cookieDomain | quote }}
        - name: SMTP_FALLBACK_ENABLED
          value: {{ .Values.globals.smtp.enabled | quote }}
        - name: SMTP_USER
          value: {{ .Values.globals.smtp.user | quote }}
        - name: SMTP_PASSWORD
          value: {{ .Values.globals.smtp.password | quote }}
        - name: SMTP_HOST
          value: {{ .Values.globals.smtp.host | quote }}
        - name: SMTP_PORT
          value: {{ .Values.globals.smtp.port | quote }}
        - name: SMTP_FROM_ADDRESS
          value: {{ .Values.globals.smtp.from | quote }}
        - name: APPS_URL
          value: http://app-service:{{ .Values.services.apps.port }}
        - name: GOOGLE_CLIENT_ID
          value: {{ .Values.globals.google.clientId | quote }}
        - name: GOOGLE_CLIENT_SECRET
          value: {{ .Values.globals.google.secret | quote }}
        image: budibase/worker:{{ .Values.globals.appVersion }}
        imagePullPolicy: Always
        name: bbworker
        ports:
        - containerPort: {{ .Values.services.worker.port }}
        resources: {}
      restartPolicy: Always
      serviceAccountName: ""
status: {}
