mesos icon indicating copy to clipboard operation
mesos copied to clipboard

Ensure that long CNI labels are short enough

Open wavesoft opened this issue 5 years ago • 0 comments

Apparently this is an implicit limitation on the maximum length of network labels, enforced by the k8s apimachinery library that various CNI plugins use for their API abstraction.

The maximum allowed length is 63 characters. Therefore, in order for us to be able to maximize the amount of information preserved, I am proposing the following solution for long labels:

MD5(<label>)[0:7] + "~" + <label>[sizeof(<label>)-53:]

For example:

/teams/backend-services/database-service/deployments/development/tag-1.12-dev

Becomes:

df1d656~database-service/deployments/development/tag-1.12-dev

wavesoft avatar Mar 06 '20 13:03 wavesoft