Controlplane $ cat multi.yaml apiVersion: v1 kind: Pod metadata: name: multia . . .

snehal Naphad:
controlplane $ cat multi.yaml
apiVersion: v1
kind: Pod
metadata:
name: multia
spec:
containers:

  • name: nginx
    image: nginx
  • name: redis
    image: redis
    controlplane $ kubectl create -f multi.yaml
    pod/multia created
    controlplane $ kubectl logs multia -f
    error: a container name must be specified for pod multia, choose one of: [nginx redis]
    controlplane $

Deepak Ladwa:

apiVersion: v1
kind: Pod
metadata:
  name: mp
spec:
  containers:
  - name: nginx
    image: nginx
  - name: redis 
    image: redis

Deepak Ladwa:

root@controlplane:~# kubectl get pod mp
NAME   READY   STATUS    RESTARTS   AGE
mp     2/2     Running   0          8s

Deepak Ladwa:
can you share the pod definition file using code block option of the slack,

Deepak Ladwa:
also logs needs to be specified for the respective container

snehal Naphad:
thanks, got it resolved. Issue was with busybox container…replaced it with redis n worked it