Skip to content
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

Force PAO installation on master nodes #351

Closed
wants to merge 2 commits into from

Conversation

marcel-apf
Copy link
Contributor

PAO is meant to run on "control plane".

Use podAffinity to schedule PAO only on master nodes.
(https://docs.openshift.com/container-platform/4.5/nodes/scheduling/nodes-scheduler-pod-affinity.html)
Use taints tolerations to allow PAO scheduling on the master nodes.
(https://docs.openshift.com/container-platform/4.5/nodes/scheduling/nodes-scheduler-taints-tolerations.html)

Add a test verifying PAO runs in master nodes
Straight forward test that queries the node PAO is running on
is a master node.

@marcel-apf
Copy link
Contributor Author

/retest

@marcel-apf
Copy link
Contributor Author

Depends on #350

if err := testclient.Client.List(context.TODO(), pods, opts); err != nil {
return nil, err
}
if len(pods.Items) != 1 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should just use len(pods.Items) < 1 (just in case we eventually add HA and leader election). Or maybe it would be premature to change the test now, so just asking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, I prefer to keep the test as-is and see it break first when/if we add the HA/leader election.

Copy link
Member

@ffromani ffromani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks mostly OK. Most (relatively minor) concerns about the e2e test and the GetPerformanceProfilePod function, changes to CSV looks good

@@ -118,6 +118,13 @@ spec:
labels:
name: performance-operator
spec:
affinity:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems OCP control plane is using

    nodeSelector:
      node-role.kubernetes.io/master: ""

but the end result is the same and affinity rules are more powerful than nodeSelector, so it seems is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I preferred affinity since is is reflected in the official docs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is affinity reflected in the openshift official docs or the kubernetes official docs? or both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both

functests/0_config/config.go Show resolved Hide resolved
functests/0_config/config.go Outdated Show resolved Hide resolved
functests/0_config/config.go Outdated Show resolved Hide resolved
functests/utils/pods/pods.go Outdated Show resolved Hide resolved
if len(pods.Items) != 1 {
return nil, fmt.Errorf("incorrect performance operator pods count: %d", len(pods.Items))
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any way to check that pod is indeeded running performance-operator and not any random pod which is happen to have the same label?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the same namespace as PAO "openshift-performance-addon" ? I think is a relatively safe bet...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still a bet, meaning is still anecdotal evidence, and we need quite some of it to gain confidence. Checking the image name seems stronger (does it contain 'performance-operator'). Feel free to add more checks, or to lookup better ones.
The best way would probably be to check a PAO endpoint and to verify it is behaving correctly; that's sufficient proof the service is there. It's probably complex, maybe too complex to be done here, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are also checking we have only one pod in the namespace. The check is the first step in the func tests, I suppose the next steps will fail if for some reason the PAO is not in the namespace, but another pod with same label.
While I agree that theoretically is not enough, is it the place to add more checks?
I can add a check the actual pod name starts with performace-operator-{something}, but this is a side effect on how k8s names pods.Or maybe would add to confidence?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added check the performance operator pod name (not label) starts with "performance-operator"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should increase the confidence in the bet

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not completely happy with this solution, but good enough for now.

@marcel-apf marcel-apf force-pushed the schedule-masters branch 2 times, most recently from 56ae514 to ac70c96 Compare September 21, 2020 12:32
@@ -9,6 +9,7 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gstruct"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used by Reject()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. And BTW this is exacty why I dislike the dot imports.

functests/0_config/config.go Show resolved Hide resolved
Copy link
Member

@ffromani ffromani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
good enough for now

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 21, 2020
@marcel-apf
Copy link
Contributor Author

/retest

1 similar comment
@cynepco3hahue
Copy link
Contributor

/retest

@coveralls
Copy link

coveralls commented Sep 22, 2020

Pull Request Test Coverage Report for Build 492

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 70.939%

Totals Coverage Status
Change from base Build 485: 0.0%
Covered Lines: 869
Relevant Lines: 1225

💛 - Coveralls

@cynepco3hahue
Copy link
Contributor

@marcel-apf Please fix CI job

export GOROOT=$(go env GOROOT); """_cache"/tools"/"operator-sdk-"v0.18.2"-"x86_64-linux-gnu""" generate k8s
time="2020-09-22T16:10:05Z" level=info msg="Running deepcopy code-generation for Custom Resource group versions: [performance:[v1 v1alpha1], ]\n"
time="2020-09-22T16:10:47Z" level=info msg="Code-generation complete."
Verifying that all code is committed after updating deps and formatting and generating code
hack/verify-generated.sh
uncommitted generated files. run 'make generate' and commit results.
 M functests/utils/pods/pods.go

PAO is meant to run on "control plane".
Use podAffinity to schedule PAO only on master nodes.
(https://docs.openshift.com/container-platform/4.5/nodes/scheduling/nodes-scheduler-pod-affinity.html)
Use taints tolerations to allow PAO scheduling on the master nodes.
(https://docs.openshift.com/container-platform/4.5/nodes/scheduling/nodes-scheduler-taints-tolerations.html)

Update the manifests according to the above.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Straight forward test that checks the node PAO is running on
is a master node.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 23, 2020
@marcel-apf
Copy link
Contributor Author

@marcel-apf Please fix CI job

export GOROOT=$(go env GOROOT); """_cache"/tools"/"operator-sdk-"v0.18.2"-"x86_64-linux-gnu""" generate k8s
time="2020-09-22T16:10:05Z" level=info msg="Running deepcopy code-generation for Custom Resource group versions: [performance:[v1 v1alpha1], ]\n"
time="2020-09-22T16:10:47Z" level=info msg="Code-generation complete."
Verifying that all code is committed after updating deps and formatting and generating code
hack/verify-generated.sh
uncommitted generated files. run 'make generate' and commit results.
 M functests/utils/pods/pods.go

Done, thanks!

Copy link
Member

@ffromani ffromani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 23, 2020
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fromanirh, marcel-apf

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

@marcel-apf
Copy link
Contributor Author

/retest

1 similar comment
@marcel-apf
Copy link
Contributor Author

/retest

@cynepco3hahue
Copy link
Contributor

/cherry-pick release-4.6

@openshift-cherrypick-robot

@cynepco3hahue: once the present PR merges, I will cherry-pick it on top of release-4.6 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.6

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.

@ffromani
Copy link
Member

/override ci/prow/e2e-gcp-operator-upgrade
known issue about dup kernel args

@openshift-ci-robot
Copy link
Collaborator

@fromanirh: Overrode contexts on behalf of fromanirh: ci/prow/e2e-gcp-operator-upgrade

In response to this:

/override ci/prow/e2e-gcp-operator-upgrade
known issue about dup kernel args

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.

@cynepco3hahue
Copy link
Contributor

/retest

@cynepco3hahue
Copy link
Contributor

The single flakiness because of

out=Unable to connect to the server: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

@cynepco3hahue
Copy link
Contributor

/override ci/prow/e2e-gcp

@openshift-ci-robot
Copy link
Collaborator

@cynepco3hahue: Overrode contexts on behalf of cynepco3hahue: ci/prow/e2e-gcp

In response to this:

/override ci/prow/e2e-gcp

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.

@ffromani
Copy link
Member

The single flakiness because of

out=Unable to connect to the server: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

ok, for the record I agree with the evalutation and I was about to override myself. @cynepco3hahue was just faster.

@ffromani
Copy link
Member

/retest

@openshift-ci-robot
Copy link
Collaborator

@marcel-apf: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-gcp 414cb91 link /test e2e-gcp

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.

@cynepco3hahue
Copy link
Contributor

@marcel-apf The failure connects to the functional test under the PR

• Failure [0.012 seconds]
[performance][config] Performance configuration
/go/src/github.com/openshift-kni/performance-addon-operators/functests/0_config/config.go:42
  Should run performance profile pod on a master node [It]
  /go/src/github.com/openshift-kni/performance-addon-operators/functests/0_config/config.go:44
  Failed to find the Performance Addon Operator pod
      
  Unexpected error:
      <*errors.errorString | 0xc00021e7a0>: {
          s: "incorrect performance operator pods count: 0",
      }
      incorrect performance operator pods count: 0
  occurred
  /go/src/github.com/openshift-kni/performance-addon-operators/functests/0_config/config.go:46

@cynepco3hahue
Copy link
Contributor

The new test runs before the deployment of the PAO, so it not surprising that the test fails. I propose to make the check where the PAO pod run as part of the deployment test.

@ffromani
Copy link
Member

The new test runs before the deployment of the PAO, so it not surprising that the test fails. I propose to make the check where the PAO pod run as part of the deployment test.

This means moving the test from the 0_config to the 1_performance suite, right? Because this is what I was thinking, and it's fine for me.

@ffromani ffromani mentioned this pull request Sep 25, 2020
@ffromani
Copy link
Member

The new test runs before the deployment of the PAO, so it not surprising that the test fails. I propose to make the check where the PAO pod run as part of the deployment test.

This means moving the test from the 0_config to the 1_performance suite, right? Because this is what I was thinking, and it's fine for me.

let's see: c61e2d1

I'll take care of this PR and have it merged ASAP.

@MarSik
Copy link
Member

MarSik commented Sep 25, 2020

/retest

@ffromani
Copy link
Member

actually obsoleted because #373 got merged

@marcel-apf
Copy link
Contributor Author

yay!, closing this one

@marcel-apf marcel-apf closed this Sep 25, 2020
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants