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

[on-prem] Bug 2089775: Fix regexp in keepalived script chk_default_ingress.sh #3156

Merged
merged 3 commits into from
Jun 7, 2022

Conversation

nvsmirnov
Copy link
Contributor

Fixes: #3155

- What I did
Changed regexp in template. Really I didn't even try to build MCO, just created machineconfig override to test if it works :-)

- How to verify it
Apply fix on cluster and see if destination file contains correct grep command, and keepalived keeps ingress VIP on same node that runs ingress pod.
Ideally one can check it on cluster that has nodes with IP as described in issue #3155.

- Description for the changelog
Fixed keepalived check for ingress VIP

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 19, 2022

Hi @nvsmirnov. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 19, 2022
@kikisdeliveryservice kikisdeliveryservice changed the title Fix regexp in keepalived script chk_default_ingress.sh [on-prem] Fix regexp in keepalived script chk_default_ingress.sh May 23, 2022
@kikisdeliveryservice
Copy link
Contributor

As noted on the issue, this will need a bugzilla.

@nvsmirnov
Copy link
Contributor Author

Opened bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2089775

@kikisdeliveryservice
Copy link
Contributor

Thanks @nvsmirnov !

@kikisdeliveryservice kikisdeliveryservice changed the title [on-prem] Fix regexp in keepalived script chk_default_ingress.sh [on-prem] Bug 2089775: Fix regexp in keepalived script chk_default_ingress.sh May 24, 2022
@openshift-ci openshift-ci bot added bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels May 24, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 24, 2022

@nvsmirnov: This pull request references Bugzilla bug 2089775, which is invalid:

  • expected the bug to target the "4.11.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

[on-prem] Bug 2089775: Fix regexp in keepalived script chk_default_ingress.sh

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.

@kikisdeliveryservice kikisdeliveryservice added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 24, 2022
@@ -3,4 +3,4 @@ path: "/etc/kubernetes/static-pod-resources/keepalived/scripts/chk_default_ingre
contents:
inline: |
#!/bin/bash
/host/bin/oc --kubeconfig /var/lib/kubelet/kubeconfig get ep -n openshift-ingress router-internal-default -o yaml | grep 'ip:' | grep -q {{`{{.NonVirtualIP}}`}}
/host/bin/oc --kubeconfig /var/lib/kubelet/kubeconfig get ep -n openshift-ingress router-internal-default -o yaml | grep 'ip:' | grep -q '{{`{{.NonVirtualIP}}`}}$'
Copy link
Member

Choose a reason for hiding this comment

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

Can we combine the two greps here so we have correct boundaries at both the start and end of the IP? I accidentally pushed a duplicate fix in #3164 but since you proposed this first I'd prefer to merge it under your PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, of course. Strictly saying, the form with grep still not exact (because dot is special character)
It is better process with jq, I'll figure out soon how it is better to do this with jq filters :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cybertron, I've changed PR so it now uses jq instead of grep, and this should work more precise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

...the only problem is I can't check here if this template will render correctly to destination file.

What I did is checked on real OKD node that this works:

oc --kubeconfig /var/lib/kubelet/kubeconfig get ep -n openshift-ingress router-internal-default -o json | jq -e '.subsets[].addresses | map( select (.ip == "IP_ADDRESS") )[0]'; echo $?

If IP_ADDRESS is in oc output, it sets exit status 0, and non-zero if it is not in output.

@cybertron
Copy link
Member

/ok-to-test

Thanks, I will also pull this down locally so I can poke around the environment after deployment and make sure everything looks to be doing what it's supposed to.

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 26, 2022
@cybertron
Copy link
Member

/test e2e-metal-ipi

@kikisdeliveryservice
Copy link
Contributor

/bugzilla refresh

@openshift-ci openshift-ci bot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels May 26, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 26, 2022

@kikisdeliveryservice: This pull request references Bugzilla bug 2089775, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (vvoronko@redhat.com), skipping review request.

In response to this:

/bugzilla refresh

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.

Copy link
Member

@cybertron cybertron left a comment

Choose a reason for hiding this comment

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

Unfortunately it looks like jq is not available in the keepalived image, which may explain why we didn't use it originally.

Grep should be safe to use in this case if we choose the regex correctly. If a . matched a number incorrectly, then the next . in the IP would not match. Since we know the value here is an IP, we don't have to worry about matching something like 1a1b1c1 to 1.1.1.1 since that would be invalid for the field in the first place.

@nvsmirnov
Copy link
Contributor Author

@cybertron, oh yes. I changed back to one grep, thank you.

Copy link
Member

@mandre mandre left a comment

Choose a reason for hiding this comment

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

The e2e-openstack failure is unrelated and can safely be ignored.
/lgtm
/cherry-pick release-4.10

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 30, 2022
@mandre
Copy link
Member

mandre commented May 30, 2022

/retest

@cybertron
Copy link
Member

/lgtm

Thanks!

@cybertron
Copy link
Member

/test e2e-metal-ipi

Should probably make sure that still works, but this is the version I tested locally so I'm not worried about it.

@sinnykumari
Copy link
Contributor

/retest

Copy link
Contributor

@sinnykumari sinnykumari left a comment

Choose a reason for hiding this comment

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

adding approval, all tests are green.
Please remove hold when ready to merge

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 2, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cybertron, mandre, nvsmirnov, sinnykumari

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 Jun 2, 2022
@cybertron
Copy link
Member

/hold cancel

We have lgtm from multiple platforms and all of the tests are passing. We should be good.

@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 Jun 6, 2022
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 2 against base HEAD f5950ed and 8 for PR HEAD 3645302 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 7, 2022

@nvsmirnov: 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 7f4da90 into openshift:master Jun 7, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 7, 2022

@nvsmirnov: All pull requests linked via external trackers have merged:

Bugzilla bug 2089775 has been moved to the MODIFIED state.

In response to this:

[on-prem] Bug 2089775: Fix regexp in keepalived script chk_default_ingress.sh

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.

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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

keepalived can keep ingress VIP on wrong node under certain circumstances
7 participants