Skip to content

Deployment of resources through operator fails

The deployment of k8s resources fails on the current master with the exception below. After some research i could identify the possible cause:

In rocks.theodolite.kubernetes.operator.TheodoliteController :

The label applied to every resource is not valid, like in the exception below described const val CREATED_BY_LABEL_VALUE = "rocks/theodolite"

[Thread-1] ERROR rocks.theodolite.kubernetes.operator.TheodoliteController - Failure while executing execution theodolite-example-execution with benchmark uc1-kstreams.
rocks.theodolite.kubernetes.ExecutionFailedException: Error during setup the experiment
	at rocks.theodolite.kubernetes.ExperimentRunnerImpl.runSingleExperiment(ExperimentRunnerImpl.kt:108)
	at rocks.theodolite.kubernetes.ExperimentRunnerImpl.runExperiment(ExperimentRunnerImpl.kt:45)
	at rocks.theodolite.core.strategies.searchstrategy.LinearSearch.findSuitableResource(LinearSearch.kt:19)
	at rocks.theodolite.core.strategies.searchstrategy.RestrictionSearch.findSuitableResource(RestrictionSearch.kt:30)
	at rocks.theodolite.core.strategies.searchstrategy.SearchStrategy.applySearchStrategyByMetric(SearchStrategy.kt:32)
	at rocks.theodolite.core.ExecutionRunner.run(ExecutionRunner.kt:22)
	at rocks.theodolite.kubernetes.TheodoliteExecutor.setupAndRunExecution(TheodoliteExecutor.kt:131)
	at rocks.theodolite.kubernetes.operator.TheodoliteController.runExecution(TheodoliteController.kt:99)
	at rocks.theodolite.kubernetes.operator.TheodoliteController.reconcile(TheodoliteController.kt:62)
	at rocks.theodolite.kubernetes.operator.TheodoliteController.run(TheodoliteController.kt:49)
	at rocks.theodolite.kubernetes.operator.TheodoliteOperator.startOperator(TheodoliteOperator.kt:72)
	at rocks.theodolite.kubernetes.operator.TheodoliteOperator.access$startOperator(TheodoliteOperator.kt:28)
	at rocks.theodolite.kubernetes.operator.TheodoliteOperator$start$1.invoke(TheodoliteOperator.kt:39)
	at rocks.theodolite.kubernetes.operator.TheodoliteOperator$start$1.invoke(TheodoliteOperator.kt:39)
	at rocks.theodolite.kubernetes.operator.LeaderElector.getLeadership$lambda-4$lambda-1$lambda-0(LeaderElector.kt:33)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://10.96.0.1/api/v1/namespaces/default/configmaps. Message: ConfigMap "aggregation-jmx-configmap" is invalid: metadata.labels: Invalid value: "rocks/theodolite": 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=422, details=StatusDetails(causes=[StatusCause(field=metadata.labels, message=Invalid value: "rocks/theodolite": 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])?'), reason=FieldValueInvalid, additionalProperties={})], group=null, kind=ConfigMap, name=aggregation-jmx-configmap, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=ConfigMap "aggregation-jmx-configmap" is invalid: metadata.labels: Invalid value: "rocks/theodolite": 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, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).
	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:682)
	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:661)
	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:612)
	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:555)
	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:518)
	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleCreate(OperationSupport.java:305)
	at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleCreate(BaseOperation.java:644)
	at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleCreate(BaseOperation.java:83)
	at io.fabric8.kubernetes.client.dsl.base.CreateOnlyResourceOperation.create(CreateOnlyResourceOperation.java:61)
	at io.fabric8.kubernetes.client.utils.CreateOrReplaceHelper.createOrReplace(CreateOrReplaceHelper.java:48)
	at io.fabric8.kubernetes.client.dsl.base.BaseOperation.createOrReplace(BaseOperation.java:318)
	at io.fabric8.kubernetes.client.dsl.base.BaseOperation.createOrReplace(BaseOperation.java:83)
	at io.fabric8.kubernetes.client.dsl.internal.NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.createOrReplace(NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.java:105)
	at io.fabric8.kubernetes.client.dsl.internal.NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.createOrReplace(NamespaceVisitFromServerGetWatchDeleteRecreateWaitApplicableImpl.java:63)
	at rocks.theodolite.kubernetes.K8sManager.deploy(K8sManager.kt:23)
	at theodolite.benchmark.RolloutManager.rollout(RolloutManager.kt:17)
	at rocks.theodolite.kubernetes.KubernetesBenchmarkDeployment.setup(KubernetesBenchmarkDeployment.kt:61)
	at rocks.theodolite.kubernetes.ExperimentRunnerImpl.runSingleExperiment(ExperimentRunnerImpl.kt:87)
	... 15 more