Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubelet pod names break log directory path #80042

rphillips opened this issue Jul 11, 2019 · 2 comments


None yet
3 participants
Copy link

commented Jul 11, 2019

What happened:
Kubelet log directories are joined with a flat NAMESPACE_PODNAME_UID directory path. The limit on pod names are 253 characters #78188 (comment).

func BuildPodLogsDirectory(podNamespace, podName string, podUID types.UID) string {
	return filepath.Join(podLogsRootDirectory, strings.Join([]string{podNamespace, podName,
		string(podUID)}, logPathDelimiter))

Joining a long pod name with the namespace and UID will be over 255 characters causing the directory creation and file open to fail. Most modern filesystems have a limit of 255 characters for file directory names and filenames.

The pod with a long pod name will silently fail to log.

ref: #74441

What you expected to happen:
Long pod names should not impact the ability to log.

How to reproduce it (as minimally and precisely as possible):
Test Case

Anything else we need to know?:

Kubernetes 1.14.0 and later


This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2019

@k8s-ci-robot k8s-ci-robot added sig/node and removed needs-sig labels Jul 11, 2019


This comment has been minimized.

Copy link

commented Jul 11, 2019

Hrm, I thought we had an auto "hashify" the extended part of the string when it exceeded length, but maybe I'm wrong. That might have been the very, very, very, very old implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.