Skip to content
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

Example Integration in the ClusterServiceVersion stuck in Deploying phase #1677

Closed
JustinKuli opened this issue Aug 27, 2020 · 2 comments · Fixed by #2032
Closed

Example Integration in the ClusterServiceVersion stuck in Deploying phase #1677

JustinKuli opened this issue Aug 27, 2020 · 2 comments · Fixed by #2032

Comments

@JustinKuli
Copy link

The OperatorHub.io page provides this sample yaml for deploying an Integration:

apiVersion: camel.apache.org/v1
kind: Integration
metadata:
  name: example
spec:
  sources:
  - content: |
      import org.apache.camel.builder.RouteBuilder;

      public class Example extends RouteBuilder {
          @Override
          public void configure() throws Exception {
              from("timer:tick")
                  .setBody(constant("Hello World!"))
              .to("log:info?skipBodyLineSeparator=false");
          }
      }
  name: Example.java

When this is applied to my cluster, the Integration resource is created successfully, but is stuck in the "Deploying" phase.

I found this error in the operator logs:

{"level":"error","ts":1598544943.9755495,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"integration-controller","request":"camel827-1/example","error":"error executing post actions: error during replace resource: could not create or replace resource example: Deployment.apps \"example\" is invalid: [spec.template.spec.volumes[0].configMap.items[0].path: Required value, spec.template.spec.containers[0].volumeMounts[0].name: Not found: \"i-source-000\"]","errorVerbose":"Deployment.apps \"example\" is invalid: [spec.template.spec.volumes[0].configMap.items[0].path: Required value, spec.template.spec.containers[0].volumeMounts[0].name: Not found: \"i-source-000\"]\ncould not create or replace resource example\ngithub.com/apache/camel-k/pkg/util/kubernetes.ReplaceResource\n\tgithub.com/apache/camel-k/pkg/util/kubernetes/replace.go:69\ngithub.com/apache/camel-k/pkg/util/kubernetes.ReplaceResources\n\tgithub.com/apache/camel-k/pkg/util/kubernetes/replace.go:38\ngithub.com/apache/camel-k/pkg/trait.(*deployerTrait).Apply.func1\n\tgithub.com/apache/camel-k/pkg/trait/deployer.go:68\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k/pkg/trait/trait.go:52\ngithub.com/apache/camel-k/pkg/controller/integration.(*deployAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/integration/deploy.go:56\ngithub.com/apache/camel-k/pkg/controller/integration.(*ReconcileIntegration).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/integration/integration_controller.go:261\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:256\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:153\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88\nruntime.goexit\n\truntime/asm_amd64.s:1357\nerror during replace resource\ngithub.com/apache/camel-k/pkg/trait.(*deployerTrait).Apply.func1\n\tgithub.com/apache/camel-k/pkg/trait/deployer.go:69\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k/pkg/trait/trait.go:52\ngithub.com/apache/camel-k/pkg/controller/integration.(*deployAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/integration/deploy.go:56\ngithub.com/apache/camel-k/pkg/controller/integration.(*ReconcileIntegration).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/integration/integration_controller.go:261\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:256\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:153\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88\nruntime.goexit\n\truntime/asm_amd64.s:1357\nerror executing post actions\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k/pkg/trait/trait.go:54\ngithub.com/apache/camel-k/pkg/controller/integration.(*deployAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/integration/deploy.go:56\ngithub.com/apache/camel-k/pkg/controller/integration.(*ReconcileIntegration).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/integration/integration_controller.go:261\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:256\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:153\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88\nruntime.goexit\n\truntime/asm_amd64.s:1357","stacktrace":"github.com/apache/camel-k/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\tgithub.com/apache/camel-k/vendor/github.com/go-logr/zapr/zapr.go:128\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:258\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232\ngithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tgithub.com/apache/camel-k/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:153\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88"}
@JustinKuli
Copy link
Author

By comparing this YAML to a working Integration, I believe the problem is in the last line: name: Example.java needs to be indented to be part of the item in the sources list. Currently the YAML is re-formatted to this in the cluster:

spec:
  name: Example.java
  sources:
  - content: |
      import org.apache.camel.builder.RouteBuilder;

      public class Example extends RouteBuilder {
          @Override
          public void configure() throws Exception {
              from("timer:tick")
                  .setBody(constant("Hello World!"))
              .to("log:info?skipBodyLineSeparator=false");
          }
      }

But it should be more like this:

spec:
  sources:
  - name: Example.java
    content: |
      import org.apache.camel.builder.RouteBuilder;

      public class Example extends RouteBuilder {
          @Override
          public void configure() throws Exception {
              from("timer:tick")
                  .setBody(constant("Hello World!"))
              .to("log:info?skipBodyLineSeparator=false");
          }
      }

I found the source for this yaml inside https://github.com/apache/camel-k/blob/master/deploy/olm-catalog/camel-k-dev/1.1.0-snapshot/camel-k.v1.1.0-snapshot.clusterserviceversion.yaml, but I'm not sure where it would be updated to get into the next release.

@astefanutti
Copy link
Member

Thanks a lot for the report. It's been fixed with #2032.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants