8000 enable operator metric service and servicemonitor by eguzki · Pull Request #667 · 3scale/3scale-operator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

enable operator metric service and servicemonitor #667

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

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

eguzki
Copy link
Member
@eguzki eguzki commented Oct 1, 2021

https://issues.redhat.com/browse/THREESCALE-7644

TODO

  • test upgrade procedure. There was a bug in OLM where upgrading a CSV fails when providing a Service object as part of the bundle manifests. We should reenable this once that bug is fixed
  • deploy with olm and check service and servicemonitor
  • deploy fake 2.12 to upgrade from 2.11 (service and servicemonitors have the same name)

@openshift-ci
Copy link
openshift-ci bot commented Oct 1, 2021

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@eguzki
Copy link
Member Author
eguzki commented Oct 1, 2021

The upgrade procedure worked. New service for the metrics was created and old (2.10) metrics service was deleted. Same for the servicemonitor

For few seconds, they co-existed.

$ k get servicemonitors
NAME                                                     AGE
threescale-operator-controller-manager-metrics-monitor   1s
threescale-operator-metrics                              109s

Maybe it helped that the name changed, and if the name is the same, the upgrade breaks :) but after the operator-sdk version changes, the name of the service changed and the upgrade succeed.

Same for services

$ k get services
NAME                                                     TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)             AGE
threescale-operator-controller-manager-metrics-service   ClusterIP   172.30.40.66   <none>        8443/TCP            4s
threescale-operator-metrics                              ClusterIP   172.30.92.90   <none>        8383/TCP,8686/TCP   2m

After few seconds, old service and servicemonitor was deleted

k get services
NAME                                                     TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
threescale-operator-controller-manager-metrics-service   ClusterIP   172.30.40.66   <none>        8443/TCP   9s
k get servicemonitors
NAME                                                     AGE
threescale-operator-controller-manager-metrics-monitor   16s

@eguzki eguzki marked this pull request as ready for review October 1, 2021 15:06
@eguzki eguzki requested a review from miguelsorianod October 1, 2021 15:06
@miguelsorianod
Copy link
Contributor

👍. Could you test an upgrade with the same name?
The originally reported issue happened when the name is the same https://bugzilla.redhat.com/show_bug.cgi?id=1898500.

I see a fix for it was backported to 4.7 looking at that issue but I am not sure if it was backported to 4.6

@miguelsorianod
Copy link
Contributor

I think I found the fix for 4.6 too. It seems it was included in 4.6.16: https://bugzilla.redhat.com/show_bug.cgi?id=1920873
It would be good to verify it

@eguzki
Copy link
Member Author
eguzki commented Oct 1, 2021

It has been fixed.

Tested on

OpenShift version
    4.6.17

Upgrading to a "fake" 2.12 with the same service and servicemonitor names bundled, the upgrade procedure succeed.

The new install plan reports that service and servicemonitor were present.

- resolving: 3scale-operator.v0.9.0
    resource:
      group: ""
      kind: Service
      manifest: '{"kind":"ConfigMap","name":"fcf60aea4ed3f491c1b6779cd0f1e94992d62c2bed92550ac854cd56916d393","namespace":"openshift-marketplace","catalogSourceName":"eguzki-catalog","catalogSourceNamespace":"openshift-marketplace","replaces":"3scale-operator.v0.8.0","properties":"{\"properties\":[{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"OpenAPI\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"Product\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"apps.3scale.net\",\"kind\":\"APIManagerBackup\",\"version\":\"v1alpha1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"apps.3scale.net\",\"kind\":\"APIManagerRestore\",\"version\":\"v1alpha1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"apps.3scale.net\",\"kind\":\"APIManager\",\"version\":\"v1alpha1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"Backend\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"DeveloperAccount\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"DeveloperUser\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"Tenant\",\"version\":\"v1alpha1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"ActiveDoc\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"CustomPolicyDefinition\",\"version\":\"v1beta1\"}},{\"type\":\"olm.package\",\"value\":{\"packageName\":\"3scale-operator\",\"version\":\"0.9.0\"}}]}"}'
      name: threescale-operator-controller-manager-metrics-service
      sourceName: eguzki-catalog
      sourceNamespace: openshift-marketplace
      version: v1
    status: Present
- resolving: 3scale-operator.v0.9.0
    resource:
      group: monitoring.coreos.com
      kind: ServiceMonitor
      manifest: '{"kind":"ConfigMap","name":"fcf60aea4ed3f491c1b6779cd0f1e94992d62c2bed92550ac854cd56916d393","namespace":"openshift-marketplace","catalogSourceName":"eguzki-catalog","catalogSourceNamespace":"openshift-marketplace","replaces":"3scale-operator.v0.8.0","properties":"{\"properties\":[{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"OpenAPI\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"Product\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"apps.3scale.net\",\"kind\":\"APIManagerBackup\",\"version\":\"v1alpha1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"apps.3scale.net\",\"kind\":\"APIManagerRestore\",\"version\":\"v1alpha1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"apps.3scale.net\",\"kind\":\"APIManager\",\"version\":\"v1alpha1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"Backend\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"DeveloperAccount\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"DeveloperUser\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"Tenant\",\"version\":\"v1alpha1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"ActiveDoc\",\"version\":\"v1beta1\"}},{\"type\":\"olm.gvk\",\"value\":{\"group\":\"capabilities.3scale.net\",\"kind\":\"CustomPolicyDefinition\",\"version\":\"v1beta1\"}},{\"type\":\"olm.package\",\"value\":{\"packageName\":\"3scale-operator\",\"version\":\"0.9.0\"}}]}"}'
      name: threescale-operator-controller-manager-metrics-monitor
      sourceName: eguzki-catalog
      sourceNamespace: openshift-marketplace
      version: v1
    status: Present

The objects were not replaced or updated, just remained.

@eguzki eguzki force-pushed the enable-operator-monitoring-resources branch from 14ce994 to 3b7a67c Compare October 14, 2021 08:55
@eguzki eguzki force-pushed the enable-operator-monitoring-resources branch from 3b7a67c to c24b5e2 Compare October 20, 2021 08:41
@codeclimate
Copy link
codeclimate bot commented Oct 20, 2021

Code Climate has analyzed commit c24b5e2 and detected 0 issues on this pull request.

View more on Code Climate.

@eguzki
Copy link
Member Author
eguzki commented Oct 20, 2021

/retest

1 similar comment
@eguzki
Copy link
Member Author
eguzki commented Oct 20, 2021

/retest

@miguelsorianod miguelsorianod merged commit 963ce90 into master Oct 25, 2021
@miguelsorianod miguelsorianod deleted the enable-operator-monitoring-resources branch October 25, 2021 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0