1

We are trying to analyze specific requirement for container implementation and would like to know the limit of maximum number of labels that can be created for the given pods in kubernetes? Does such limit exists or it is not defined.

Thanks in advance.

Chota Bheem
  • 1,106
  • 1
  • 13
  • 31
  • 2
    I don't think there is a limit, but keep in mind that all this data is being retrieved by an api. There is however a limit on the length of a label, it's 63 characters. – Leroy May 28 '21 at 11:50

1 Answers1

3

Based on official Kubernetes documentation there should be no limit of independent labels in pod. But you should know, that each valid label:

  • must be 63 characters or less (can be empty),
  • unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]),
  • could contain dashes (-), underscores (_), dots (.), and alphanumerics between.

If you want to know where the 63-character limit comes from, I recommend this thread, RFC-1223 and explanation.

And Leroy well mentioned in the comment:

keep in mind that all this data is being retrieved by an api.

Mikołaj Głodziak
  • 4,775
  • 7
  • 28