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

Delete knative warning when Knative is not installed #2397

Closed
nicolaferraro opened this issue Jun 11, 2021 · 16 comments
Closed

Delete knative warning when Knative is not installed #2397

nicolaferraro opened this issue Jun 11, 2021 · 16 comments
Assignees
Labels
good first issue Does not require full understanding of the codebase status/never-stale
Milestone

Comments

@nicolaferraro
Copy link
Member

The operator prints periodically this info:

{"level":"info","ts":1623416979.434832,"logger":"camel-k","msg":"could not find any knative type in namespace camel, last error was: services.serving.knative.dev is forbidden: User \"system:serviceaccount:camel:camel-k-operator\" cannot list resource \"services\" in API group \"serving.knative.dev\" in the namespace \"camel\""}

It looks like an error, while it's not. That log should be suppressed.

@nicolaferraro nicolaferraro added this to the 1.5.0 milestone Jun 11, 2021
@nicolaferraro nicolaferraro added the good first issue Does not require full understanding of the codebase label Jun 11, 2021
@nicolaferraro nicolaferraro modified the milestones: 1.5.0, 1.6.0 Jul 5, 2021
@nicolaferraro nicolaferraro modified the milestones: 1.6.0, 1.7.0 Sep 7, 2021
@dimitraz
Copy link

dimitraz commented Oct 4, 2021

I'm happy to take a look at this if no one else already is!

@astefanutti
Copy link
Member

astefanutti commented Oct 5, 2021

@dimitraz great, feel free to go ahead. I think we can use that opportunity to revisit the IsEnabledInNamespace method entirely, as I doubt the current implementation is relevant.

@k0pper
Copy link

k0pper commented Oct 11, 2021

Getting this error when trying to deploy a KameletBinding onto a minikube cluster with the Camel K Operator running in the same namespace. The creation of the integrations fails and periodically prints out this message.

{"level":"info","ts":1633961666.2383604,"logger":"camel-k.controller.kameletbinding","msg":"Reconciling KameletBinding","request-namespace":"default","request-name":"chuck-norris-telegram-binding"}
{"level":"info","ts":1633961666.2408755,"logger":"camel-k.controller.kameletbinding","msg":"Invoking action monitor","request-namespace":"default","request-name":"chuck-norris-telegram-binding","api-version":"camel.apache.org/v1alpha1","kind":"KameletBinding","ns":"default","name":"chuck-norris-telegram-binding"}
{"level":"info","ts":1633961666.2700589,"logger":"camel-k","msg":"could not find any knative type in namespace default, last error was: services.serving.knative.dev is forbidden: User "system:serviceaccount:default:camel-k-operator" cannot list resource "services" in API group "serving.knative.dev" in the namespace "default""}

Any possible fixes for this one?

@nicolaferraro nicolaferraro modified the milestones: 1.7.0, 1.8.0 Nov 15, 2021
@claudio4j
Copy link
Contributor

@astefanutti about your suggestion to revisit the knative.IsEnabledInNamespace function, it is my understanding this function is used in pkg/controller/integration/platform_setup.go to set the knative profile if knative is enabled in the ns, so in this context it looks to be doing correctly.
WDYT to remove the log from knative.IsEnabledInNamespace function and print it if the user explicitly enables the knative trait but there is no knative in the namespace ?

@astefanutti
Copy link
Member

@claudio4j about my suggestion, the current implementation, that lists particular Knative resources in the namespace, barely check the presence of the Knative CRDs in the cluster, so it's not really scoped to the namespace. It could well be replaced with checking the discovery API if the Knative APIs are present, using

func IsAPIResourceInstalled(c kubernetes.Interface, groupVersion string, kind string) (bool, error) {
, or even the IsInstalled function, whose result would be equivalent.

For scoping the check to the namespace, I wonder if the webhooks.knative.dev/exclude annotation should be checked?

Then, for the log message, I think it could be removed altogether, or moved to the knative trait, in the configure method.

@oscerd oscerd modified the milestones: 1.8.0, 1.9.0 Jan 19, 2022
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!

@KuthumiPepple
Copy link
Contributor

I'd like to work on this

@oscerd oscerd modified the milestones: 1.9.0, 1.9.1 Apr 26, 2022
@KuthumiPepple
Copy link
Contributor

How do I reproduce this bug

@claudio4j
Copy link
Contributor

@KuthumiPepple When you run the camel-k-operator in a namespace with no knative resources,it will print the mentioned output in the camel-k-operator pod log.

@KuthumiPepple
Copy link
Contributor

@claudio4j So I built the operator with make and then followed this guide for running the operator locally. However, when I run kamel operator, I do not see the error message in the logs. It seems I may be missing something or doing something wrongly.

@claudio4j
Copy link
Contributor

You should just install camel-k-operator in the kubernetes cluster and watch the camel-k-operator log. The kamel operator is for development purposes to run the camel-k-operator locally.

@oscerd oscerd modified the milestones: 1.9.1, 1.9.2 May 13, 2022
@oscerd oscerd removed this from the 1.9.2 milestone May 23, 2022
@tadayosi
Copy link
Member

tadayosi commented Dec 2, 2022

@KuthumiPepple Since it's been inactive for long time, let me unassign it from you.

@tadayosi tadayosi assigned tadayosi and unassigned KuthumiPepple Dec 2, 2022
@KuthumiPepple
Copy link
Contributor

KuthumiPepple commented Dec 2, 2022 via email

@nchudasmasumo
Copy link

nchudasmasumo commented Dec 9, 2022

i am trying to create kamlet for kafka source as below

kamel bind kafka-source -p "source.bootstrapServers=my-cluster-kafka-brokers.kafka.svc.cluster.local:9092" -p "source.topic=kafka-push-logs" kafka.strimzi.io/v1beta1:KafkaTopic:kafka-push-logs -p "source.user=" -p "source.password="

Getting below error logs in camel-k-operator. Is there any step am I missing here? Do I need to provide some other configuration besides?

{"level":"info","ts":1670544567.7944477,"logger":"camel-k.controller.kameletbinding","msg":"Invoking action initialize","request-namespace":"default","request-name":"kafka-source-to-kafka-push-logs","api-version":"camel.apache.org/v1alpha1","kind":"KameletBinding","ns":"default","name":"kafka-source-to-kafka-push-logs"}
{"level":"info","ts":1670544567.7976258,"logger":"camel-k","msg":"could not find any knative type in namespace default, last error was: the server could not find the requested resource"}
{"level":"error","ts":1670544567.8029149,"logger":"controller.kamelet-binding-controller","msg":"Reconciler error","name":"kafka-source-to-kafka-push-logs","namespace":"default","error":"could not determine sink URI: kafkatopics.kafka.strimzi.io \"kafka-push-logs\" not found","errorVerbose":"kafkatopics.kafka.strimzi.io \"kafka-push-logs\" not found\ncould not determine sink URI\ngithub.com/apache/camel-k/pkg/controller/kameletbinding.CreateIntegrationFor\n\tgithub.com/apache/camel-k/pkg/controller/kameletbinding/integration.go:109\ngithub.com/apache/camel-k/pkg/controller/kameletbinding.(*initializeAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/kameletbinding/initialize.go:53\ngithub.com/apache/camel-k/pkg/controller/kameletbinding.(*ReconcileKameletBinding).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/kameletbinding/kamelet_binding_controller.go:203\ngithub.com/apache/camel-k/pkg/util/monitoring.(*instrumentedReconciler).Reconcile\n\tgithub.com/apache/camel-k/pkg/util/monitoring/controller.go:70\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:227\nruntime.goexit\n\truntime/asm_amd64.s:1581","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:227"}
{"level":"info","ts":1670544608.7631521,"logger":"camel-k.controller.kameletbinding","msg":"Reconciling KameletBinding","request-namespace":"default","request-name":"kafka-source-to-kafka-push-logs"}
{"level":"info","ts":1670544608.7632976,"logger":"camel-k.controller.kameletbinding","msg":"Invoking action initialize","request-namespace":"default","request-name":"kafka-source-to-kafka-push-logs","api-version":"camel.apache.org/v1alpha1","kind":"KameletBinding","ns":"default","name":"kafka-source-to-kafka-push-logs"}
{"level":"info","ts":1670544608.7716732,"logger":"camel-k","msg":"could not find any knative type in namespace default, last error was: the server could not find the requested resource"}
{"level":"error","ts":1670544608.777633,"logger":"controller.kamelet-binding-controller","msg":"Reconciler error","name":"kafka-source-to-kafka-push-logs","namespace":"default","error":"could not determine sink URI: kafkatopics.kafka.strimzi.io \"kafka-push-logs\" not found","errorVerbose":"kafkatopics.kafka.strimzi.io \"kafka-push-logs\" not found\ncould not determine sink URI\ngithub.com/apache/camel-k/pkg/controller/kameletbinding.CreateIntegrationFor\n\tgithub.com/apache/camel-k/pkg/controller/kameletbinding/integration.go:109\ngithub.com/apache/camel-k/pkg/controller/kameletbinding.(*initializeAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/kameletbinding/initialize.go:53\ngithub.com/apache/camel-k/pkg/controller/kameletbinding.(*ReconcileKameletBinding).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/kameletbinding/kamelet_binding_controller.go:203\ngithub.com/apache/camel-k/pkg/util/monitoring.(*instrumentedReconciler).Reconcile\n\tgithub.com/apache/camel-k/pkg/util/monitoring/controller.go:70\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:227\nruntime.goexit\n\truntime/asm_amd64.s:1581","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/controller-runtime@v0.11.2/pkg/internal/controller/controller.go:227"}

@squakez
Copy link
Contributor

squakez commented Dec 12, 2022

@nchudasmasumo I think you better log a new issue, as it looks completely different from the one discussed in this one.

@tadayosi
Copy link
Member

This issue should be already fixed with 3652ee7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Does not require full understanding of the codebase status/never-stale
Projects
None yet
Development

No branches or pull requests