Can we enrich the Deployment resource

37 views
Skip to first unread message

cmou...@redhat.com

unread,
Mar 30, 2017, 2:51:38 PM3/30/17
to fabric8
Hi,

When the name of the artifactId is too long, fmp truncates the name of the service or the Deployment as you can see hereafter

ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.2.28:deploy (default-cli) on project spring-cloud-kubernetes-reload: Failed to create Deployment from kubernetes.yml. io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://192.168.99.100:8443/apis/extensions/v1beta1/namespaces/default/deployments. Message: Deployment.extensions "spring-cloud-kubernetes-" is invalid: metadata.name: Invalid value: "spring-cloud-kubernetes-": 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').

Is it possible to also enrich the Deployment config as we can do for the service ?

<configuration>
             
<enricher>
               
<config>
                 
<fmp-service>
                   
<name>spring-cloud-reload</name>
                 
</fmp-service>
               
</config>
             
</enricher>
</configuration>

Regards

Charles

Roland Huss

unread,
Mar 31, 2017, 3:28:23 AM3/31/17
to cmou...@redhat.com, fabric8
Yes, its called '<enricher><config><fmp-controller><name>....' ...

--
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
... roland

cmou...@redhat.com

unread,
Mar 31, 2017, 6:06:20 AM3/31/17
to fabric8
I tried what you proposed but it doesn't work for the kubernetes Deployment resource

Roland Huss

unread,
Mar 31, 2017, 7:16:54 AM3/31/17
to cmou...@redhat.com, fabric8
Can't say much more when I don't know your specific setup. Are you using automatically generated Deployments ? Or with depolyment fragments ? Or with xml configuration ? /////


--
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
... roland

Charles Moulliard

unread,
May 2, 2017, 5:09:50 AM5/2/17
to Roland Huss, fabric8
Hi,

The error is reported 

o.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://192.168.99.100:8443/apis/extensions/v1beta1/namespaces/default/deployments. Message: Deployment.extensions "spring-cloud-kubernetes-" is invalid: metadata.name: Invalid value: "spring-cloud-kubernetes-": 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: "spring-cloud-kubernetes-": 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=extensions, kind=Deployment, name=spring-cloud-kubernetes-, retryAfterSeconds=null, additionalProperties={}), kind=Status, message=Deployment.extensions "spring-cloud-kubernetes-" is invalid: metadata.name: Invalid value: "spring-cloud-kubernetes-": 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={}).
        at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:318)
        at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:267)
        at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:237)
        at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:230)
        at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleCreate(OperationSupport.java:208)
        at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleCreate(BaseOperation.java:696)
        at io.fabric8.kubernetes.client.dsl.base.BaseOperation.create(BaseOperation.java:320)
        at io.fabric8.kubernetes.api.Controller.doCreateResource(Controller.java:1070)
        at io.fabric8.kubernetes.api.Controller.applyResource(Controller.java:1059)


when this project "https://github.com/cmoulliard/spring-cloud-kubernetes/tree/master/spring-cloud-kubernetes-examples/kubernetes-reload-example" is deployed on minikube using the command "mvn clean package fabric8:deploy -Pkubernetes" where f-m-p hs been customized as such

<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${fabric8.maven.plugin.version}</version>
<executions>
<execution>
<id>fmp</id>
<goals>
<goal>resource</goal>
<goal>build</goal>
</goals>
</execution>
</executions>

<configuration>
<enricher>
<config>
<fmp-service>
<name>spring-cloud-reload</name>
</fmp-service>
</config>
</enricher>
</configuration>
</plugin>

Within the configuration

Charles 

To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
... roland

Reply all
Reply to author
Forward
0 new messages