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

[api]ensure sidecar terminates on SIGTERM #606

Conversation

gibizer
Copy link
Contributor

@gibizer gibizer commented Nov 27, 2023

We noticed that nova-api and nova-metadata pods do not immediately terminate on delete as the logging sidecar ignores SIGTERM. This PR adds the usage of dump-init to the sidecar command to ensure it handles SIGTERM properly

Fixes: OSPRH-770

We noticed that nova-api and nova-metadata pods do not immediately
terminate on delete as the logging sidecar ignores SIGTERM. This PR adds
the usage of dump-init to the sidecar command to ensure it handles
SIGTERM properly
Copy link
Contributor

@mrkisaolamb mrkisaolamb left a comment

Choose a reason for hiding this comment

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

lgtm

@gibizer
Copy link
Contributor Author

gibizer commented Nov 27, 2023

# before fix
❯ time oc delete pod nova-metadata-0 --grace-period=30
pod "nova-metadata-0" deleted
oc delete pod nova-metadata-0 --grace-period=30  0.09s user 0.04s system 0% cpu 30.893 total
# after fix
❯ time oc delete pod nova-metadata-0 --grace-period=30
pod "nova-metadata-0" deleted
oc delete pod nova-metadata-0 --grace-period=30  0.08s user 0.02s system 2% cpu 4.023 total

Copy link
Contributor

@karelyatin karelyatin left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@SeanMooney SeanMooney left a comment

Choose a reason for hiding this comment

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

yes this is required

@@ -129,9 +129,16 @@ func StatefulSet(
{
Name: instance.Name + "-log",
Command: []string{
"/bin/bash",
Copy link
Contributor

Choose a reason for hiding this comment

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

so the entrypoint in the kolla contianer is

Entrypoint: "dumb-init --single-child --"

https://github.com/openstack-k8s-operators/tcib/blob/main/container-images/tcib/base/base.yaml#L44C18-L44C45

so i was expecting command to map to docker/podmans command

it would appear that k8s/openshfit is not following the normal rules
for how entrypoint and command interact

https://stackoverflow.com/a/66967227

so when i orgianlly wrote this i was expect it to be wrapped in dumb init already

Copy link
Contributor

openshift-ci bot commented Nov 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gibizer, mrkisaolamb, SeanMooney

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:
  • OWNERS [SeanMooney,gibizer,mrkisaolamb]

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

Copy link
Contributor

@bogdando bogdando 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-merge-bot openshift-merge-bot bot merged commit cee3fe0 into openstack-k8s-operators:main Nov 27, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants