operator-framework / operator-lifecycle-manager

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

Creating many subscriptions may result in `UpgradePending` for some operators #1704

Closed radtriste closed 2 years ago

radtriste commented 4 years ago

Bug Report

What did you do? In order to test current version of our Kogito operator, we install, via subscription yaml, the different dependent operators if needed for our tests. It can be for example, Infinispan, Stimzi and/or Keycloak operators. For that, in our namespace, we first create an OperatorGroup, if not already existing:

operatorGroup := &olmapiv1.OperatorGroup{
        ObjectMeta: metav1.ObjectMeta{
            Name:      operatorGroupName,
            Namespace: namespace,
        },
        Spec: olmapiv1.OperatorGroupSpec{
            TargetNamespaces: []string{namespace},
        },
    }

and then we create some namespaced subscriptions, for example both

subscription := &olmapiv1alpha1.Subscription{
        ObjectMeta: metav1.ObjectMeta{
            Name:      "infinispan",
            Namespace: namespace,
        },
        Spec: &olmapiv1alpha1.SubscriptionSpec{
            Package:                "infinispan",
            CatalogSource:          "community-operators",
            CatalogSourceNamespace: "openshift-marketplace",
            Channel:                "stable",
        },
    }

and

subscription := &olmapiv1alpha1.Subscription{
        ObjectMeta: metav1.ObjectMeta{
            Name:      "strimzi-kafka-operator",
            Namespace: namespace,
        },
        Spec: &olmapiv1alpha1.SubscriptionSpec{
            Package:                "strimzi-kafka-operator",
            CatalogSource:          "community-operators",
            CatalogSourceNamespace: "openshift-marketplace",
            Channel:                "stable",
        },
    }

and then we wait for all operators to be up and running.

What did you expect to see? One installplan with both csv operators in it or 2 installplans, one for each csv operator.

What did you see instead? Under which circumstances? When the cluster is busy, sometimes, only one installplan will be created and only one operator will be in it. But both subscriptions are linked to that installplan. Which result, for example, in Strimzi (which is the second subscription to be created) blocked in status UpgradePending and no further progress ...

Environment

Workaround For now, as a workaround, we install each operator, one after the other, waiting for the previous one to be up.

Additional context Sometimes, also, it creates one installplan with both csv and sometimes 2 installplan, this seems to be totally random ...

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dinhxuanvu commented 2 years ago

Please use newer version of OLM (OCP 4.6+) because the new resolver may resolve this issue. Stale issue. Closed. Feel free to reopen if needed.