kubectl logs <pod-name>
There could be multiple pods related to a single deployment. For example,there are 3 pods for API because you want to have 3 instances of API.
Use the folowing command to begin streaming the logs of the pods defined by label app=core-api
kubectl logs -f -l app=core-api
-f, --follow=false:
Specify if the logs should be streamed.
-l, --selector='':
Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching
objects must satisfy all of the specified label constraints.
You can specify other options as well such as:
--all-containers=false:
Get all containers' logs in the pod(s).
--since=0s:
Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of
since-time / since may be used
For more options, execute the following command
kubectl logs -h