apache / incubator-kie-kogito-operator

Kubernetes Operator for Kogito
Apache License 2.0
45 stars 79 forks source link

A custom k8s object error when starting operator #659

Closed kyugao closed 3 years ago

kyugao commented 3 years ago

full error log from pod kogito-operator

{"level":"info","T":"2020-11-17T10:17:19.147Z","logger":"cmd","msg":"Operator Version: 0.17.0"} {"level":"info","T":"2020-11-17T10:17:19.147Z","logger":"cmd","msg":"Go Version: go1.14"} {"level":"info","T":"2020-11-17T10:17:19.147Z","logger":"cmd","msg":"Go OS/Arch: linux/amd64"} {"level":"info","T":"2020-11-17T10:17:19.147Z","logger":"cmd","msg":"Version of operator-sdk: v0.18.2"} {"level":"info","ts":1605608239.1480215,"logger":"leader","msg":"Trying to become the leader."} {"level":"info","ts":1605608239.6104696,"logger":"leader","msg":"Found existing lock with my name. I was likely restarted."} {"level":"info","ts":1605608239.6105003,"logger":"leader","msg":"Continuing as the leader."} {"level":"info","T":"2020-11-17T10:17:20.063Z","logger":"cmd","msg":"Registering Components."} {"level":"info","ts":1605608240.0632577,"logger":"controller-runtime.metrics","msg":"metrics server is starting to listen","addr":"0.0.0.0:8383"} {"level":"warn","T":"2020-11-17T10:17:20.078Z","logger":"framework","msg":"Impossible to register GroupVersion infinispan.org/v1. CRD not installed in the cluster, controller might not behave as expected"} {"level":"warn","T":"2020-11-17T10:17:20.078Z","logger":"framework","msg":"Impossible to register GroupVersion kafka.strimzi.io/v1beta1. CRD not installed in the cluster, controller might not behave as expected"} {"level":"warn","T":"2020-11-17T10:17:20.078Z","logger":"framework","msg":"Impossible to register GroupVersion keycloak.org/v1alpha1. CRD not installed in the cluster, controller might not behave as expected"} {"level":"info","T":"2020-11-17T10:17:20.547Z","logger":"cmd","msg":"Could not generate and serve custom resource metricserrordiscovering resource information failed for KogitoRuntime in app.kiegroup.org/v1alpha1: apiVersion app.kiegroup.org/v1alpha1 and kind KogitoRuntime not found available in Kubernetes cluster"} {"level":"info","ts":1605608241.0480037,"logger":"metrics","msg":"Metrics Service object updated","Service.Name":"kogito-operator-metrics","Service.Namespace":"grp-kogito"} {"level":"info","T":"2020-11-17T10:17:21.499Z","logger":"cmd","msg":"Could not create ServiceMonitor objecterrorno ServiceMonitor registered with the API"} {"level":"info","T":"2020-11-17T10:17:21.499Z","logger":"cmd","msg":"Install prometheus-operator in your cluster to create ServiceMonitor objectserrorno ServiceMonitor registered with the API"} {"level":"info","T":"2020-11-17T10:17:21.499Z","logger":"cmd","msg":"Starting the Cmd."} {"level":"info","ts":1605608241.4993875,"logger":"controller-runtime.manager","msg":"starting metrics server","path":"/metrics"} {"level":"info","ts":1605608241.499427,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"kogitobuild-controller","source":"kind source: /, Kind="} {"level":"info","ts":1605608241.4995284,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"kogitomgmtconsole-controller","source":"kind source: /, Kind="} {"level":"info","ts":1605608241.4995935,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"kogitoruntime-controller","source":"kind source: /, Kind="} {"level":"info","ts":1605608241.4996097,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"kogitoexplainability-controller","source":"kind source: /, Kind="} {"level":"info","ts":1605608241.4996617,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"kogitotrusty-controller","source":"kind source: /, Kind="} {"level":"info","ts":1605608241.4996724,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"kogitotrustyui-controller","source":"kind source: /, Kind="} {"level":"info","ts":1605608241.4997134,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"kogitoinfra-controller","source":"kind source: /, Kind="} {"level":"info","ts":1605608241.4997108,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"kogitodataindex-controller","source":"kind source: /, Kind="} {"level":"info","ts":1605608241.4997218,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"kogitojobsservice-controller","source":"kind source: /, Kind="} {"level":"error","T":"2020-11-17T10:17:22.012Z","logger":"cmd","msg":"no matches for kind \"KogitoBuild\" in version \"app.kiegroup.org/v1alpha1\"Manager exited non-zero"} {"level":"error","ts":1605608242.0121248,"logger":"controller-runtime.source","msg":"if kind is a CRD, it should be installed before calling Start","kind":"KogitoBuild.app.kiegroup.org","error":"no matches for kind \"KogitoBuild\" in version \"app.kiegroup.org/v1alpha1\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/jenkins/go/pkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start\n\t/home/jenkins/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.1/pkg/source/source.go:117\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1\n\t/home/jenkins/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.1/pkg/internal/controller/controller.go:140\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start\n\t/home/jenkins/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.1/pkg/internal/controller/controller.go:175\nsigs.k8s.io/controller-runtime/pkg/manager.(*controllerManager).startLeaderElectionRunnables.func1\n\t/home/jenkins/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.1/pkg/manager/internal.go:514"}

Kaitou786 commented 3 years ago

Hi @kyugao looking at the logs it looks like the CRDs were not applied before running the operator pod, Can you please share the steps on how did you install the operator in your cluster?

kyugao commented 3 years ago
  1. checkout the repository, master branch
  2. cd into the folder 'kogito-cloud-operator'
  3. kubectl apply -n grp-kogigo -f kogito-operator.yaml'.
kyugao commented 3 years ago

I tried this way, but got a 404 response [root@VM-1-10-centos kogito-cloud-operator]# ./hack/install.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 179k 0 179k 0 0 4612 0 --:--:-- 0:00:39 --:--:-- 11664 ....... Installing Kogito Operator v0.17.0 ....... error: unable to read URL "https://github.com/kiegroup/kogito-cloud-operator/releases/download/v0.17.0/kogito-operator.yaml", server reported 404 Not Found, status code=404

ricardozanini commented 3 years ago

Hi @kyugao! Many thanks for letting us know about this issue.

On 0.17.0 we don't have the YAML installer yet available in the releases page, that's why you see this message. On 0.17.0, we still have to apply all objects individually. Can you try:

$ git checkout --track origin/0.17.x
$ ./hack/install.sh

Given that your forked repository has the 0.17.x branch.

Please watch out for errors from CRDs if your Kubernetes version is above 1.18, since it's deprecated, this old installation script is not handling that well. You might need to apply the YAML files from deploy dir manually. Sorry for the inconvenience, we fixed this in the upcoming 1.0.0 version.

kyugao commented 3 years ago

glad to hear that 1.0.0 is comming, will this kogito support golang? cannot imagine that a golang implement framework dosenot support golang. :)

kyugao commented 3 years ago

I try this command twice, after created the ns kogito manully, all cdr created. [root@VM-1-10-centos kogito-cloud-operator]# ./hack/install.sh customresourcedefinition.apiextensions.k8s.io/kogitobuilds.app.kiegroup.org unchanged customresourcedefinition.apiextensions.k8s.io/kogitodataindices.app.kiegroup.org unchanged customresourcedefinition.apiextensions.k8s.io/kogitoexplainabilities.app.kiegroup.org unchanged customresourcedefinition.apiextensions.k8s.io/kogitoinfras.app.kiegroup.org unchanged customresourcedefinition.apiextensions.k8s.io/kogitojobsservices.app.kiegroup.org unchanged customresourcedefinition.apiextensions.k8s.io/kogitomgmtconsoles.app.kiegroup.org unchanged customresourcedefinition.apiextensions.k8s.io/kogitoruntimes.app.kiegroup.org unchanged customresourcedefinition.apiextensions.k8s.io/kogitotrusties.app.kiegroup.org unchanged customresourcedefinition.apiextensions.k8s.io/kogitotrustyuis.app.kiegroup.org unchanged rolebinding.rbac.authorization.k8s.io/kogito-operator created rolebinding.rbac.authorization.k8s.io/kogito-service-viewer created role.rbac.authorization.k8s.io/kogito-operator created role.rbac.authorization.k8s.io/kogito-service-viewer created serviceaccount/kogito-operator created serviceaccount/kogito-service-viewer created

Kaitou786 commented 3 years ago

Hi @kyugao thanks for pointing out this error, There is a small mistake in hack/manifests.sh script which is causing the deployment not to be created. We'll fix it shortly, in the mean time. Just for the quick fix remove this line from the hack/install-manifests.sh and redo your steps. After that you should be able to see deployment in the kogito namespace.

ricardozanini commented 3 years ago

@Kaitou786 thanks for pointing this out, I just want to stress that this bug has been fixed on 1.0.0

glad to hear that 1.0.0 is comming, will this kogito support golang? cannot imagine that a golang implement framework dosenot support golang. :)

Not sure if I understood your statement, @kyugao . You mean the Kogito Runtimes to support Go? Unfortunately our architecture is based on Java + Quarkus, so no Go for now. This project is to deploy the Kogito services platform on Kubernetes clusters.