Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion api/v1/webspherelibertyapplication_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type WebSphereLibertyApplicationSpec struct {
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`

// +operator-sdk:csv:customresourcedefinitions:order=15,type=spec,displayName="Probes"
Probes *WebSphereLibertyApplicationProbes `json:"probes,omitempty"`
Probes *WebSphereLibertyApplicationProbesConfig `json:"probes,omitempty"`

// +operator-sdk:csv:customresourcedefinitions:order=16,type=spec,displayName="Deployment"
Deployment *WebSphereLibertyApplicationDeployment `json:"deployment,omitempty"`
Expand Down Expand Up @@ -289,6 +289,26 @@ type WebSphereLibertyApplicationServiceAccount struct {
SkipPullSecretValidation *bool `json:"skipPullSecretValidation,omitempty"`
}

type WebSphereLibertyApplicationProbesConfig struct {
WebSphereLibertyApplicationProbes `json:",inline"`

// Inspects the container filesystem to return health checks based upon files generated by the Liberty runtime. Only supported on Liberty version 25.0.0.6-beta or higher.
// +operator-sdk:csv:customresourcedefinitions:order=100,type=spec,displayName="Enable File Based",xDescriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
EnableFileBased *bool `json:"enableFileBased,omitempty"`

// The Liberty container directory used to track file-based health checks for the 'live', 'ready', and 'started' files. Only used when .spec.probes.enableFiledBased is set to true. Defaults to /output/health.
// +operator-sdk:csv:customresourcedefinitions:order=101,type=spec,displayName="File Directory",xDescriptors="urn:alm:descriptor:com.tectonic.ui:text"
FileDirectory *string `json:"fileDirectory,omitempty"`

// The interval at which the Liberty runtime queries to update the file-based health check files. The value is a number followed by an optional time unit of ms for milliseconds or s for seconds. Only used when .spec.probes.enableFiledBased is set to true. Defaults to 5s.
// +operator-sdk:csv:customresourcedefinitions:order=102,type=spec,displayName="Check Interval",xDescriptors="urn:alm:descriptor:com.tectonic.ui:text"
CheckInterval *string `json:"checkInterval,omitempty"`

// The interval at which the Liberty runtime will query until an UP status is resolved and the health check file is created. The value is a number followed by an optional time unit of ms for milliseconds or s for seconds. If no time unit is specified for a value, the value is in milliseconds by default. Only used when .spec.probes.enableFiledBased is set to true. Defaults to 100ms.
// +operator-sdk:csv:customresourcedefinitions:order=103,type=spec,displayName="Startup Check Interval",xDescriptors="urn:alm:descriptor:com.tectonic.ui:text"
StartupCheckInterval *string `json:"startupCheckInterval,omitempty"`
}

// Define health checks on application container to determine whether it is alive or ready to receive traffic
type WebSphereLibertyApplicationProbes struct {
// Periodic probe of container liveness. Container will be restarted if the probe fails.
Expand Down
28 changes: 27 additions & 1 deletion api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ metadata:
capabilities: Auto Pilot
categories: Application Runtime
containerImage: icr.io/cpopen/websphere-liberty-operator:daily
createdAt: "2025-09-08T02:59:31Z"
createdAt: "2025-10-02T17:16:23Z"
description: Deploy and manage containerized Liberty applications
features.operators.openshift.io/disconnected: "true"
olm.skipRange: '>=1.0.0 <1.5.0'
Expand Down Expand Up @@ -612,6 +612,13 @@ spec:
Application Server Network Deployment'
displayName: Edition
path: license.edition
- description: Inspects the container filesystem to return health checks based
upon files generated by the Liberty runtime. Only supported on Liberty version
25.0.0.6-beta or higher.
displayName: Enable File Based
path: probes.enableFileBased
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: 'Entitlement source for the product. Defaults to Standalone.
Other options: IBM Enterprise Application Runtimes, IBM Cloud Pak for Applications
Advanced, IBM Cloud Pak for Applications Standard, IBM WebSphere Hybrid
Expand All @@ -620,19 +627,44 @@ spec:
Standard instead.'
displayName: Product Entitlement Source
path: license.productEntitlementSource
- description: The Liberty container directory used to track file-based health
checks for the 'live', 'ready', and 'started' files. Only used when .spec.probes.enableFiledBased
is set to true. Defaults to /output/health.
displayName: File Directory
path: probes.fileDirectory
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: Deprecated. Charge metric code is now automatically determined
based on the specified product edition and entitlement source.
displayName: Metric
path: license.metric
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: The interval at which the Liberty runtime queries to update the
file-based health check files. The value is a number followed by an optional
time unit of ms for milliseconds or s for seconds. Only used when .spec.probes.enableFiledBased
is set to true. Defaults to 5s.
displayName: Check Interval
path: probes.checkInterval
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: |-
I represent that the software in the above-referenced application container includes the IBM Program referenced below and I accept the terms of the license agreement corresponding
to the version of IBM Program in the application container by setting this value to true. See https://ibm.biz/was-license for the license agreements applicable to this IBM Program
displayName: Accept License
path: license.accept
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:checkbox
- description: The interval at which the Liberty runtime will query until an
UP status is resolved and the health check file is created. The value is
a number followed by an optional time unit of ms for milliseconds or s for
seconds. If no time unit is specified for a value, the value is in milliseconds
by default. Only used when .spec.probes.enableFiledBased is set to true.
Defaults to 100ms.
displayName: Startup Check Interval
path: probes.startupCheckInterval
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: Determines whether the access token that is provided in the request
is used for authentication.
displayName: Access Token Required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4403,9 +4403,25 @@ spec:
type: object
type: object
probes:
description: Define health checks on application container to determine
whether it is alive or ready to receive traffic
properties:
checkInterval:
description: The interval at which the Liberty runtime queries
to update the file-based health check files. The value is a
number followed by an optional time unit of ms for milliseconds
or s for seconds. Only used when .spec.probes.enableFiledBased
is set to true. Defaults to 5s.
type: string
enableFileBased:
description: Inspects the container filesystem to return health
checks based upon files generated by the Liberty runtime. Only
supported on Liberty version 25.0.0.6-beta or higher.
type: boolean
fileDirectory:
description: The Liberty container directory used to track file-based
health checks for the 'live', 'ready', and 'started' files.
Only used when .spec.probes.enableFiledBased is set to true.
Defaults to /output/health.
type: string
liveness:
description: Periodic probe of container liveness. Container will
be restarted if the probe fails.
Expand Down Expand Up @@ -4866,6 +4882,15 @@ spec:
format: int32
type: integer
type: object
startupCheckInterval:
description: The interval at which the Liberty runtime will query
until an UP status is resolved and the health check file is
created. The value is a number followed by an optional time
unit of ms for milliseconds or s for seconds. If no time unit
is specified for a value, the value is in milliseconds by default.
Only used when .spec.probes.enableFiledBased is set to true.
Defaults to 100ms.
type: string
type: object
pullPolicy:
description: Policy for pulling container images. Defaults to IfNotPresent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4399,9 +4399,25 @@ spec:
type: object
type: object
probes:
description: Define health checks on application container to determine
whether it is alive or ready to receive traffic
properties:
checkInterval:
description: The interval at which the Liberty runtime queries
to update the file-based health check files. The value is a
number followed by an optional time unit of ms for milliseconds
or s for seconds. Only used when .spec.probes.enableFiledBased
is set to true. Defaults to 5s.
type: string
enableFileBased:
description: Inspects the container filesystem to return health
checks based upon files generated by the Liberty runtime. Only
supported on Liberty version 25.0.0.6-beta or higher.
type: boolean
fileDirectory:
description: The Liberty container directory used to track file-based
health checks for the 'live', 'ready', and 'started' files.
Only used when .spec.probes.enableFiledBased is set to true.
Defaults to /output/health.
type: string
liveness:
description: Periodic probe of container liveness. Container will
be restarted if the probe fails.
Expand Down Expand Up @@ -4862,6 +4878,15 @@ spec:
format: int32
type: integer
type: object
startupCheckInterval:
description: The interval at which the Liberty runtime will query
until an UP status is resolved and the health check file is
created. The value is a number followed by an optional time
unit of ms for milliseconds or s for seconds. If no time unit
is specified for a value, the value is in milliseconds by default.
Only used when .spec.probes.enableFiledBased is set to true.
Defaults to 100ms.
type: string
type: object
pullPolicy:
description: Policy for pulling container images. Defaults to IfNotPresent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@ spec:
Application Server Network Deployment'
displayName: Edition
path: license.edition
- description: Inspects the container filesystem to return health checks based
upon files generated by the Liberty runtime. Only supported on Liberty version
25.0.0.6-beta or higher.
displayName: Enable File Based
path: probes.enableFileBased
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: 'Entitlement source for the product. Defaults to Standalone.
Other options: IBM Enterprise Application Runtimes, IBM Cloud Pak for Applications
Advanced, IBM Cloud Pak for Applications Standard, IBM WebSphere Hybrid
Expand All @@ -556,19 +563,44 @@ spec:
Standard instead.'
displayName: Product Entitlement Source
path: license.productEntitlementSource
- description: The Liberty container directory used to track file-based health
checks for the 'live', 'ready', and 'started' files. Only used when .spec.probes.enableFiledBased
is set to true. Defaults to /output/health.
displayName: File Directory
path: probes.fileDirectory
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: Deprecated. Charge metric code is now automatically determined
based on the specified product edition and entitlement source.
displayName: Metric
path: license.metric
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: The interval at which the Liberty runtime queries to update the
file-based health check files. The value is a number followed by an optional
time unit of ms for milliseconds or s for seconds. Only used when .spec.probes.enableFiledBased
is set to true. Defaults to 5s.
displayName: Check Interval
path: probes.checkInterval
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: |-
I represent that the software in the above-referenced application container includes the IBM Program referenced below and I accept the terms of the license agreement corresponding
to the version of IBM Program in the application container by setting this value to true. See https://ibm.biz/was-license for the license agreements applicable to this IBM Program
displayName: Accept License
path: license.accept
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:checkbox
- description: The interval at which the Liberty runtime will query until an
UP status is resolved and the health check file is created. The value is
a number followed by an optional time unit of ms for milliseconds or s for
seconds. If no time unit is specified for a value, the value is in milliseconds
by default. Only used when .spec.probes.enableFiledBased is set to true.
Defaults to 100ms.
displayName: Startup Check Interval
path: probes.startupCheckInterval
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: Determines whether the access token that is provided in the request
is used for authentication.
displayName: Access Token Required
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25

require (
github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20250905223351-5f5935cfd434
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20250902185901-28fab0958c43
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20250924191244-78a168608ead
github.com/cert-manager/cert-manager v1.16.5
github.com/go-logr/logr v1.4.2
github.com/openshift/api v0.0.0-20230928134114-673ed0cfc7f1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20250905223351-5f5935cfd43
github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20250905223351-5f5935cfd434/go.mod h1:WQFReKJqTX+dE6TkzFF+CqjR7EeS0UMCg7a8/UVlrn8=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20250902185901-28fab0958c43 h1:LKDWp8yhFzvnqKjPCzbPi/VzQAG6nj4wFnS7zD27lOs=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20250902185901-28fab0958c43/go.mod h1:Hs5AbE9J+rLM34IAc75X7dtxnrzFg2AvG1XYLcX/ApU=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20250924191244-78a168608ead h1:/bnhC3edZUrByFy+NCh4P+Y6Nhk3D1Q5hoM7c80ECtM=
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20250924191244-78a168608ead/go.mod h1:Hs5AbE9J+rLM34IAc75X7dtxnrzFg2AvG1XYLcX/ApU=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down
2 changes: 2 additions & 0 deletions internal/controller/webspherelibertyapplication_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ func (r *ReconcileWebSphereLiberty) Reconcile(ctx context.Context, request ctrl.
statefulSet := &appsv1.StatefulSet{ObjectMeta: defaultMeta}
err = r.CreateOrUpdate(statefulSet, instance, func() error {
oputils.CustomizeStatefulSet(statefulSet, instance)
lutils.CustomizeFileBasedProbes(&statefulSet.Spec.Template, instance)
oputils.CustomizePodSpec(&statefulSet.Spec.Template, instance)
oputils.CustomizePersistence(statefulSet, instance)
if err := lutils.CustomizeLibertyEnv(&statefulSet.Spec.Template, instance, r.GetClient()); err != nil {
Expand Down Expand Up @@ -646,6 +647,7 @@ func (r *ReconcileWebSphereLiberty) Reconcile(ctx context.Context, request ctrl.
deploy := &appsv1.Deployment{ObjectMeta: defaultMeta}
err = r.CreateOrUpdate(deploy, instance, func() error {
oputils.CustomizeDeployment(deploy, instance)
lutils.CustomizeFileBasedProbes(&deploy.Spec.Template, instance)
oputils.CustomizePodSpec(&deploy.Spec.Template, instance)
if err := lutils.CustomizeLibertyEnv(&deploy.Spec.Template, instance, r.GetClient()); err != nil {
reqLogger.Error(err, "Failed to reconcile Liberty env, error: "+err.Error())
Expand Down
Loading