apiVersion: apps/v1
kind: Deployment
metadata:
  name: cronjobs-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cronjobs
  template:
    metadata:
      labels:
        app: cronjobs
    spec:
      containers:
        - name: cronjobs
          image: adwera/ts-tasks-cronjobs 
          env:
            - name: NATS_CLUSTER_ID
              value: 'tasks'
            - name: NATS_CLIENT_ID
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: NATS_URI
              value: 'http://nats-service:4222'
            - name: MONGO_URI
              value: 'mongodb://cron-mongo-service:27017/cronjobs'
            - name: JWT_KEY
              valueFrom:
                secretKeyRef:
                  name: jwt-secret
                  key: JWT_KEY 
