spark executor pods creation failed

9/12/2018

Im running spark 2.3.1 on kubernetes 1.11.0

Im getting below error when spark driver pod is trying to bringup executor pods ,it truncates first 7 letters in the pod name and throws error that the name starts with "-"

io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://kubernetes.default.svc/api/v1/namespaces/mynamespace/pods. Message: Pod "mybrand-sb1-ca-privacy-abc469-38957af1c3393cae8941b0613376040c-exec-29" is invalid: spec.hostname: Invalid value: "-sb1-ca-privacy-abc469-38957af1c3393cae8941b0613376040c-exec-29": a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is 'a-z0-9?').

-- shiv455
apache-spark
kubernetes

1 Answer

9/19/2018

the max size of the name is 63 characters. Thats the reason its getting truncated for the first 9 characters. Try to minimize the app name, this will solve the issue.

-- suryanarayana garlapati
Source: StackOverflow