operator-framework / operator-lifecycle-manager

A management framework for extending Kubernetes with Operators
https://olm.operatorframework.io
Apache License 2.0
1.73k stars 544 forks source link

How to troubleshot what is happening with a subscription #1063

Closed cmoulliard closed 5 years ago

cmoulliard commented 5 years ago

Question

I installed succcessfully on ocp3.11 OLM version 0.12.0 using the bash script ./install-olm.sh 0.12.0 and catalog like the manifest exist

NAME                    DISPLAY               TYPE   PUBLISHER        AGE
operatorhubio-catalog   Community Operators   grpc   OperatorHub.io   16m

NAME                               CATALOG               AGE
akka-cluster-operator              Community Operators   16m
appsody-operator                   Community Operators   16m
aqua                               Community Operators   16m
atlasmap-operator                  Community Operators   16m
aws-service                        Community Operators   16m
awss3-operator-registry            Community Operators   16m
banzaicloud-kafka-operator         Community Operators   16m
camel-k                            Community Operators   16m
clickhouse-operator                Community Operators   16m
cockroachdb                        Community Operators   16m
cos-bucket-operator                Community Operators   16m
couchdb-operator                   Community Operators   16m
eclipse-che                        Community Operators   16m
elastic-cloud-eck                  Community Operators   16m
enmasse                            Community Operators   16m
esindex-operator                   Community Operators   16m
etcd                               Community Operators   16m
event-streams-topic                Community Operators   16m
ext-postgres-operator              Community Operators   16m
falco                              Community Operators   16m
federatorai                        Community Operators   16m
ffdl                               Community Operators   16m
grafana-operator                   Community Operators   16m
halkyon                            Community Operators   16m
hazelcast-enterprise               Community Operators   16m
hpa-operator                       Community Operators   16m
ibmcloud-operator                  Community Operators   16m
infinispan                         Community Operators   16m
instana-agent                      Community Operators   16m
iot-simulator                      Community Operators   16m
istio                              Community Operators   16m
jaeger                             Community Operators   16m
kiali                              Community Operators   16m
kong                               Community Operators   16m
kubefed-operator                   Community Operators   16m
kubeturbo                          Community Operators   16m
kubevirt                           Community Operators   16m
lib-bucket-provisioner             Community Operators   16m
lightbend-console-operator         Community Operators   16m
litmuschaos                        Community Operators   16m
mattermost-operator                Community Operators   16m
metering-upstream                  Community Operators   16m
microcks                           Community Operators   16m
mongodb-enterprise                 Community Operators   16m
myvirtualdirectory                 Community Operators   16m
noobaa-operator                    Community Operators   16m
oneagent                           Community Operators   16m
open-liberty                       Community Operators   16m
openebs                            Community Operators   16m
opsmx-spinnaker-operator           Community Operators   16m
percona-server-mongodb-operator    Community Operators   16m
percona-xtradb-cluster-operator    Community Operators   16m
planetscale                        Community Operators   16m
portworx                           Community Operators   16m
postgres-operator                  Community Operators   16m
postgresql                         Community Operators   16m
postgresql-operator-dev4devs-com   Community Operators   16m
prometheus                         Community Operators   16m
radanalytics-spark                 Community Operators   16m
redis-enterprise                   Community Operators   16m
ripsaw                             Community Operators   16m
robin-operator                     Community Operators   16m
rook-ceph                          Community Operators   16m
rook-edgefs                        Community Operators   16m
seldon-operator                    Community Operators   16m
sematext                           Community Operators   16m
spark-gcp                          Community Operators   16m
spinnaker-operator                 Community Operators   16m
storageos                          Community Operators   16m
strimzi-kafka-operator             Community Operators   16m
synopsys                           Community Operators   16m
sysdig                             Community Operators   16m
t8c                                Community Operators   16m
tidb-operator                      Community Operators   16m
twistlock                          Community Operators   16m
vault                              Community Operators   16m
wildfly                            Community Operators   16m

If I create the following subscription for one of the Operator packaged under the namespace test, nothing happens => no pod running an operator is created

echo '
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: halkyon
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: halkyon
  source: operatorhubio-catalog
  sourceNamespace: olm
  startingCSV: halkyon.v0.1.3
' | kc apply -f - -n test

Output

kc describe subscription/halkyon -n test

Name:         halkyon
Namespace:    test
Labels:       <none>
Annotations:  kubectl.kubernetes.io/last-applied-configuration:
                {"apiVersion":"operators.coreos.com/v1alpha1","kind":"Subscription","metadata":{"annotations":{},"name":"halkyon","namespace":"test"},"spe...
API Version:  operators.coreos.com/v1alpha1
Kind:         Subscription
Metadata:
  Creation Timestamp:  2019-10-05T08:02:03Z
  Generation:          1
  Resource Version:    1633068
  Self Link:           /apis/operators.coreos.com/v1alpha1/namespaces/test/subscriptions/halkyon
  UID:                 6abff4e6-e746-11e9-9c47-96000031d79e
Spec:
  Channel:                alpha
  Install Plan Approval:  Automatic
  Name:                   halkyon
  Source:                 operatorhubio-catalog
  Source Namespace:       olm
  Starting CSV:           halkyon.v0.1.3
Status:
  Catalog Health:
    Catalog Source Ref:
      API Version:       operators.coreos.com/v1alpha1
      Kind:              CatalogSource
      Name:              operatorhubio-catalog
      Namespace:         olm
      Resource Version:  1627243
      UID:               1d5310ff-e744-11e9-9c47-96000031d79e
    Healthy:             true
    Last Updated:        2019-10-05T08:02:03Z
  Conditions:
    Last Transition Time:  2019-10-05T08:02:03Z
    Message:               all available catalogsources are healthy
    Reason:                AllCatalogSourcesHealthy
    Status:                False
    Type:                  CatalogSourcesUnhealthy
  Current CSV:             halkyon.v0.1.3
  Install Plan Ref:
    API Version:       operators.coreos.com/v1alpha1
    Kind:              InstallPlan
    Name:              install-m4q4n
    Namespace:         test
    Resource Version:  1633020
    UID:               6ac3f84e-e746-11e9-9c47-96000031d79e
  Installed CSV:       halkyon.v0.1.3
  Installplan:
    API Version:  operators.coreos.com/v1alpha1
    Kind:         InstallPlan
    Name:         install-m4q4n
    Uuid:         6ac3f84e-e746-11e9-9c47-96000031d79e
  Last Updated:   2019-10-05T08:02:09Z
  State:          AtLatestKnown
Events:           <none>

What should I do to check what wrong is happening ?

cmoulliard commented 5 years ago

If I look to the pod of the olm-manager, I see this message

time="2019-10-05T09:12:33Z" level=warning msg="csv in namespace with no operatorgroups" csv=halkyon.v0.1.3 id=OTXzH namespace=test phase=
  | time="2019-10-05T09:12:33Z" level=info msg="operatorgroup incorrect" csv=halkyon.v0.1.3 error="csv in namespace with no operatorgroups" id=OTXzH namespace=test phase=
  | time="2019-10-05T09:12:33Z" level=info msg="not in operatorgroup namespace" csv=halkyon.v0.1.3 id=gjNQ6 namespace=test phase=

What should I do to resolve this message csv in namespace with no operatorgroups ?

cmoulliard commented 5 years ago

If I create an operatorGroup within the namespace where I would like to install the operator, then that will work

apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: halkyon-operators
awgreene commented 5 years ago

Hello Charles,

This is by design and creating an OperatorGroup is the correct course of action to resolve the blocker. If you're interested in learning more about OperatorGroups, the following documentation may be helpful:

https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/design/operatorgroups.md