apiVersion: batch/v1
kind: Job
metadata:
  generateName: solr-sync-
  labels:
    stack: esgf-solr-cloud
    component: sync
  
spec:
  backoffLimit: 2
  template:
    spec:
    
      restartPolicy: Never
            
      # this container runs the script
      # to sync records between a source Solr and a target Solr
      containers:
        - name: solr-sync
          image: esgfhublc/esgfpy-publish
          command:
            - /usr/local/esgfpy-publish/scripts/solr_sync.sh 
            - "$(SOLR_SOURCE_URL)"
            - "$(SOLR_TARGET_URL)"
          env:
            - name: SOLR_SOURCE_URL
              # important: must use 'https'
              value: https://esgf-node.jpl.nasa.gov/solr
            - name: SOLR_TARGET_URL
              value: http://solr-load-balancer:8983/solr