mesos
mesos copied to clipboard
Ensure that long CNI labels are short enough
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