Get the logs for a specific container

Report a typo

Assume that a pod is deployed on a Kubernetes cluster with the following pod definition file:

apiVersion: v1
kind: Pod
metadata:
  name: busyboxes
spec:
  containers:
  - name: busybox1
    image: busybox
    command: ['sh', '-c', 'echo "HelloWorld from busybox1" && sleep 30']
  - name: busybox2
    image: busybox
    command: ['sh', '-c', 'echo "HelloWorld from busybox2" && sleep 10']

Write a command to get the last 10 logs from the container busybox2.

Please write your solution such that there is only one space between words in the command.

Enter a short text

Create a free account to access the full topic