About "Kubernetes Sidecar Containers" Task

Hello KK/KKE staff,

I did the “Kubernetes Sidecar Containers” task and I failed the tasked with the following message, something like, “mount path is not /var/log/nginx/”. Notice that the is a “/” at the end of the path.

However, in the Task Details, we are asked to mount at location “/var/log/nginx”. Without “/” at the end of path.

Below are 2 manifests file I used for the task, first manifest file with mount path “/var/log/nginx”, which I failed the task… Second identical manifest file, different only with mount path as “/var/log/nginx/” in nginx-container container, which i passed the task.

Appreciate if you can look into into this Task validation?

First manifest file

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: webserver
  name: webserver
spec:
  containers:
  - image: nginx:latest
    name: nginx-container
    ports:
    - containerPort: 80
    volumeMounts:
    - mountPath: /var/log/nginx
      name: shared-logs
    resources: {}
  - command: ["sh", "-c", "while true; do cat /var/log/nginx/access.log /var/log/nginx/error.log; sleep 30; done"]
    image: ubuntu:latest
    name: sidecar-container
    volumeMounts:
    - mountPath: /var/log/nginx
      name: shared-logs
    resources: {}
  volumes:
  - name: shared-logs
    emptyDir: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always
status: {}

Second manifest file:

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: webserver
  name: webserver
spec:
  containers:
  - image: nginx:latest
    name: nginx-container
    ports:
    - containerPort: 80
    volumeMounts:
    - mountPath: /var/log/nginx/
      name: shared-logs
    resources: {}
  - command: ["sh", "-c", "while true; do cat /var/log/nginx/access.log /var/log/nginx/error.log; sleep 30; done"]
    image: ubuntu:latest
    name: sidecar-container
    volumeMounts:
    - mountPath: /var/log/nginx
      name: shared-logs
    resources: {}
  volumes:
  - name: shared-logs
    emptyDir: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always
status: {}

Hi @tsanghan

Can you please give us the statement of the task

Regard

Hi @tsanghan,
Thanks for sharing the details. I will check and update you.

Regards,