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

Remove -sf 7 from haproxy image entrypoint #3264

Merged

Conversation

killianmuldoon
Copy link
Contributor

Remove -sf 7 from the haproxy entrypoint. This arg caused an issue in the Cluster API e2e tests causing the load balancer to exit prematurely. More info on the CAPI issue: kubernetes-sigs/cluster-api#8641

Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 5, 2023
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 5, 2023
@@ -62,4 +62,4 @@ COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg

# below roughly matches the standard haproxy image
STOPSIGNAL SIGUSR1
ENTRYPOINT ["haproxy", "-sf", "7", "-W", "-db", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
ENTRYPOINT ["haproxy", "-W", "-db", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternative we could just make the change to remove the 7 and leave the -sf arg. The -W arg is enough to enable workers to spin up when the config is updated, however, and this matches the fix in CAPI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

a couple of questions.

i don't remember how HA works in kind with haproxy.

if the haproxy config is prepared in advance post parsing the user node config and not iterated on each time a new CP node is added, wouldn't that mean that the -sf and -W flags are not needed - i.e. no dynamic reconfig?

else, if kind plans to support dynamic topology ALA 'kind add node', then it makes sense to keep these?

also, reading the docs, i do not understand the diff between -sf with and without a pid. what is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if the haproxy config is prepared in advance post parsing the user node config and not iterated on each time a new CP node is added, wouldn't that mean that the -sf and -W flags are not needed - i.e. no dynamic reconfig?

This I'm not sure about - but my assumption is you need to load the config twice - once to startup haproxy with the valid config, and a second time to update the existing config with control plane endpoints so a reload would be needed at that point.

also, reading the docs, i do not understand the diff between -sf with and without a pid. what is it?

Sorry - I misremembered the config. You need to do something like the below to get the pid dynamically:

haproxy -f /etc/haproxy.cfg -D -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)

Copy link
Contributor

Choose a reason for hiding this comment

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

we don't really use -sf https://docs.haproxy.org/2.2/management.html , and having it harcoded to a number sounds even more suspicious that this was an oversight.

Kind just create the config in the container and send a HUP signal

if err := loadBalancerNode.Command("kill", "-s", "HUP", "1").Run(); err != nil {

but is not dynamically reconfigured, so this lgtm

Copy link
Contributor

Choose a reason for hiding this comment

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

interestingly -db does not look like something recommended in production @BenTheElder 😄

-db : disable background mode and multi-process mode. The process remains in
foreground. It is mainly used during development or during small tests, as
Ctrl-C is enough to stop the process. Never use it in an init script.

@killianmuldoon
Copy link
Contributor Author

/retest

@stmcginnis
Copy link
Contributor

/lgtm

Makes sense!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 5, 2023
@aojea
Copy link
Contributor

aojea commented Jun 5, 2023

/approve

Thanks for following up and explain all the tests you have done and the conclusions

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, killianmuldoon

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2023
@k8s-ci-robot k8s-ci-robot merged commit 42a2262 into kubernetes-sigs:main Jun 6, 2023
20 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants