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

Monitor - delete iptable rule if API not reachable through Haproxy #14

Merged
merged 1 commit into from Aug 9, 2019
Merged

Monitor - delete iptable rule if API not reachable through Haproxy #14

merged 1 commit into from Aug 9, 2019

Conversation

yboaron
Copy link
Contributor

@yboaron yboaron commented Aug 1, 2019

If Haproxy went down for some reason, the Iptable rule that
redirects API traffic to Haproxy LB, should be removed.

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 1, 2019
@celebdor
Copy link
Contributor

celebdor commented Aug 2, 2019

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 2, 2019
@celebdor celebdor requested review from bcrochet and removed request for cybertron August 2, 2019 08:36
@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 5, 2019
@@ -144,16 +146,21 @@ func Monitor(clusterName, clusterDomain, templatePath, cfgPath, apiVip string, a

ok, err := utils.IsKubernetesHealthy(lbPort)
if err == nil && ok {
log.Info("API reachable through HAProxy")
if k8sIsHealthy == false {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if k8sIsHealthy == false {
if ! k8sIsHealthy {

err := ensureHAProxyPreRoutingRule(apiVip, apiPort, lbPort)
if err != nil {
log.WithFields(logrus.Fields{"err": err}).Error("Failed to ensure HAProxy PREROUTING rule to direct traffic to the LB")
}
} else {
log.Info("API still not reachable through HAProxy")
cleanHAProxyPreRoutingRule(apiVip, apiPort, lbPort)
if k8sIsHealthy == true {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if k8sIsHealthy == true {
if k8sIsHealthy {

@openshift-ci-robot openshift-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 7, 2019
If Haproxy went down for some reason, the Iptable rule that
redirects API traffic to Haproxy LB, should be removed.

This change also updates logging to report LB status only upon a change
instead of reporting the current status every 15 seconds.
@yboaron yboaron requested a review from celebdor August 8, 2019 07:51
@celebdor
Copy link
Contributor

celebdor commented Aug 9, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 9, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bcrochet, celebdor, yboaron

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 9, 2019
@openshift-merge-robot openshift-merge-robot merged commit 18a721f into openshift:master Aug 9, 2019
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants