New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Boot actuator endpoints failed to generate automatically if "deployment.yml" resource fragment is used #1295
Comments
@simonwg : Thanks for reporting, I can reproduce this issue. Till this gets fixed you can try using this property as a workaround:
mvn oc:resource -Djkube.enricher.jkube-healthcheck-spring-boot.enrichAllContainers=true |
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Add a distinct size calculation logic to avoid probes not being added in case of openshift. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Hmm, I'm seeing strange behavior from TypedVisitor class since previous Kubernetes Client upgrade Here when KubernetesListBuilder contains a DeploymentConfig, Service and Route and DeploymentConfig contains only one container in PodTemplateSpec; Somehow the What's more strange is that I'm struggling to reproduce this via a unit test with same DeploymentConfig contents. For example, this unit test is passing: @Test
public void enrichSingleContainerInOpenShift() {
KubernetesListBuilder list = new KubernetesListBuilder().addToItems(new DeploymentConfigBuilder()
.withNewMetadata()
.addToLabels("app.openshift.io/vcs-ref", "master")
.addToLabels("jkube.io/git-url", "git@github.com:rohanKanojia/eclipse-jkube-demo-project.git")
.addToLabels("app.openshift.io/vcs-uri", "git@github.com:rohanKanojia/eclipse-jkube-demo-project.git")
.addToLabels("jkube.io/git-commit", "40b69fc860db02bcbd02dc31e27791b48ccdd4dd")
.addToLabels("jkube.io/git-branch", "master")
.addToLabels("jkube.io/scm-url", "https://github.com/spring-projects/spring-boot/random-generator")
.addToLabels("jkube.io/scm-tag", "HEAD")
.withName("test-project")
.endMetadata()
.withNewSpec()
.withReplicas(1)
.addToSelector("app", "test-project")
.addToSelector("provider", "jkube")
.addToSelector("group", "meetup")
.withNewStrategy()
.withNewRollingParams().withTimeoutSeconds(3600L).endRollingParams()
.withType("Rolling")
.endStrategy()
.withNewTemplate()
.withNewSpec()
.addNewContainer()
.withName("app")
.withImage("app:latest")
.withImagePullPolicy("IfNotPresent")
.addNewEnv()
.withName("KUBERNETES_NAMESPACE")
.withNewValueFrom().withNewFieldRef().withFieldPath(".metadata.namespace").endFieldRef().endValueFrom()
.endEnv()
.withNewSecurityContext().withPrivileged(false).endSecurityContext()
.addNewPort().withContainerPort(8080).withName("http").withProtocol("TCP").endPort()
.addNewPort().withContainerPort(9779).withName("prometheus").withProtocol("TCP").endPort()
.addNewPort().withContainerPort(8778).withName("jolokia").withProtocol("TCP").endPort()
.endContainer()
.endSpec()
.endTemplate()
.addNewTrigger()
.withType("ConfigChange")
.endTrigger()
.endSpec());
createEnricher(new Properties(), Collections.emptyMap()).create(PlatformMode.openshift, list);
final AtomicInteger containerFound = new AtomicInteger(0);
list.accept(new TypedVisitor<ContainerBuilder>() {
@Override
public void visit(ContainerBuilder container) {
assertNotNull(container.build().getLivenessProbe());
assertNotNull(container.build().getReadinessProbe());
containerFound.incrementAndGet();
}
});
assertEquals(1, containerFound.get());
} I do have a fix for this issue but I'm not sure if it's the right fix or not. I'll continue working on this to reproduce it via unit test. |
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (eclipse-jkube#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…l` fragment is used (#1295) Right now with DeploymentConfigBuilder, TypedVisitor<ContainerBuilder> is visiting ContainerBuilder twice instead of visiting it once. This is generating list with duplicate ContainerBuilder elements. Move DeploymentConfigEnricher lower than Health Check enrichers in order to do conversion after health checks have been added to Deployment. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Description
Info
mvn -v
) : 3.8.4Kubernetes / Red Hat OpenShift setup and version : OpenShift 3.11
If it's a bug, how to reproduce : Using the zero-config quickstarts. Add the following in src/main/jkube/deployment.yml
The log will show that "oc: jkube-healthcheck-spring-boot" is not triggered and the output openshift.yml doesn't have readinessProbe and livenessProbe config generated. Same configuration works for JKube 1.5.1
If it's a feature request, what is your use case :
Sample Reproducer Project : [GitHub Clone URL]
The text was updated successfully, but these errors were encountered: