<p>Can someone give me some guidance on best practice to bring multiple Talend jobs dynamically into Kubernetes?</p>

<ol>
<li>I am using Talend Open Studio for Big Data</li>
<li>I have a listener server for Job2Docker</li>
<li>How do I change the scripts to automate a push to Docker Hub?</li>
<li>Is it possible to have a dynamic CronJob K8s type that can run jobs based on a configuration file.</li>
</ol>

Anton Swanevelder
<p>I ended up not using Job2Docker in favour of a simple docker process.</p>

<ol>
<li>Build the Talend Standalone job.</li>
<li>Unzip the build into a folder called jobs.</li>
<li>Use the below Dockerfile example to build and push your docker image.</li>
</ol>

<p>Dockerfile</p>

<pre><code>FROM java
WORKDIR /talend
COPY ./jobs /talend
</code></pre>

<p>Create a CronJob type for K8s</p>

<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: etl-edw-cronjob
spec:
  schedule: "0 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: Never
          containers:
            - name: etl-edw-job
              image: dockerhubrepo/your-etl
              command: ["sh",  "./process_data_warehouse_0.1/process_data_warehouse/process_data_warehouse_run.sh"]
              env:
                - name: PGHOST
                  value: postgres-cluster-ip-service
                - name: PGPORT
                  value: "5432"
                - name: PGDATABASE
                  value: infohub
                - name: PGUSER
                  value: postgres
                - name: PGPASSWORD
                  valueFrom:
                    secretKeyRef:
                      name: pgpassword
                      key: PGPASSWORD
                - name: MONGOSERVER
                  value: mongo-service
                - name: MONGOPORT
                  value: "27017"
                - name: MONGODB
                  value: hearth
</code></pre>
