Git Product home page Git Product logo

Comments (8)

ncugit-sec avatar ncugit-sec commented on May 24, 2024

/sig node

from kubernetes.

kannon92 avatar kannon92 commented on May 24, 2024

/triage needs-information

Can you please include a reproduction case?

Its not clear to me how one can test this.

It sounds like you are asking why are these logs not deleted? I would check the logs for kubelet log rotation and see if there are any failures.

from kubernetes.

kannon92 avatar kannon92 commented on May 24, 2024

/triage accepted

from kubernetes.

ncugit-sec avatar ncugit-sec commented on May 24, 2024

It sounds like you are asking why are these logs not deleted?

If the container isn't deleted by kubelet, it appears that the dangling link of the log to the deleted container isn't handled, causing the issue.
Here are the steps to reproduce

  1. Create a pod
$ cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: busybox-sleep
spec:
  containers:
  - name: busybox
    image: busybox:1.28
    args:
    - sleep
    - "1000000"
EOF
  1. Now we have container up, delete it manually
$ docker ps -a
CONTAINER ID   IMAGE                               COMMAND                  CREATED              STATUS                      PORTS     NAMES
7a35cb0df654   busybox                             "sleep 1000000"          About a minute ago   Up About a minute                     k8s_busybox_busybox-sleep_default_635d57dd-b5bd-421b-90e9-66750be5b260_0
$ docker rm -f 7a35cb0df654   
  1. Error log appears
cri_stats_provider.go:694] "Unable to fetch container log stats" err="failed to get fsstats for \"/var/log/pods/default_busybox-sleep_635d57dd-b5bd-421b-90e9-66750be5b260/busybox/0.log\": no such file or directory" containerName="busybox"

The container is gone, the log file no longer exists, and a new one is up, but the link persists.

$ ls -al /var/log/pods/default_busybox-sleep_635d57dd-b5bd-421b-90e9-66750be5b260/busybox/0.log
lrwxrwxrwx 1 root root 165 Feb 21 23:47 /var/log/pods/default_busybox-sleep_635d57dd-b5bd-421b-90e9-66750be5b260/busybox/0.log -> /var/lib/docker/containers/7a35cb0df6543424d26661f6a0dcacdd7a10c5ec1d55fe20d9be3582bc4ef7dd/7a35cb0df6543424d26661f6a0dcacdd7a10c5ec1d55fe20d9be3582bc4ef7dd-json.log
$ ls -al /var/lib/docker/containers/7a35cb0df6543424d26661f6a0dcacdd7a10c5ec1d55fe20d9be3582bc4ef7dd/7a35cb0df6543424d26661f6a0dcacdd7a10c5ec1d55fe20d9be3582bc4ef7dd-json.log
ls: cannot access '/var/lib/docker/containers/7a35cb0df6543424d26661f6a0dcacdd7a10c5ec1d55fe20d9be3582bc4ef7dd/7a35cb0df6543424d26661f6a0dcacdd7a10c5ec1d55fe20d9be3582bc4ef7dd-json.log': No such file or directory

from kubernetes.

kannon92 avatar kannon92 commented on May 24, 2024

Could you try reproducing it using containerd? maybe try kind and see if you see the same behavior.

from kubernetes.

kannon92 avatar kannon92 commented on May 24, 2024

cc @haircommander @mikebrow
tagging you all for cri-stats-provider.

from kubernetes.

kannon92 avatar kannon92 commented on May 24, 2024

TBH I don't really understand if this is supported.

Code is related to CRIStatsProvider.

from kubernetes.

haircommander avatar haircommander commented on May 24, 2024

yeah this sounds like a bug in cri-dockerd, as it's responsible for cleaning up that link AFAIU. If you cannot reproduce with cri-o or containerd, please open an issue in cri-dockerd repo

from kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.