0

Not able to figure out why I get an invalid label value error when deploying my spark job through kubernetes using spark-submit. The log error below it stating that it sees my class name appended with a dollar sign but I don't have anything that isn't alphanumeric in my class name.

io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: http://<...>/labelSelector=spark-app-selector%3Dcom.ibm.ai.admin.SparkPiAdmin$,spark-role%3Dexecutor. Message: unable to parse requirement: invalid label value: "com.admin.SparkPiAdmin$": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'). Received status: Status(apiVersion=v1, code=400, details=null, kind=Status, message=unable to parse requirement: invalid label value: "com.admin.SparkPi$": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'), metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=BadRequest, status=Failure, additionalProperties={}).
horatio1701d
  • 8,809
  • 14
  • 48
  • 77

1 Answers1

0

Because there is a $ sign in your label com.admin.SparkPi$. You need to get rid of it.

Probably your app is giving labels based on some name, variable, or any other parameter. May be in other context this is not a problem, but in kubernetes it is.

suren
  • 7,817
  • 1
  • 30
  • 51
  • But what is label referring to? I don't have a dollar sign symbol in my class name. That's what I don't get. Why kubernetes thinks it sees that symbol. – horatio1701d Apr 17 '19 at 01:06
  • Just came across this issue so thinking this is related. https://stackoverflow.com/questions/41570148/why-does-scala-place-a-dollar-sign-at-the-end-of-class-names/41571226 – horatio1701d Apr 17 '19 at 09:53
  • Exactly. I'm sure something similar is happening with this issue. – suren Apr 17 '19 at 10:19