@@ -113,7 +113,7 @@ A Job creates one or more Pods and ensures that a specified number of them succe
...
@@ -113,7 +113,7 @@ A Job creates one or more Pods and ensures that a specified number of them succe
In our project, we found this useful for testing our controllers database connection. Rather than having a fully functional controller application, we built a test program that connected to our cluster, performed a simple selection and printed results. The test program was best suited as a job because we did not want the pod trying to select and print continuously, we just needed it to run once.
In our project, we found this useful for testing our controllers database connection. Rather than having a fully functional controller application, we built a test program that connected to our cluster, performed a simple selection and printed results. The test program was best suited as a job because we did not want the pod trying to select and print continuously, we just needed it to run once.
Below is the YAML file, which we use to create a Job. As in the deployment we use the image from the GitLab pipeline and we have declared the Kubernetes secret. The main difference from a deployment is the `restartpolicy` being set to Never and a `backofflimit` is set to 0 to ensure the job runs once. We declare a command to execute a run of the program in *command: ["dotnet", "postgrestest.dll"]* so the program is triggered open creation like hitting the run button in IDE.
Below is the YAML file, which we use to create a Job. As in the deployment we use the image from the GitLab pipeline and we have declared the Kubernetes secret. The main difference from a deployment is the `restartPolicy` being set to Never and a `backofflimit` is set to 0 to ensure the job runs once. We declare a command to execute a run of the program in *command: ["dotnet", "postgrestest.dll"]* so the program is triggered open creation like hitting the run button in IDE.
```
```
...
@@ -148,7 +148,7 @@ This returns all deployments however if we are just concerned with one deploymen
...
@@ -148,7 +148,7 @@ This returns all deployments however if we are just concerned with one deploymen
```
```
kubectl get job kubemoviejob
kubectl get job kubemoviejob
```
```
If we wanted to get more information on the jobs then we can use kubectl logs
If we wanted to get more information on the jobs then we can use `kubectl logs`