Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.
This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Generated secret name doesn't match k8s regex #43

@ash211

Description

@ash211

Running this spark-submit command:

./bin/spark-submit \
--deploy-mode cluster \
--class org.apache.spark.examples.SparkPi \
--master k8s://10.0.20.108:6443 \
--conf spark.executor.instances=5 \
--conf spark.kubernetes.driver.docker.image=$DRIVER_IMAGE \
--conf spark.kubernetes.executor.docker.image=$EXECUTOR_IMAGE \
--conf spark.kubernetes.submit.caCertFile=mycert.cert \
./examples/jars/spark-examples_2.11-2.2.0-SNAPSHOT.jar 1000

fails with this exception:

Exception in thread "main" io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://10.0.20.108:6443/api/v1/namespaces/default/secrets. Message: Secret "spark-submission-server-secret-org.apache.spark.examples.SparkPi-1485304544199" is invalid: metadata.name: Invalid value: "spark-submission-server-secret-org.apache.spark.examples.SparkPi-1485304544199": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com'). Received status: Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=metadata.name, message=Invalid value: "spark-submission-server-secret-org.apache.spark.examples.SparkPi-1485304544199": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com'), reason=FieldValueInvalid, additionalProperties={})], group=null, kind=Secret, name=spark-submission-server-secret-org.apache.spark.examples.SparkPi-1485304544199, retryAfterSeconds=null, additionalProperties={}), kind=Status, message=Secret "spark-submission-server-secret-org.apache.spark.examples.SparkPi-1485304544199" is invalid: metadata.name: Invalid value: "spark-submission-server-secret-org.apache.spark.examples.SparkPi-1485304544199": must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com'), metadata=ListMeta(resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).

I can workaround by setting a spark.app.name like:

--conf spark.app.name=aash-sparkpi \

The generated secret names should match the k8s regex

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions