Click the Workloads tab on
the left side of the Kubernetes Engine page, and click
the Activate Cloud Shell on the top.
Create the Secret with the name regcred
by executing the following command.
kubectl create secret docker-registry regcred --docker-server=<docker-registry-server> --docker-username=<dockerId> --docker-password=<docker-password> --docker-email=<your-email>Kubernetes cluster uses the Secret feature of docker-registry type to authenticate and pull a private image. This Secret can be created in the Cloud Shell. For more information about Secret, see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/.
Create a config.yml file
on your local workstation with the following details. Make sure you do not
change the alignment for the parameters.
apiVersion: batch/v1beta1 kind: CronJob metadata: name: talend-standard-job spec: schedule: "*/3 * * * *" jobTemplate: spec: template: spec: containers: - name: kubernetes-job image: dockerId/standard_job:latest restartPolicy: Never imagePullSecrets: - name: regcred backoffLimit: 4The schedule parameter defines when and how often a Job runs in crontab. It follows Unix standards and all the CronJob times are in UTC. There are 5 fields in the schedule parameter. To know how to set up a schedule for the CronJob, see https://cloud.google.com/kubernetes-engine/docs/how-to/cronjobs.
Click the Settings
button for the shell window as shown below and click Upload file to choose and upload the created config.yml file.
After uploading the file, run the following command in the
kubectl create -f config.ymlThis creates a Cron Job named talend-standard-job like below.
Once the Cron Job is created, click it to see the following
This Job is scheduled to run every 3 minutes.To see the Job execution logs, click the Container logs on the Cron Job details page.To delete the Cron Job, click it and on the Cron Job details page, click . This will open a Cloud Shell with a command in it. Press Enter to delete the Job.