From e1b7bc41580bdb926cb01463defdd5b0612f7496 Mon Sep 17 00:00:00 2001 From: kabicin Date: Thu, 27 Jul 2023 09:59:55 -0400 Subject: [PATCH 1/4] Patch probe defaults with port and scheme based on manageTLS --- api/v1/openlibertyapplication_types.go | 49 ++++++++-- api/v1/zz_generated.deepcopy.go | 6 +- api/v1beta2/openlibertyapplication_types.go | 30 +++++-- api/v1beta2/zz_generated.deepcopy.go | 7 +- ...penliberty.io_openlibertyapplications.yaml | 90 +++++++------------ 5 files changed, 98 insertions(+), 84 deletions(-) diff --git a/api/v1/openlibertyapplication_types.go b/api/v1/openlibertyapplication_types.go index d562aef2f..4c9bdc748 100644 --- a/api/v1/openlibertyapplication_types.go +++ b/api/v1/openlibertyapplication_types.go @@ -175,15 +175,15 @@ type OpenLibertyApplicationServiceAccount struct { type OpenLibertyApplicationProbes struct { // Periodic probe of container liveness. Container will be restarted if the probe fails. // +operator-sdk:csv:customresourcedefinitions:order=49,type=spec,displayName="Liveness Probe" - Liveness *corev1.Probe `json:"liveness,omitempty"` + Liveness *common.BaseComponentProbe `json:"liveness,omitempty"` // Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. // +operator-sdk:csv:customresourcedefinitions:order=50,type=spec,displayName="Readiness Probe" - Readiness *corev1.Probe `json:"readiness,omitempty"` + Readiness *common.BaseComponentProbe `json:"readiness,omitempty"` // Probe to determine successful initialization. If specified, other probes are not executed until this completes successfully. // +operator-sdk:csv:customresourcedefinitions:order=51,type=spec,displayName="Startup Probe" - Startup *corev1.Probe `json:"startup,omitempty"` + Startup *common.BaseComponentProbe `json:"startup,omitempty"` } // Configure pods to run on particular Nodes. @@ -697,32 +697,63 @@ func (cr *OpenLibertyApplication) GetProbes() common.BaseComponentProbes { } // GetLivenessProbe returns liveness probe -func (p *OpenLibertyApplicationProbes) GetLivenessProbe() *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetLivenessProbe() *common.BaseComponentProbe { return p.Liveness } // GetReadinessProbe returns readiness probe -func (p *OpenLibertyApplicationProbes) GetReadinessProbe() *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetReadinessProbe() *common.BaseComponentProbe { return p.Readiness } // GetStartupProbe returns startup probe -func (p *OpenLibertyApplicationProbes) GetStartupProbe() *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetStartupProbe() *common.BaseComponentProbe { return p.Startup } +func (p *OpenLibertyApplicationProbes) PatchLivenessProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { + return patchLibertyProbe(ba, probe) +} + +func (p *OpenLibertyApplicationProbes) PatchReadinessProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { + return patchLibertyProbe(ba, probe) +} + +func (p *OpenLibertyApplicationProbes) PatchStartupProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { + return patchLibertyProbe(ba, probe) +} + +func patchLibertyProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { + if probe != nil { + manageTLSEnabled := ba.GetManageTLS() == nil || *ba.GetManageTLS() + if probe.BaseComponentProbeHandler.HTTPGet != nil { + if manageTLSEnabled { + probe.BaseComponentProbeHandler.HTTPGet.Scheme = "HTTPS" + } else { + probe.BaseComponentProbeHandler.HTTPGet.Scheme = "HTTP" + } + portValue := ba.GetService().GetPort() + if portValue != 0 { + port := intstr.FromInt(int(portValue)) + probe.BaseComponentProbeHandler.HTTPGet.Port = &port + } + } + } + return probe +} + // GetDefaultLivenessProbe returns default values for liveness probe -func (p *OpenLibertyApplicationProbes) GetDefaultLivenessProbe(ba common.BaseComponent) *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetDefaultLivenessProbe(ba common.BaseComponent) *common.BaseComponentProbe { return common.GetDefaultMicroProfileLivenessProbe(ba) } // GetDefaultReadinessProbe returns default values for readiness probe -func (p *OpenLibertyApplicationProbes) GetDefaultReadinessProbe(ba common.BaseComponent) *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetDefaultReadinessProbe(ba common.BaseComponent) *common.BaseComponentProbe { return common.GetDefaultMicroProfileReadinessProbe(ba) } // GetDefaultStartupProbe returns default values for startup probe -func (p *OpenLibertyApplicationProbes) GetDefaultStartupProbe(ba common.BaseComponent) *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetDefaultStartupProbe(ba common.BaseComponent) *common.BaseComponentProbe { return common.GetDefaultMicroProfileStartupProbe(ba) } diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index ed1f24dc9..c73702c78 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -361,17 +361,17 @@ func (in *OpenLibertyApplicationProbes) DeepCopyInto(out *OpenLibertyApplication *out = *in if in.Liveness != nil { in, out := &in.Liveness, &out.Liveness - *out = new(corev1.Probe) + *out = new(common.BaseComponentProbe) (*in).DeepCopyInto(*out) } if in.Readiness != nil { in, out := &in.Readiness, &out.Readiness - *out = new(corev1.Probe) + *out = new(common.BaseComponentProbe) (*in).DeepCopyInto(*out) } if in.Startup != nil { in, out := &in.Startup, &out.Startup - *out = new(corev1.Probe) + *out = new(common.BaseComponentProbe) (*in).DeepCopyInto(*out) } } diff --git a/api/v1beta2/openlibertyapplication_types.go b/api/v1beta2/openlibertyapplication_types.go index efa0a4f27..8fbfcfad9 100644 --- a/api/v1beta2/openlibertyapplication_types.go +++ b/api/v1beta2/openlibertyapplication_types.go @@ -126,26 +126,38 @@ type OpenLibertyApplicationSpec struct { type OpenLibertyApplicationProbes struct { // Periodic probe of container liveness. Container will be restarted if the probe fails. // +operator-sdk:csv:customresourcedefinitions:order=49,type=spec,displayName="Liveness Probe" - Liveness *corev1.Probe `json:"liveness,omitempty"` + Liveness *common.BaseComponentProbe `json:"liveness,omitempty"` // Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. // +operator-sdk:csv:customresourcedefinitions:order=50,type=spec,displayName="Readiness Probe" - Readiness *corev1.Probe `json:"readiness,omitempty"` + Readiness *common.BaseComponentProbe `json:"readiness,omitempty"` // Probe to determine successful initialization. If specified, other probes are not executed until this completes successfully. // +operator-sdk:csv:customresourcedefinitions:order=51,type=spec,displayName="Startup Probe" - Startup *corev1.Probe `json:"startup,omitempty"` + Startup *common.BaseComponentProbe `json:"startup,omitempty"` } -func (p *OpenLibertyApplicationProbes) GetDefaultLivenessProbe(common.BaseComponent) *corev1.Probe { +func (p *OpenLibertyApplicationProbes) PatchLivenessProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { + return probe +} + +func (p *OpenLibertyApplicationProbes) PatchReadinessProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { + return probe +} + +func (p *OpenLibertyApplicationProbes) PatchStartupProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { + return probe +} + +func (p *OpenLibertyApplicationProbes) GetDefaultLivenessProbe(common.BaseComponent) *common.BaseComponentProbe { return nil } -func (p *OpenLibertyApplicationProbes) GetDefaultReadinessProbe(common.BaseComponent) *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetDefaultReadinessProbe(common.BaseComponent) *common.BaseComponentProbe { return nil } -func (p *OpenLibertyApplicationProbes) GetDefaultStartupProbe(common.BaseComponent) *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetDefaultStartupProbe(common.BaseComponent) *common.BaseComponentProbe { return nil } @@ -538,17 +550,17 @@ func (cr *OpenLibertyApplication) GetProbes() common.BaseComponentProbes { } // GetLivenessProbe returns liveness probe -func (p *OpenLibertyApplicationProbes) GetLivenessProbe() *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetLivenessProbe() *common.BaseComponentProbe { return p.Liveness } // GetReadinessProbe returns readiness probe -func (p *OpenLibertyApplicationProbes) GetReadinessProbe() *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetReadinessProbe() *common.BaseComponentProbe { return p.Readiness } // GetStartupProbe returns startup probe -func (p *OpenLibertyApplicationProbes) GetStartupProbe() *corev1.Probe { +func (p *OpenLibertyApplicationProbes) GetStartupProbe() *common.BaseComponentProbe { return p.Startup } diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index 5ae11ad91..85e1cd998 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -22,6 +22,7 @@ limitations under the License. package v1beta2 import ( + "github.com/application-stacks/runtime-component-operator/common" routev1 "github.com/openshift/api/route/v1" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" appsv1 "k8s.io/api/apps/v1" @@ -281,17 +282,17 @@ func (in *OpenLibertyApplicationProbes) DeepCopyInto(out *OpenLibertyApplication *out = *in if in.Liveness != nil { in, out := &in.Liveness, &out.Liveness - *out = new(v1.Probe) + *out = new(common.BaseComponentProbe) (*in).DeepCopyInto(*out) } if in.Readiness != nil { in, out := &in.Readiness, &out.Readiness - *out = new(v1.Probe) + *out = new(common.BaseComponentProbe) (*in).DeepCopyInto(*out) } if in.Startup != nil { in, out := &in.Startup, &out.Startup - *out = new(v1.Probe) + *out = new(common.BaseComponentProbe) (*in).DeepCopyInto(*out) } } diff --git a/config/crd/bases/apps.openliberty.io_openlibertyapplications.yaml b/config/crd/bases/apps.openliberty.io_openlibertyapplications.yaml index 10980545d..7e4e06be6 100644 --- a/config/crd/bases/apps.openliberty.io_openlibertyapplications.yaml +++ b/config/crd/bases/apps.openliberty.io_openlibertyapplications.yaml @@ -3079,7 +3079,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - 3. Minimum value is 1. + nil. format: int32 type: integer grpc: @@ -3144,8 +3144,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -3154,14 +3152,13 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + Defaults to nil. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - 1. Must be 1 for liveness and startup. Minimum value is - 1. + nil. format: int32 type: integer tcpSocket: @@ -3196,14 +3193,12 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is - used if unset. + Defaults to nil format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -3230,7 +3225,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - 3. Minimum value is 1. + nil. format: int32 type: integer grpc: @@ -3295,8 +3290,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -3305,14 +3298,13 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + Defaults to nil. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - 1. Must be 1 for liveness and startup. Minimum value is - 1. + nil. format: int32 type: integer tcpSocket: @@ -3347,14 +3339,12 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is - used if unset. + Defaults to nil format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -3382,7 +3372,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - 3. Minimum value is 1. + nil. format: int32 type: integer grpc: @@ -3447,8 +3437,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -3457,14 +3445,13 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + Defaults to nil. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - 1. Must be 1 for liveness and startup. Minimum value is - 1. + nil. format: int32 type: integer tcpSocket: @@ -3499,14 +3486,12 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is - used if unset. + Defaults to nil format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -10681,7 +10666,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - 3. Minimum value is 1. + nil. format: int32 type: integer grpc: @@ -10746,8 +10731,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -10756,14 +10739,13 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + Defaults to nil. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - 1. Must be 1 for liveness and startup. Minimum value is - 1. + nil. format: int32 type: integer tcpSocket: @@ -10798,14 +10780,12 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is - used if unset. + Defaults to nil format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -10832,7 +10812,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - 3. Minimum value is 1. + nil. format: int32 type: integer grpc: @@ -10897,8 +10877,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -10907,14 +10885,13 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + Defaults to nil. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - 1. Must be 1 for liveness and startup. Minimum value is - 1. + nil. format: int32 type: integer tcpSocket: @@ -10949,14 +10926,12 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is - used if unset. + Defaults to nil format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -10984,7 +10959,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - 3. Minimum value is 1. + nil. format: int32 type: integer grpc: @@ -11049,8 +11024,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -11059,14 +11032,13 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + Defaults to nil. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - 1. Must be 1 for liveness and startup. Minimum value is - 1. + nil. format: int32 type: integer tcpSocket: @@ -11101,14 +11073,12 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is - used if unset. + Defaults to nil format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to 1 second. Minimum value is 1. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object From 338e4440175ff0a9f026c3d363be75e42d30edf0 Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Thu, 16 May 2024 08:27:53 -0400 Subject: [PATCH 2/4] Remove probe patch functions --- api/v1/openlibertyapplication_types.go | 31 ------- api/v1beta2/openlibertyapplication_types.go | 32 +++---- api/v1beta2/zz_generated.deepcopy.go | 7 +- ...penliberty.io_openlibertyapplications.yaml | 6 -- .../open-liberty.clusterserviceversion.yaml | 2 +- ...penliberty.io_openlibertyapplications.yaml | 84 ++++++++++++------- go.mod | 2 +- go.sum | 4 + .../deploy/kubectl/openliberty-app-crd.yaml | 6 -- .../daily/base/open-liberty-crd.yaml | 6 -- 10 files changed, 73 insertions(+), 107 deletions(-) diff --git a/api/v1/openlibertyapplication_types.go b/api/v1/openlibertyapplication_types.go index 4c9bdc748..8da66c793 100644 --- a/api/v1/openlibertyapplication_types.go +++ b/api/v1/openlibertyapplication_types.go @@ -711,37 +711,6 @@ func (p *OpenLibertyApplicationProbes) GetStartupProbe() *common.BaseComponentPr return p.Startup } -func (p *OpenLibertyApplicationProbes) PatchLivenessProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { - return patchLibertyProbe(ba, probe) -} - -func (p *OpenLibertyApplicationProbes) PatchReadinessProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { - return patchLibertyProbe(ba, probe) -} - -func (p *OpenLibertyApplicationProbes) PatchStartupProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { - return patchLibertyProbe(ba, probe) -} - -func patchLibertyProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { - if probe != nil { - manageTLSEnabled := ba.GetManageTLS() == nil || *ba.GetManageTLS() - if probe.BaseComponentProbeHandler.HTTPGet != nil { - if manageTLSEnabled { - probe.BaseComponentProbeHandler.HTTPGet.Scheme = "HTTPS" - } else { - probe.BaseComponentProbeHandler.HTTPGet.Scheme = "HTTP" - } - portValue := ba.GetService().GetPort() - if portValue != 0 { - port := intstr.FromInt(int(portValue)) - probe.BaseComponentProbeHandler.HTTPGet.Port = &port - } - } - } - return probe -} - // GetDefaultLivenessProbe returns default values for liveness probe func (p *OpenLibertyApplicationProbes) GetDefaultLivenessProbe(ba common.BaseComponent) *common.BaseComponentProbe { return common.GetDefaultMicroProfileLivenessProbe(ba) diff --git a/api/v1beta2/openlibertyapplication_types.go b/api/v1beta2/openlibertyapplication_types.go index 8fbfcfad9..b21f04c6c 100644 --- a/api/v1beta2/openlibertyapplication_types.go +++ b/api/v1beta2/openlibertyapplication_types.go @@ -3,7 +3,7 @@ package v1beta2 import ( "time" - "github.com/application-stacks/runtime-component-operator/common" + common "github.com/application-stacks/runtime-component-operator/common_v1beta2" routev1 "github.com/openshift/api/route/v1" prometheusv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" appsv1 "k8s.io/api/apps/v1" @@ -126,38 +126,26 @@ type OpenLibertyApplicationSpec struct { type OpenLibertyApplicationProbes struct { // Periodic probe of container liveness. Container will be restarted if the probe fails. // +operator-sdk:csv:customresourcedefinitions:order=49,type=spec,displayName="Liveness Probe" - Liveness *common.BaseComponentProbe `json:"liveness,omitempty"` + Liveness *corev1.Probe `json:"liveness,omitempty"` // Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. // +operator-sdk:csv:customresourcedefinitions:order=50,type=spec,displayName="Readiness Probe" - Readiness *common.BaseComponentProbe `json:"readiness,omitempty"` + Readiness *corev1.Probe `json:"readiness,omitempty"` // Probe to determine successful initialization. If specified, other probes are not executed until this completes successfully. // +operator-sdk:csv:customresourcedefinitions:order=51,type=spec,displayName="Startup Probe" - Startup *common.BaseComponentProbe `json:"startup,omitempty"` + Startup *corev1.Probe `json:"startup,omitempty"` } -func (p *OpenLibertyApplicationProbes) PatchLivenessProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { - return probe -} - -func (p *OpenLibertyApplicationProbes) PatchReadinessProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { - return probe -} - -func (p *OpenLibertyApplicationProbes) PatchStartupProbe(ba common.BaseComponent, probe *common.BaseComponentProbe) *common.BaseComponentProbe { - return probe -} - -func (p *OpenLibertyApplicationProbes) GetDefaultLivenessProbe(common.BaseComponent) *common.BaseComponentProbe { +func (p *OpenLibertyApplicationProbes) GetDefaultLivenessProbe(common.BaseComponent) *corev1.Probe { return nil } -func (p *OpenLibertyApplicationProbes) GetDefaultReadinessProbe(common.BaseComponent) *common.BaseComponentProbe { +func (p *OpenLibertyApplicationProbes) GetDefaultReadinessProbe(common.BaseComponent) *corev1.Probe { return nil } -func (p *OpenLibertyApplicationProbes) GetDefaultStartupProbe(common.BaseComponent) *common.BaseComponentProbe { +func (p *OpenLibertyApplicationProbes) GetDefaultStartupProbe(common.BaseComponent) *corev1.Probe { return nil } @@ -550,17 +538,17 @@ func (cr *OpenLibertyApplication) GetProbes() common.BaseComponentProbes { } // GetLivenessProbe returns liveness probe -func (p *OpenLibertyApplicationProbes) GetLivenessProbe() *common.BaseComponentProbe { +func (p *OpenLibertyApplicationProbes) GetLivenessProbe() *corev1.Probe { return p.Liveness } // GetReadinessProbe returns readiness probe -func (p *OpenLibertyApplicationProbes) GetReadinessProbe() *common.BaseComponentProbe { +func (p *OpenLibertyApplicationProbes) GetReadinessProbe() *corev1.Probe { return p.Readiness } // GetStartupProbe returns startup probe -func (p *OpenLibertyApplicationProbes) GetStartupProbe() *common.BaseComponentProbe { +func (p *OpenLibertyApplicationProbes) GetStartupProbe() *corev1.Probe { return p.Startup } diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index 85e1cd998..5ae11ad91 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -22,7 +22,6 @@ limitations under the License. package v1beta2 import ( - "github.com/application-stacks/runtime-component-operator/common" routev1 "github.com/openshift/api/route/v1" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" appsv1 "k8s.io/api/apps/v1" @@ -282,17 +281,17 @@ func (in *OpenLibertyApplicationProbes) DeepCopyInto(out *OpenLibertyApplication *out = *in if in.Liveness != nil { in, out := &in.Liveness, &out.Liveness - *out = new(common.BaseComponentProbe) + *out = new(v1.Probe) (*in).DeepCopyInto(*out) } if in.Readiness != nil { in, out := &in.Readiness, &out.Readiness - *out = new(common.BaseComponentProbe) + *out = new(v1.Probe) (*in).DeepCopyInto(*out) } if in.Startup != nil { in, out := &in.Startup, &out.Startup - *out = new(common.BaseComponentProbe) + *out = new(v1.Probe) (*in).DeepCopyInto(*out) } } diff --git a/bundle/manifests/apps.openliberty.io_openlibertyapplications.yaml b/bundle/manifests/apps.openliberty.io_openlibertyapplications.yaml index 66162c892..2d10a889f 100644 --- a/bundle/manifests/apps.openliberty.io_openlibertyapplications.yaml +++ b/bundle/manifests/apps.openliberty.io_openlibertyapplications.yaml @@ -3148,8 +3148,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -3299,8 +3297,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -3451,8 +3447,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started diff --git a/bundle/manifests/open-liberty.clusterserviceversion.yaml b/bundle/manifests/open-liberty.clusterserviceversion.yaml index 9f50b70a8..e20603ff5 100644 --- a/bundle/manifests/open-liberty.clusterserviceversion.yaml +++ b/bundle/manifests/open-liberty.clusterserviceversion.yaml @@ -92,7 +92,7 @@ metadata: categories: Application Runtime certified: "true" containerImage: icr.io/appcafe/open-liberty-operator:daily - createdAt: "2024-05-07T18:53:56Z" + createdAt: "2024-05-15T20:40:13Z" description: Deploy and manage containerized Liberty applications olm.skipRange: '>=0.8.0 <1.3.2' operators.openshift.io/infrastructure-features: '["disconnected"]' diff --git a/config/crd/bases/apps.openliberty.io_openlibertyapplications.yaml b/config/crd/bases/apps.openliberty.io_openlibertyapplications.yaml index 7e4e06be6..677816c89 100644 --- a/config/crd/bases/apps.openliberty.io_openlibertyapplications.yaml +++ b/config/crd/bases/apps.openliberty.io_openlibertyapplications.yaml @@ -3079,7 +3079,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - nil. + 3. Minimum value is 1. format: int32 type: integer grpc: @@ -3152,13 +3152,14 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Defaults to nil. + Default to 10 seconds. Minimum value is 1. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - nil. + 1. Must be 1 for liveness and startup. Minimum value is + 1. format: int32 type: integer tcpSocket: @@ -3193,12 +3194,14 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Defaults to nil + Minimum value is 1. spec.terminationGracePeriodSeconds is + used if unset. format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -3225,7 +3228,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - nil. + 3. Minimum value is 1. format: int32 type: integer grpc: @@ -3298,13 +3301,14 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Defaults to nil. + Default to 10 seconds. Minimum value is 1. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - nil. + 1. Must be 1 for liveness and startup. Minimum value is + 1. format: int32 type: integer tcpSocket: @@ -3339,12 +3343,14 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Defaults to nil + Minimum value is 1. spec.terminationGracePeriodSeconds is + used if unset. format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -3372,7 +3378,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - nil. + 3. Minimum value is 1. format: int32 type: integer grpc: @@ -3445,13 +3451,14 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Defaults to nil. + Default to 10 seconds. Minimum value is 1. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - nil. + 1. Must be 1 for liveness and startup. Minimum value is + 1. format: int32 type: integer tcpSocket: @@ -3486,12 +3493,14 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Defaults to nil + Minimum value is 1. spec.terminationGracePeriodSeconds is + used if unset. format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -10666,7 +10675,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - nil. + 3. Minimum value is 1. format: int32 type: integer grpc: @@ -10731,6 +10740,8 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string + required: + - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -10739,13 +10750,14 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Defaults to nil. + Default to 10 seconds. Minimum value is 1. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - nil. + 1. Must be 1 for liveness and startup. Minimum value is + 1. format: int32 type: integer tcpSocket: @@ -10780,12 +10792,14 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Defaults to nil + Minimum value is 1. spec.terminationGracePeriodSeconds is + used if unset. format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -10812,7 +10826,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - nil. + 3. Minimum value is 1. format: int32 type: integer grpc: @@ -10877,6 +10891,8 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string + required: + - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -10885,13 +10901,14 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Defaults to nil. + Default to 10 seconds. Minimum value is 1. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - nil. + 1. Must be 1 for liveness and startup. Minimum value is + 1. format: int32 type: integer tcpSocket: @@ -10926,12 +10943,14 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Defaults to nil + Minimum value is 1. spec.terminationGracePeriodSeconds is + used if unset. format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -10959,7 +10978,7 @@ spec: failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to - nil. + 3. Minimum value is 1. format: int32 type: integer grpc: @@ -11024,6 +11043,8 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string + required: + - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -11032,13 +11053,14 @@ spec: type: integer periodSeconds: description: How often (in seconds) to perform the probe. - Defaults to nil. + Default to 10 seconds. Minimum value is 1. format: int32 type: integer successThreshold: description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to - nil. + 1. Must be 1 for liveness and startup. Minimum value is + 1. format: int32 type: integer tcpSocket: @@ -11073,12 +11095,14 @@ spec: The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Defaults to nil + Minimum value is 1. spec.terminationGracePeriodSeconds is + used if unset. format: int64 type: integer timeoutSeconds: description: 'Number of seconds after which the probe times - out. Defaults to nil. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object diff --git a/go.mod b/go.mod index d79df59df..634bdb153 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/OpenLiberty/open-liberty-operator go 1.21 require ( - github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240506212440-64262a90d207 + github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240515205711-ea15efc009bc github.com/cert-manager/cert-manager v1.11.5 github.com/go-logr/logr v1.2.4 github.com/openshift/api v0.0.0-20230928134114-673ed0cfc7f1 diff --git a/go.sum b/go.sum index 41b750f2b..7844ef26e 100644 --- a/go.sum +++ b/go.sum @@ -42,6 +42,10 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240506212440-64262a90d207 h1:qTK4Z4ICPukshCUW6oIyHmX22iWwd/CqF0WXjlZTPM4= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240506212440-64262a90d207/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240514135533-812d07575e8c h1:XSLTxOd3Y76jE8bXMb/sIX6LEyH4MbsrKug/diVh7Wg= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240514135533-812d07575e8c/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240515205711-ea15efc009bc h1:ZO6TmqetJSRPah1luUsyG9On5N9XRm3/IBKsbsLLOwM= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240515205711-ea15efc009bc/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI= 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/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= diff --git a/internal/deploy/kubectl/openliberty-app-crd.yaml b/internal/deploy/kubectl/openliberty-app-crd.yaml index f4afa5aed..58ed6698d 100644 --- a/internal/deploy/kubectl/openliberty-app-crd.yaml +++ b/internal/deploy/kubectl/openliberty-app-crd.yaml @@ -3147,8 +3147,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -3298,8 +3296,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -3450,8 +3446,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started diff --git a/internal/deploy/kustomize/daily/base/open-liberty-crd.yaml b/internal/deploy/kustomize/daily/base/open-liberty-crd.yaml index f4afa5aed..58ed6698d 100644 --- a/internal/deploy/kustomize/daily/base/open-liberty-crd.yaml +++ b/internal/deploy/kustomize/daily/base/open-liberty-crd.yaml @@ -3147,8 +3147,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -3298,8 +3296,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started @@ -3450,8 +3446,6 @@ spec: description: Scheme to use for connecting to the host. Defaults to HTTP. type: string - required: - - port type: object initialDelaySeconds: description: 'Number of seconds after the container has started From c38dcf8314405db10df738ea96b283109b862baa Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Thu, 16 May 2024 09:39:31 -0400 Subject: [PATCH 3/4] Update probes doc for optional port and scheme --- doc/user-guide-v1.adoc | 62 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/doc/user-guide-v1.adoc b/doc/user-guide-v1.adoc index 9dab63efd..3c171e6d9 100644 --- a/doc/user-guide-v1.adoc +++ b/doc/user-guide-v1.adoc @@ -1050,7 +1050,7 @@ spec: initialDelaySeconds: 90 ---- -When a probe **initialDelaySeconds** parameter is set to `0`, the default value is used. To set a probe initial delay to `0`, define the probe instead of using the default probe. The following example overrides the default value and sets the initial delay to `0`. +When a probe **initialDelaySeconds** parameter is set to `0`, the default value is used. To set a probe initial delay to `0`, define the probe instead of using the default probe. The following example overrides the default value and sets the initial delay to `0`. The same will also apply to properties **timeoutSeconds**, **periodSeconds**, **successThreshold**, and **failureThreshold**. [source,yaml] ---- @@ -1063,6 +1063,66 @@ spec: initialDelaySeconds: 0 ---- +Starting in version 1.4.0, you can now specify optional **port** and **scheme** parameters within `.spec.probes`. + +- If `.spec.probes.*.httpGet.port` is not specified, the value of `.spec.service.port` will be used. + +- If `.spec.probes.*.httpGet.scheme` is not specified, when `.spec.manageTLS` is `true` (or uninitialized) `HTTPS` will be used and when set to `false`, `HTTP` will be used. + +For instance, when `.spec.manageTLS` is set to `true` (or uninitialized) +[source,yaml] +---- +spec: + probes: + liveness: + httpGet: + path: "/health/live" + manageTLS: true + service: + port: 9443 +---- +It produces a liveness probe configuration such as below: +[source,yaml] +---- +livenessProbe: + httpGet: + path: /health/live + port: 9443 # Value of .spec.service.port + scheme: HTTPS # .spec.manageTLS is true + initialDelaySeconds: 60 + timeoutSeconds: 2 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 +---- + +Additionally, in a configuration where `.spec.manageTLS` is `false` and using `.service.port` as `9080` +[source,yaml] +---- +spec: + probes: + liveness: + httpGet: + path: "/health/live" + manageTLS: false + service: + port: 9080 +---- +The following liveness probe is generated: +[source,yaml] +---- +livenessProbe: + httpGet: + path: /health/live + port: 9080 # Value of .spec.service.port + scheme: HTTP # .spec.manageTLS is false + initialDelaySeconds: 60 + timeoutSeconds: 2 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 +---- + [[deploy-serverless-applications-with-knative]] === Deploy serverless applications with Knative (`.spec.createKnativeService`) From acc7454ceac0d98b93d6ce4417d1b667dec83f6c Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Thu, 16 May 2024 13:00:58 -0400 Subject: [PATCH 4/4] Update RCO dependency --- .../open-liberty.clusterserviceversion.yaml | 2 +- doc/user-guide-v1.adoc | 14 +++++++------- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bundle/manifests/open-liberty.clusterserviceversion.yaml b/bundle/manifests/open-liberty.clusterserviceversion.yaml index e20603ff5..ac8552765 100644 --- a/bundle/manifests/open-liberty.clusterserviceversion.yaml +++ b/bundle/manifests/open-liberty.clusterserviceversion.yaml @@ -92,7 +92,7 @@ metadata: categories: Application Runtime certified: "true" containerImage: icr.io/appcafe/open-liberty-operator:daily - createdAt: "2024-05-15T20:40:13Z" + createdAt: "2024-05-16T17:00:41Z" description: Deploy and manage containerized Liberty applications olm.skipRange: '>=0.8.0 <1.3.2' operators.openshift.io/infrastructure-features: '["disconnected"]' diff --git a/doc/user-guide-v1.adoc b/doc/user-guide-v1.adoc index 3c171e6d9..e9a0d096d 100644 --- a/doc/user-guide-v1.adoc +++ b/doc/user-guide-v1.adoc @@ -1063,7 +1063,9 @@ spec: initialDelaySeconds: 0 ---- -Starting in version 1.4.0, you can now specify optional **port** and **scheme** parameters within `.spec.probes`. +Starting in version 1.4.0, you can now specify optional parameters for HTTPGetAction's under `.spec.probes.*.httpGet` for the `startup`, `liveness` and `readiness` probes. + +- If `.spec.probes.*.httpGet.path` is not specified, the default paths listed above will be used. - If `.spec.probes.*.httpGet.port` is not specified, the value of `.spec.service.port` will be used. @@ -1075,8 +1077,7 @@ For instance, when `.spec.manageTLS` is set to `true` (or uninitialized) spec: probes: liveness: - httpGet: - path: "/health/live" + httpGet: {} manageTLS: true service: port: 9443 @@ -1086,7 +1087,7 @@ It produces a liveness probe configuration such as below: ---- livenessProbe: httpGet: - path: /health/live + path: /health/live # Default path for liveness probe port: 9443 # Value of .spec.service.port scheme: HTTPS # .spec.manageTLS is true initialDelaySeconds: 60 @@ -1102,8 +1103,7 @@ Additionally, in a configuration where `.spec.manageTLS` is `false` and using `. spec: probes: liveness: - httpGet: - path: "/health/live" + httpGet: {} manageTLS: false service: port: 9080 @@ -1113,7 +1113,7 @@ The following liveness probe is generated: ---- livenessProbe: httpGet: - path: /health/live + path: /health/live # Default path for liveness probe port: 9080 # Value of .spec.service.port scheme: HTTP # .spec.manageTLS is false initialDelaySeconds: 60 diff --git a/go.mod b/go.mod index 634bdb153..4cd360ac0 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/OpenLiberty/open-liberty-operator go 1.21 require ( - github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240515205711-ea15efc009bc + github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240516142046-336488006a05 github.com/cert-manager/cert-manager v1.11.5 github.com/go-logr/logr v1.2.4 github.com/openshift/api v0.0.0-20230928134114-673ed0cfc7f1 diff --git a/go.sum b/go.sum index 7844ef26e..55660b8ae 100644 --- a/go.sum +++ b/go.sum @@ -46,6 +46,8 @@ github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0. github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240514135533-812d07575e8c/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240515205711-ea15efc009bc h1:ZO6TmqetJSRPah1luUsyG9On5N9XRm3/IBKsbsLLOwM= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240515205711-ea15efc009bc/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240516142046-336488006a05 h1:FPa3upDX4TvTDgRF+NXoUMhPsFb7YVhvld/pUN7r23A= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20240516142046-336488006a05/go.mod h1:SCojMAukVov6aOA8VEjpr0nLcheOrtoAVUGRvLT9qyI= 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/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=