**I’ve got this error, but I can’t identify where is the cause. Could someone help pls. **
Here is the yaml file:
apiVersion: v1
kind: Pod
metadata:
name: webserver
spec:
volumes:
- name: shared-logs
emptyDir: {}
containers:
-
name: nginx-container
image: nginx:latest
volumeMounts:- mountPath: /var/log/nginx
name: shared-logs
- mountPath: /var/log/nginx
-
name: sidecar-container
image: ubuntu:latest
command:- “sh”
- “-c”
- “while true; do cat /var/log/nginx/access.log /var/log/nginx/error.log; sleep 30; done”
volumeMounts: - mountPath: /var/log/nginx
name: shared-logs
Both containers are created and running:
thor@jump-host ~$ k describe pod webserver
Name: webserver
Namespace: default
Priority: 0
Service Account: default
Node: jump-host/10.244.29.247
Start Time: Mon, 04 May 2026 01:28:48 +0000
Labels:
Annotations:
Status: Running
IP: 10.22.0.9
IPs:
IP: 10.22.0.9
Containers:
nginx-container:
Container ID: containerd://5d5472312d25bcabb8b437a3da1040bd3fffa3bc0682368fac0b104aeeddbf25
Image: nginx:latest
Image ID: Docker Hub Container Image Library | App Containerization
Port:
Host Port:
State: Running
Started: Mon, 04 May 2026 01:28:52 +0000
Ready: True
Restart Count: 0
Environment:
Mounts:
/var/log/nginx from shared-logs (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-265nl (ro)
sidecar-container:
Container ID: containerd://b5c367bb1c6fbf48f7bfe66ee5daf89f9cd0ef5c99cd3dd5461813a8d26e3a1f
Image: ubuntu:latest
Image ID: Docker Hub Container Image Library | App Containerization
Port:
Host Port:
Command:
sh
-c
while true; do cat /var/log/nginx/access.log /var/log/nginx/error.log; sleep 30; done
State: Running
Started: Mon, 04 May 2026 01:28:54 +0000
Ready: True
Restart Count: 0
Environment:
Mounts:
/var/log/nginx from shared-logs (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-265nl (ro)
Conditions:
Type Status
PodReadyToStartContainers True
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
shared-logs:
Type: EmptyDir (a temporary directory that shares a pod’s lifetime)
Medium:
SizeLimit:
kube-api-access-265nl:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
Optional: false
DownwardAPI: true
QoS Class: BestEffort
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
Normal Scheduled 33s default-scheduler Successfully assigned default/webserver to jump-host
Normal Pulling 32s kubelet Pulling image “nginx:latest”
Normal Pulled 29s kubelet Successfully pulled image “nginx:latest” in 3.357s (3.357s including waiting). Image size: 62964342 bytes.
Normal Created 29s kubelet Created container: nginx-container
Normal Started 29s kubelet Started container nginx-container
Normal Pulling 29s kubelet Pulling image “ubuntu:latest”
Normal Pulled 27s kubelet Successfully pulled image “ubuntu:latest” in 1.49s (1.49s including waiting). Image size: 29742141 bytes.
Normal Created 27s kubelet Created container: sidecar-container
Normal Started 27s kubelet Started container sidecar-container
Inspect logs on both containers ok:
thor@jump-host ~$ k logs webserver -c sidecar-container
2026/05/04 01:28:52 [notice] 1#1: using the “epoll” event method
2026/05/04 01:28:52 [notice] 1#1: nginx/1.29.8
2026/05/04 01:28:52 [notice] 1#1: built by gcc 14.2.0 (Debian 14.2.0-19)
2026/05/04 01:28:52 [notice] 1#1: OS: Linux 6.8.0-94-generic
2026/05/04 01:28:52 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2026/05/04 01:28:52 [notice] 1#1: start worker processes
2026/05/04 01:28:52 [notice] 1#1: start worker process 77
2026/05/04 01:28:52 [notice] 1#1: start worker process 78
2026/05/04 01:28:52 [notice] 1#1: start worker process 79
2026/05/04 01:28:52 [notice] 1#1: start worker process 80
2026/05/04 01:28:52 [notice] 1#1: start worker process 81
2026/05/04 01:28:52 [notice] 1#1: start worker process 82
2026/05/04 01:28:52 [notice] 1#1: start worker process 83
2026/05/04 01:28:52 [notice] 1#1: start worker process 84
2026/05/04 01:28:52 [notice] 1#1: start worker process 85
2026/05/04 01:28:52 [notice] 1#1: start worker process 86
2026/05/04 01:28:52 [notice] 1#1: start worker process 87
2026/05/04 01:28:52 [notice] 1#1: start worker process 88
thor@jump-host ~$ k logs webserver -c nginx-container
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
thor@jump-host ~$
But when I submit, it showed errors:
- ‘sidecar-container’ doesn’t exist
- Image used is not ‘ubuntu:latest’ for ‘sidecar-container’