We recommend using the kubectl
command for troubleshooting streams and tasks.
You can list all artifacts and resources used by using the following command:
kubectl get all,cm,secrets,pvc
You can list all resources used by a specific app or service by using a label to select resources. The following command list all resources used by the mysql
service:
kubectl get all -l app=mysql
You can get the logs for a specific pod by issuing:
kubectl logs pod <pod-name>
If the pod is continuously getting restarted you can add -p
as an option to see the previous log like:
kubectl logs -p <pod-name>
You can also tail or follow a log by adding an -f
option:
kubectl logs -f <pod-name>
A useful command to help in troubleshooting issues, such as a container that has a fatal error starting up, is to use the describe command like:
kubectl describe pod ticktock-log-0-qnk72
You can access the server logs by using the following command (just supply the name of pod for the server):
kubectl get pod -l app=scdf=server kubectl logs <scdf-server-pod-name>
The stream apps are deployed with the stream name followed by the name of the app and for processors and sinks there is also an instance index appended.
To see all the pods that are deployed by the Spring Cloud Data Flow server you can specify the label role=spring-app
:
kubectl get pod -l role=spring-app
To see details for a specific app deployment you can use (just supply the name of pod for the app):
kubectl describe pod <app-pod-name>
For the application logs use:
kubectl logs <app-pod-name>
If you would like to tail a log you can use:
kubectl logs -f <app-pod-name>
Tasks are launched as bare pods without a replication controller. The pods remain after the tasks complete and this gives you an opportunity to review the logs.
To see all pods for a specific task use this command while providing the task name:
kubectl get pod -l task-name=<task-name>
To review the task logs use:
kubectl logs <task-pod-name>
You have two options to delete completed pods. You can delete them manually once they are no longer needed.
To delete the task pod use:
kubectl delete pod <task-pod-name>
You can also use the Data Flow shell command task execution cleanup
command to remove the completed pod for a task execution.
First we need to determine the ID
for the task execution:
dataflow:>task execution list ╔═════════╤══╤════════════════════════════╤════════════════════════════╤═════════╗ ║Task Name│ID│ Start Time │ End Time │Exit Code║ ╠═════════╪══╪════════════════════════════╪════════════════════════════╪═════════╣ ║task1 │1 │Fri May 05 18:12:05 EDT 2017│Fri May 05 18:12:05 EDT 2017│0 ║ ╚═════════╧══╧════════════════════════════╧════════════════════════════╧═════════╝
Next we issue the command to cleanup the execution artifacts (the completed pod):
dataflow:>task execution cleanup --id 1 Request to clean up resources for task execution 1 has been submitted