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

Add lifecycle and terminationGracePeriodSeconds for daemonset #1674

Closed
wants to merge 7 commits into from

Conversation

jianpingzhangBill
Copy link

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@jianpingzhangBill jianpingzhangBill requested a review from a team as a code owner September 12, 2024 08:31
@CLAassistant
Copy link

CLAassistant commented Sep 12, 2024

CLA assistant check
All committers have signed the CLA.

@mattdurham
Copy link
Collaborator

This feels reasonable but would love people more familiar to give some input @petewall or @captncraig

@@ -57,6 +57,10 @@
scheme: {{ $values.listenScheme }}
initialDelaySeconds: 10
timeoutSeconds: 1
{{- with $values.lifecycle }}
lifecycle:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to set a lifecycle on the Pod spec?

Copy link
Contributor

Choose a reason for hiding this comment

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

% kubectl explain pod.spec.lifecycle
KIND:       Pod
VERSION:    v1

error: field "lifecycle" does not exist

Copy link
Author

Choose a reason for hiding this comment

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

➜ ~ kubectl explain pod.spec.containers.lifecycle
KIND: Pod
VERSION: v1

FIELD: lifecycle

DESCRIPTION:
Actions that the management system should take in response to container
lifecycle events. Cannot be updated.
Lifecycle describes actions that the management system should take in
response to container lifecycle events. For the PostStart and PreStop
lifecycle handlers, management of the container blocks until the action is
complete, unless the container process fails, in which case the handler is
aborted.

FIELDS:
postStart
PostStart is called immediately after a container is created. If the handler
fails, the container is terminated and restarted according to its restart
policy. Other management of the container blocks until the hook completes.
More info:
https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

preStop
PreStop is called immediately before a container is terminated due to an API
request or management event such as liveness/startup probe failure,
preemption, resource contention, etc. The handler is not called if the
container crashes or exits. The Pod's termination grace period countdown
begins before the PreStop hook is executed. Regardless of the outcome of the
handler, the container will eventually terminate within the Pod's
termination grace period (unless delayed by finalizers). Other management of
the container blocks until the hook completes or until the termination grace
period is reached. More info:
https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

operations/helm/charts/alloy/values.yaml Outdated Show resolved Hide resolved
Copy link
Author

@jianpingzhangBill jianpingzhangBill left a comment

Choose a reason for hiding this comment

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

fixed.

@@ -57,6 +57,10 @@
scheme: {{ $values.listenScheme }}
initialDelaySeconds: 10
timeoutSeconds: 1
{{- with $values.lifecycle }}
lifecycle:
Copy link
Author

Choose a reason for hiding this comment

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

➜ ~ kubectl explain pod.spec.containers.lifecycle
KIND: Pod
VERSION: v1

FIELD: lifecycle

DESCRIPTION:
Actions that the management system should take in response to container
lifecycle events. Cannot be updated.
Lifecycle describes actions that the management system should take in
response to container lifecycle events. For the PostStart and PreStop
lifecycle handlers, management of the container blocks until the action is
complete, unless the container process fails, in which case the handler is
aborted.

FIELDS:
postStart
PostStart is called immediately after a container is created. If the handler
fails, the container is terminated and restarted according to its restart
policy. Other management of the container blocks until the hook completes.
More info:
https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

preStop
PreStop is called immediately before a container is terminated due to an API
request or management event such as liveness/startup probe failure,
preemption, resource contention, etc. The handler is not called if the
container crashes or exits. The Pod's termination grace period countdown
begins before the PreStop hook is executed. Regardless of the outcome of the
handler, the container will eventually terminate within the Pod's
termination grace period (unless delayed by finalizers). Other management of
the container blocks until the hook completes or until the termination grace
period is reached. More info:
https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants