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
19 changes: 14 additions & 5 deletions api/v1alpha1/webserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,23 @@ type PersistentLogs struct {
DeleteLogClaims bool `json:"deleteClaimOnDeletion,omitempty"`
}

// (Optional) Source code information
// (Optional) Source code information
type WebSourcesSpec struct {
// URL for the repository of the application sources
// URL for the repository of the application sources.
// Must be a valid Git URL. Example: 'https://github.com/jboss-openshift/tomee-demo.git'
// +kubebuilder:validation:Pattern=`^(http|https|git)://.*$`
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Source Repository URL",order=1
SourceRepositoryURL string `json:"sourceRepositoryUrl"`
// Secret for the repository of the application sources
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Source Repository Secret",order=2
SourceRepositorySecret string `json:"sourceRepositorySecret,omitempty"`
// Branch in the source repository
// Branch or tag in the source repository. Defaults to 'master' if not specified.
// +kubebuilder:default:="master"
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Source Repository Reference",order=3
SourceRepositoryRef string `json:"sourceRepositoryRef,omitempty"`
// Subdirectory in the source repository
// Subdirectory within the source repository where the application code resides. Defaults to the root directory ('.').
// +kubebuilder:default:="."
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Context Directory",order=4
ContextDir string `json:"contextDir,omitempty"`
// (Optional) Sources related parameters
Expand Down Expand Up @@ -227,10 +232,14 @@ type WebhookSecrets struct {
}

type WebServerHealthCheckSpec struct {
// String for the pod readiness health check logic
// Shell command or script to determine if the JWS instance is ready to accept traffic.
// Example: '/usr/bin/curl -f http://localhost:8080/'
// +kubebuilder:validation:MinLength=1
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Server Readiness Script",order=1
ServerReadinessScript string `json:"serverReadinessScript"`
// String for the pod liveness health check logic

// Shell command or script to determine if the container is still healthy. If it fails, the container is restarted.
// Example: '/usr/bin/pgrep -f java'
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Server Liveness Script",order=2
ServerLivenessScript string `json:"serverLivenessScript,omitempty"`
}
Expand Down
32 changes: 25 additions & 7 deletions config/crd/bases/web.servers.org_webservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -783,10 +783,15 @@ spec:
description: Pod health checks information
properties:
serverLivenessScript:
description: String for the pod liveness health check logic
description: |-
Shell command or script to determine if the container is still healthy. If it fails, the container is restarted.
Example: '/usr/bin/pgrep -f java'
type: string
serverReadinessScript:
description: String for the pod readiness health check logic
description: |-
Shell command or script to determine if the JWS instance is ready to accept traffic.
Example: '/usr/bin/curl -f http://localhost:8080/'
minLength: 1
type: string
required:
- serverReadinessScript
Expand All @@ -807,10 +812,15 @@ spec:
description: Pod health checks information
properties:
serverLivenessScript:
description: String for the pod liveness health check logic
description: |-
Shell command or script to determine if the container is still healthy. If it fails, the container is restarted.
Example: '/usr/bin/pgrep -f java'
type: string
serverReadinessScript:
description: String for the pod readiness health check logic
description: |-
Shell command or script to determine if the JWS instance is ready to accept traffic.
Example: '/usr/bin/curl -f http://localhost:8080/'
minLength: 1
type: string
required:
- serverReadinessScript
Expand All @@ -819,17 +829,25 @@ spec:
description: (Optional) Source code information
properties:
contextDir:
description: Subdirectory in the source repository
default: .
description: Subdirectory within the source repository where
the application code resides. Defaults to the root directory
('.').
type: string
sourceRepositoryRef:
description: Branch in the source repository
default: master
description: Branch or tag in the source repository. Defaults
to 'master' if not specified.
type: string
sourceRepositorySecret:
description: Secret for the repository of the application
sources
type: string
sourceRepositoryUrl:
description: URL for the repository of the application sources
description: |-
URL for the repository of the application sources.
Must be a valid Git URL. Example: 'https://github.com/jboss-openshift/tomee-demo.git'
pattern: ^(http|https|git)://.*$
type: string
webSourcesParams:
description: (Optional) Sources related parameters
Expand Down
29 changes: 26 additions & 3 deletions config/samples/v1alpha1_webserver.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
apiVersion: web.servers.org/v1alpha1
kind: WebServer
metadata:
name: webserver-example
name: jws-imagestream-sample
spec:
applicationName: webapp
# Base name for application resources (Deployment, Service, etc.)
applicationName: "jws-app"

# Instance count. +kubebuilder:validation:Minimum=0
replicas: 1
useInsightsClient: false

# Deployment Method: ImageStream (Recommended for OpenShift S2I builds)
webImageStream:
# Target ImageStream. Example: 'jws56-openjdk11-openshift'
imageStreamName: "jws56-openjdk11-openshift"
# Target namespace. Defaults to current namespace if omitted.
imageStreamNamespace: "openshift"

# Source-to-Image (S2I) configuration
webSources:
# Valid Git URI. Pattern: ^(http|https|git)://.*$
sourceRepositoryUrl: "https://github.com/jboss-openshift/tomee-demo.git"
# Target branch/tag. Defaults to 'master'.
sourceRepositoryRef: "master"
# Context directory for build. Defaults to '.'.
contextDir: "."

# Probe configuration to manage pod lifecycle
webServerHealthCheck:
# Required. Command to verify JWS is ready for traffic.
serverReadinessScript: "/usr/bin/curl -f http://localhost:8080/"
Loading