Skip to content

Managing OpenLibertyApplication pod termination #885

Description

@hhue13

How can we quiesce a running pod of an OpenLibertyApplication deployment.

We have a requirement to control the pod termination sequence of our OpenLibertyApplication pod. I.e. when a pod termination is initiated (no matter for which reason) we want to make sure that:

  • no new requests are accepted
  • the running requests have time to reach a commit boundary and finish processing

Question

What did you do?

As per the Kubernetes documentation Pod Termination Flow there are two attributes in the pod spec to control the pod termination sequence namely:

  • terminationGracePeriodSeconds
  • lifeCycle.preStop

What did you expect to see?

We are seeking for an OpenLibertyApplication specification to specify the lifeCycle.preStop and the terminationGracePeriodSeconds for the app Container running the application.
The idea is that we tell the application running in the JVM via a curl request sent via the preStop hook that the pod is about to terminate. As the default for terminationGracePeriodSeconds of 30s is too short we'd need to increase this value as well.

What did you see instead? Under which circumstances?

Investigating the CRD OpenLibertyApplication shows that there are specification attributes for

  • terminationGracePeriodSeconds
  • lifeCycle.preStop

however only for sidecarContainers and initContainers provide these attributes (and for the specific probes the terminationGracePeriodSeconds can be specified as well). But I could not find any way to specify terminationGracePeriodSeconds and lifeCycle.preStop.

Environment

  • Kubernetes version information:

kubectl version
Client Version: v1.32.2
Kustomize Version: v5.5.0
Server Version: v1.33.11

  • OpenShift version information (if applicable):

oc version
Client Version: 4.16.0-202411190033.p0.gcf533b5.assembly.stream.el9-cf533b5
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: 4.20.23
Kubernetes Version: v1.33.11`

  • Appsody CLI version (if applicable):
  • Appsody Stack (if applicable):

Additional context

Currently installed version of the OpenLibertyApplicatoin is 1.6.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions