Skip to content

FindPidByPodContainer unreliable #174

Closed
@michaelgugino

Description

@michaelgugino

needle := path.Join(podUID, containerID)

This code makes too many assumptions about what the file paths will look like.

Actual mount results on my cluster look like /kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod30cea2cf_1b80_4807_abad_d81453e199c5.slice/crio-a8077b08a56c0c6e33d6716557d882ac940cb09475c50372e22e84c40d0733f2.scope

Additionally, the following agruments get passed to the job container
--pod-uid=30cea2cf-1b80-4807-abad-d81453e199c5 --container-id=cri-o://a8077b08a56c0c6e33d6716557d882ac940cb09475c50372e22e84c40d0733f2

We need to also trim the cri-o:// prefix. The pod UID seems to replace - with _ so that is another issue.

This project works for me: https://github.com/yahoo/kubectl-flame/blob/master/agent/utils/process.go#L35

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions