Skip to content

OLM-2690: Subscription affinity #359

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

Conversation

perdasilva
Copy link
Contributor

This PR brings down changes to the Subscription API that allows users to override the pod.spec.affinity of the operator deployment to enable deployment into multi-arch clusters

@openshift-ci openshift-ci bot requested review from awgreene and benluddy August 16, 2022 10:13
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 16, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: perdasilva

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 16, 2022
@perdasilva
Copy link
Contributor Author

perdasilva commented Aug 16, 2022

/hold for qe approval

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 16, 2022
@perdasilva perdasilva changed the title Subscription affinity feat: Subscription affinity Aug 16, 2022
@oceanc80
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 16, 2022
@perdasilva perdasilva force-pushed the subscription_affinity branch from a384cef to e7a2508 Compare August 16, 2022 13:02
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 16, 2022
@perdasilva
Copy link
Contributor Author

/retest

@michaelryanpeter
Copy link

/label docs-approved

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Aug 16, 2022
…penshift#250)

Signed-off-by: perdasilva <[email protected]>

Upstream-commit: f8da7254a5aabb477235d297f080af29f7fb0be4
Upstream-repository: api
….config (openshift#250)"

This reverts commit f8da7254a5aabb477235d297f080af29f7fb0be4.

Upstream-commit: 5490427930e127437fec9224e59cee50405ca131
Upstream-repository: api
Signed-off-by: perdasilva <[email protected]>

Upstream-commit: ae4da2a9ec6a5c8e8725f62eecd5c18bb1816658
Upstream-repository: api
* vendor new o_f/api version

Signed-off-by: perdasilva <[email protected]>

* Update olm controller to handle Subscription.config.affinity

Signed-off-by: perdasilva <[email protected]>

Upstream-commit: 55230179df33811fce196cca595c474bf4faaeff
Upstream-repository: operator-lifecycle-manager
Signed-off-by: perdasilva <[email protected]>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: 82d17f39785d0e7fdc0d6b77c35209c5c915bad6
@perdasilva perdasilva force-pushed the subscription_affinity branch from e7a2508 to e40c77d Compare August 18, 2022 05:29
@perdasilva
Copy link
Contributor Author

/retest

2 similar comments
@anik120
Copy link
Contributor

anik120 commented Aug 18, 2022

/retest

@perdasilva
Copy link
Contributor Author

/retest

@perdasilva perdasilva changed the title feat: Subscription affinity OLM-2690: Subscription affinity Aug 23, 2022
@jianzhangbjz
Copy link
Contributor

/assign @bandrade

@perdasilva
Copy link
Contributor Author

@bandrade any ETA on this one?

@bandrade
Copy link
Contributor

bandrade commented Sep 6, 2022

@perdasilva @jianzhangbjz I'm working on it. I should finish tomorrow. Sorry for the late response

@bandrade
Copy link
Contributor

bandrade commented Sep 7, 2022

oc exec catalog-operator-5b668f4d9d-f2krm  -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.19.0
git commit: c5a0ad3b230f04b5ec47525854fcf306f6250d5c

Testing scenario 1 - CR with NodeAffinity defined, POD should be scheduled in a specific node

apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  name: example
  namespace: test
spec:
  evaluationInterval: 30s
  serviceMonitorSelector: {}
  alerting:
    alertmanagers:
      - namespace: monitoring
        name: alertmanager-main
        port: web
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
          - matchExpressions:
              - values:
                  - ci-ln-9mfwdi2-72292-rw7jx-worker-c-cqwmw
                key: kubernetes.io/hostname
                operator: In
  probeSelector: {}
  podMonitorSelector: {}
  scrapeInterval: 30s
  ruleSelector: {}
  replicas: 2
  serviceAccountName: prometheus-k8s

  oc get pods -n test -o wide
  NAME                                   READY   STATUS    RESTARTS   AGE   IP            NODE                                       NOMINATED NODE   READINESS GATES
  prometheus-example-0                   2/2     Running   0          36s   10.131.0.21   ci-ln-9mfwdi2-72292-rw7jx-worker-c-cqwmw   <none>           <none>
  prometheus-example-1                   2/2     Running   0          36s   10.131.0.22   ci-ln-9mfwdi2-72292-rw7jx-worker-c-cqwmw   <none>           <none>
  prometheus-operator-787d8d5fb6-wf7zv   1/1     Running   0          13m   10.131.0.19   ci-ln-9mfwdi2-72292-rw7jx-worker-c-cqwmw   <none>           <none>

Testing scenario 2 - CR with anti-affinity defined, POD should not be scheduled in a node with a specific label defined.

  oc label node ci-ln-9mfwdi2-72292-rw7jx-worker-c-cqwmw app=dev                                                                                                                                                                        
  node/ci-ln-9mfwdi2-72292-rw7jx-worker-c-cqwmw labeled

  apiVersion: monitoring.coreos.com/v1
  kind: Prometheus
  metadata:
    name: example
    namespace: test
  spec:
    evaluationInterval: 30s
    serviceMonitorSelector: {}
    alerting:
      alertmanagers:
        - namespace: monitoring
          name: alertmanager-main
          port: web
    affinity:
      podAntiAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
                - values:
                    - dev
                  key: app
                  operator: In
            topologyKey: kubernetes.io/hostname
    probeSelector: {}
    podMonitorSelector: {}
    scrapeInterval: 30s
    ruleSelector: {}
    replicas: 2
    serviceAccountName: prometheus-k8s

  oc get pods -n test -o wide
   NAME                                   READY   STATUS    RESTARTS   AGE   IP            NODE                                       NOMINATED NODE   READINESS GATES
   prometheus-example-0                   2/2     Running   0          30s   10.131.0.29   ci-ln-9mfwdi2-72292-rw7jx-worker-c-cqwmw   <none>           <none>
   prometheus-example-1                   2/2     Running   0          30s   10.128.2.14   ci-ln-9mfwdi2-72292-rw7jx-worker-b-6zgrh   <none>           <none>
   prometheus-operator-787d8d5fb6-ft8z4   1/1     Running   0          78s   10.129.2.14   ci-ln-9mfwdi2-72292-rw7jx-worker-a-vfvnp   <none>           <none>

/lgtm
/unhold

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 7, 2022
@bandrade
Copy link
Contributor

bandrade commented Sep 7, 2022

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 7, 2022
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD fceaf8a and 2 for PR HEAD e40c77d in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 8, 2022

@perdasilva: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 2149aeb into openshift:master Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants