christophd commented on code in PR #14971:
URL: https://github.com/apache/camel/pull/14971#discussion_r1697964466


##########
dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/test/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesExportTest.java:
##########
@@ -167,11 +201,13 @@ public void shouldAddServiceSpec(RuntimeType rt) throws 
Exception {
                 
deployment.getSpec().getTemplate().getSpec().getContainers().get(0).getPorts().get(0).getContainerPort());
 
         Service service = getService(rt);
+        List<ServicePort> ports = service.getSpec().getPorts();
         Assertions.assertEquals("route-service", 
service.getMetadata().getName());
-        Assertions.assertEquals(1, service.getSpec().getPorts().size());
-        Assertions.assertEquals("http", 
service.getSpec().getPorts().get(0).getName());
-        Assertions.assertEquals(80, 
service.getSpec().getPorts().get(0).getPort());
-        Assertions.assertEquals("http", 
service.getSpec().getPorts().get(0).getTargetPort().getStrVal());
+        Assertions.assertEquals("NodePort", service.getSpec().getType());
+        Assertions.assertEquals(1, ports.size());
+        Assertions.assertEquals("http", ports.get(0).getName());
+        Assertions.assertEquals(8080, ports.get(0).getPort());

Review Comment:
   the Kubernetes service should be exposed on port 80 by default so other 
components in the cluster can call the service with its pure domain name URL 
(e.g. `http://my-service.default/` instead of `http://my-service.default:8080/`



##########
dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesExport.java:
##########
@@ -233,12 +233,18 @@ public Integer export() throws Exception {
         TraitHelper.configureEnvVars(traitsSpec, envVars);
         TraitHelper.configureConnects(traitsSpec, connects);
 
+        // Plain export command always exposes a health endpoint on 8080. Make 
sure, we have an Http service for that endpoint.
+        // We may (later) decide that the health endpoint can be disabled.
+        //        if (!TraitHelper.exposesHttpService(context)) {
+        //            TraitHelper.configureHttpService(traitsSpec);
+        //        }

Review Comment:
   Do you plan to implement this 
`TraitHelper.configureHttpService(traitsSpec);`?



##########
dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/ServiceTrait.java:
##########
@@ -46,6 +46,10 @@ public boolean configure(Traits traitConfig, TraitContext 
context) {
             return traitConfig.getService().getEnabled();
         }
 
+        if (traitConfig.getContainer().getPort() != null) {

Review Comment:
   I think we need similar for the Knative trait as it also checks on 
`TraitHelper.exposesHttpService()`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to