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

Ensure that long CNI labels are short enough #351

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wavesoft
Copy link

@wavesoft wavesoft commented Mar 6, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants