kubevirt / hyperconverged-cluster-operator

Operator pattern for managing multi-operator products
Apache License 2.0
154 stars 152 forks source link

HCO pod in CrashLoopBackOff : Error:'no matches for kind "KubevirtMetricsAggregation" in version kubevirt.io/v1' #209

Closed maveric-tellrv closed 5 years ago

maveric-tellrv commented 5 years ago

I am facing issue while deploying HCO,


NAME                                               READY   STATUS             RESTARTS   AGE
cdi-operator-6b5c95f948-cct6d                      1/1     Running            0          62m
cluster-network-addons-operator-5b565f55c6-8vrn9   1/1     Running            0          62m
hyperconverged-cluster-operator-6f6c5f4486-hdkwd   0/1     CrashLoopBackOff   20         62m
kubevirt-ssp-operator-846dbc9f64-t2z6r             0/1     CrashLoopBackOff   20         62m
node-maintenance-operator-6b6d5756d8-hcx4w         1/1     Running            0          62m
virt-operator-74f6679d9f-jg7vr                     1/1     Running            0          62m
virt-operator-74f6679d9f-tttz7                     1/1     Running            0          62m

 kubevirt-hyperconverged logs  hyperconverged-cluster-operator-6f6c5f4486-hdkwd

{"level":"info","ts":1565593961.9313908,"logger":"cmd","msg":"Go Version: go1.11.10"}
{"level":"info","ts":1565593961.9314265,"logger":"cmd","msg":"Go OS/Arch: linux/amd64"}
{"level":"info","ts":1565593961.9314318,"logger":"cmd","msg":"Version of operator-sdk: v0.9.0+git"}
{"level":"info","ts":1565593961.931928,"logger":"leader","msg":"Trying to become the leader."}
{"level":"info","ts":1565593962.0958188,"logger":"leader","msg":"Found existing lock with my name. I was likely restarted."}
{"level":"info","ts":1565593962.095874,"logger":"leader","msg":"Continuing as the leader."}
{"level":"info","ts":1565593962.239434,"logger":"cmd","msg":"Registering Components."}
{"level":"info","ts":1565593962.239908,"logger":"kubebuilder.controller","msg":"Starting EventSource","controller":"hyperconverged-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1565593962.2400892,"logger":"kubebuilder.controller","msg":"Starting EventSource","controller":"hyperconverged-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1565593962.2401779,"logger":"kubebuilder.controller","msg":"Starting EventSource","controller":"hyperconverged-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1565593962.2402496,"logger":"kubebuilder.controller","msg":"Starting EventSource","controller":"hyperconverged-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1565593962.2403219,"logger":"kubebuilder.controller","msg":"Starting EventSource","controller":"hyperconverged-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1565593962.240397,"logger":"kubebuilder.controller","msg":"Starting EventSource","controller":"hyperconverged-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1565593962.2404702,"logger":"kubebuilder.controller","msg":"Starting EventSource","controller":"hyperconverged-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1565593962.2405872,"logger":"kubebuilder.controller","msg":"Starting EventSource","controller":"hyperconverged-controller","source":"kind source: /, Kind="}
{"level":"error","ts":1565593962.3880389,"logger":"kubebuilder.source","msg":"if kind is a CRD, it should be installed before calling Start","kind":"KubevirtMetricsAggregation.kubevirt.io","error":"no matches for kind \"KubevirtMetricsAggregation\" in version \"kubevirt.io/v1\"","stacktrace":"github.com/kubevirt/hyperconverged-cluster-operator/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/src/github.com/kubevirt/hyperconverged-cluster-operator/vendor/github.com/go-logr/zapr/zapr.go:128\ngithub.com/kubevirt/hyperconverged-cluster-operator/vendor/sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start\n\t/go/src/github.com/kubevirt/hyperconverged-cluster-operator/vendor/sigs.k8s.io/controller-runtime/pkg/source/source.go:89\ngithub.com/kubevirt/hyperconverged-cluster-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Watch\n\t/go/src/github.com/kubevirt/hyperconverged-cluster-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:122\ngithub.com/kubevirt/hyperconverged-cluster-operator/pkg/controller/hyperconverged.add\n\t/go/src/github.com/kubevirt/hyperconverged-cluster-operator/pkg/controller/hyperconverged/hyperconverged_controller.go:93\ngithub.com/kubevirt/hyperconverged-cluster-operator/pkg/controller/hyperconverged.Add\n\t/go/src/github.com/kubevirt/hyperconverged-cluster-operator/pkg/controller/hyperconverged/hyperconverged_controller.go:61\ngithub.com/kubevirt/hyperconverged-cluster-operator/pkg/controller.AddToManager\n\t/go/src/github.com/kubevirt/hyperconverged-cluster-operator/pkg/controller/controller.go:13\nmain.main\n\t/go/src/github.com/kubevirt/hyperconverged-cluster-operator/cmd/hyperconverged-cluster-operator/main.go:121\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:201"}
{"level":"error","ts":1565593962.3881633,"logger":"cmd","msg":"","error":"no matches for kind \"KubevirtMetricsAggregation\" in version \"kubevirt.io/v1\"","stacktrace":"github.com/kubevirt/hyperconverged-cluster-operator/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/src/github.com/kubevirt/hyperconverged-cluster-operator/vendor/github.com/go-logr/zapr/zapr.go:128\nmain.main\n\t/go/src/github.com/kubevirt/hyperconverged-cluster-operator/cmd/hyperconverged-cluster-operator/main.go:122\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:201"}
rthallisey commented 5 years ago

@djzager can you have a look?

rthallisey commented 5 years ago

Maybe the CRD isn't being added to the scheme? https://github.com/kubevirt/hyperconverged-cluster-operator/blob/master/cmd/hyperconverged-cluster-operator/main.go#L108

ffromani commented 5 years ago

Maybe the CRD isn't being added to the scheme? https://github.com/kubevirt/hyperconverged-cluster-operator/blob/master/cmd/hyperconverged-cluster-operator/main.go#L108

That CRD is supposed to be part of the scheme. Could be a bug on the ssp-operator side, investigating.

ffromani commented 5 years ago

SSP-operator side looks OK: https://github.com/MarSik/kubevirt-ssp-operator/blob/master/pkg/apis/kubevirt/v1/types.go#L84

ffromani commented 5 years ago

I am facing issue while deploying HCO,

Hi, which method did you followed to deploy HCO? On which platform? (e.g. ocp 3.11, okd 4.1.0...)

maveric-tellrv commented 5 years ago

@fronmainirh: OCP Cluster installation method via dev-scripts: https://github.com/openshift-metal3/dev-scripts

Cluster version  
 4.2.0-0.ci-2019-07-31-123929-kni.0  
Deploy HCO scripts :https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/deploy.sh
Modified : kubectl -> oc 
maveric-tellrv commented 5 years ago

@fromanirh ^^

ffromani commented 5 years ago

https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/deploy.sh

Weird, I used the same deploy.sh script and it works provided I apply https://github.com/kubevirt/hyperconverged-cluster-operator/pull/210 (merged now) It's weird because https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/metrics-aggregation.crd.yaml _does deploy` the metrics aggregation CRD.

rthallisey commented 5 years ago

@maveric-tellrv can you paste the logs from the script's execution?

maveric-tellrv commented 5 years ago

@rthallisey Logs for the script execution :

+ oc create ns kubevirt-hyperconverged
namespace/kubevirt-hyperconverged created
++ oc config current-context
+ oc config set-context admin --namespace=kubevirt-hyperconverged
Context "admin" modified.
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/hco.crd.yaml
customresourcedefinition.apiextensions.k8s.io/hyperconvergeds.hco.kubevirt.io created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/kubevirt.crd.yaml
customresourcedefinition.apiextensions.k8s.io/kubevirts.kubevirt.io created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/cdi.crd.yaml
customresourcedefinition.apiextensions.k8s.io/cdis.cdi.kubevirt.io created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/cna.crd.yaml
customresourcedefinition.apiextensions.k8s.io/networkaddonsconfigs.networkaddonsoperator.network.kubevirt.io created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/common-template-bundles.crd.yaml
customresourcedefinition.apiextensions.k8s.io/kubevirtcommontemplatesbundles.kubevirt.io created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/node-labeller-bundles.crd.yaml
customresourcedefinition.apiextensions.k8s.io/kubevirtnodelabellerbundles.kubevirt.io created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/template-validator.crd.yaml
customresourcedefinition.apiextensions.k8s.io/kubevirttemplatevalidators.kubevirt.io created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/nodemaintenance.crd.yaml
customresourcedefinition.apiextensions.k8s.io/nodemaintenances.kubevirt.io created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/cluster_role.yaml
clusterrole.rbac.authorization.k8s.io/hyperconverged-cluster-operator created
clusterrole.rbac.authorization.k8s.io/kubevirt-operator created
clusterrole.rbac.authorization.k8s.io/cdi-operator-cluster created
clusterrole.rbac.authorization.k8s.io/cluster-network-addons-operator created
clusterrole.rbac.authorization.k8s.io/kubevirt-ssp-operator created
clusterrole.rbac.authorization.k8s.io/node-maintenance-operator created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/service_account.yaml
serviceaccount/hyperconverged-cluster-operator created
serviceaccount/cdi-operator created
serviceaccount/kubevirt-operator created
serviceaccount/cluster-network-addons-operator created
serviceaccount/kubevirt-ssp-operator created
serviceaccount/node-maintenance-operator created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/cluster_role_binding.yaml
clusterrolebinding.rbac.authorization.k8s.io/hyperconverged-cluster-operator created
clusterrolebinding.rbac.authorization.k8s.io/kubevirt-operator created
clusterrolebinding.rbac.authorization.k8s.io/cdi-operator created
clusterrolebinding.rbac.authorization.k8s.io/cdi-operator-admin created
clusterrolebinding.rbac.authorization.k8s.io/cluster-network-addons-operator created
clusterrolebinding.rbac.authorization.k8s.io/cluster-network-addons-operator-admin created
clusterrolebinding.rbac.authorization.k8s.io/kubevirt-ssp-operator created
clusterrolebinding.rbac.authorization.k8s.io/node-maintenance-operator created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/operator.yaml
deployment.apps/hyperconverged-cluster-operator created
deployment.apps/virt-operator created
deployment.apps/cdi-operator created
deployment.apps/cluster-network-addons-operator created
deployment.apps/kubevirt-ssp-operator created
deployment.apps/node-maintenance-operator created
+ oc create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/hco.cr.yaml
hyperconverged.hco.kubevirt.io/hyperconverged-cluster created
maveric-tellrv commented 5 years ago

my bad my script was missing this line : kubectl create -f https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/crds/metrics-aggregation.crd.yaml

I will retry and update the status here :

rthallisey commented 5 years ago

@maveric-tellrv are you executing with curl https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/deploy.sh | bash or are you carrying a local copy? Recommend always curling the latest script to avoid it getting out of date.

rthallisey commented 5 years ago

This should either be fixed by updating the script or by using HCO with #210