apiVersion: batch/v1
kind: Job
metadata:
  name: crawler
spec:
  template:
    spec:
      restartPolicy: OnFailure
      containers:
      - name: crawler
        image: gcr.io/haiyanmeng-gke-dev/crawler:v1
        imagePullPolicy: Always
        command: ["/crawler"]
        args: ["--mode=github-repo", "--github-repo=kubernetes-sigs/kustomize", "--index=kustomize"]
        env:
        - name: GITHUB_ACCESS_TOKEN
          valueFrom:
            secretKeyRef:
              name: github-access-token
              key: token
        - name: ELASTICSEARCH_URL
          valueFrom:
            configMapKeyRef:
              name: elasticsearch-config
              key: es-url
        - name: REDIS_CACHE_URL
          valueFrom:
            configMapKeyRef:
              name: crawler-http-cache
              key: redis-cache-url
        - name: REDIS_KEY_URL
          valueFrom:
            configMapKeyRef:
              name: redis-keystore
              key: keystore-url
