Documentation
¶
Index ¶
- Constants
- func GenerateDataIndexWorkflowProperties(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (*properties.Properties, error)
- func GenerateJobServiceWorkflowProperties(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (*properties.Properties, error)
- func GenerateServiceURL(protocol string, namespace string, name string) string
- func GetDBMigrationStrategy(persistence *operatorapi.PersistenceOptionsSpec) operatorapi.DBMigrationStrategyType
- func GetPlatformBroker(platform *operatorapi.SonataFlowPlatform) *duckv1.Destination
- func GetSecretKeyValueString(ctx context.Context, secretName string, secretKey string, nameSpace string) (string, error)
- func IsDataIndexEnabled(plf *operatorapi.SonataFlowPlatform) bool
- func IsJobServiceEnabled(plf *operatorapi.SonataFlowPlatform) bool
- func IsJobsBasedDBMigration(persistence *operatorapi.PersistenceOptionsSpec) bool
- func IsNoDBMigration(persistence *operatorapi.PersistenceOptionsSpec) bool
- func IsServiceBasedDBMigration(persistence *operatorapi.PersistenceOptionsSpec) bool
- func SetServiceUrlsInWorkflowStatus(pl *operatorapi.SonataFlowPlatform, workflow *operatorapi.SonataFlow)
- type DataIndexHandler
- func (d *DataIndexHandler) AcceptsHPA() bool
- func (d *DataIndexHandler) AcceptsPDB() bool
- func (d *DataIndexHandler) CheckKSinkInjected() (bool, error)
- func (d *DataIndexHandler) ConfigurePersistence(containerSpec *corev1.Container) *corev1.Container
- func (d *DataIndexHandler) GenerateKnativeResources(platform *operatorapi.SonataFlowPlatform, lbl map[string]string) ([]client.Object, *corev1.Event, error)
- func (d *DataIndexHandler) GenerateServiceProperties() (*properties.Properties, error)
- func (d *DataIndexHandler) GetContainerName() string
- func (d *DataIndexHandler) GetDBMigrationStrategy() operatorapi.DBMigrationStrategyType
- func (d *DataIndexHandler) GetDeploymentStrategy() appsv1.DeploymentStrategy
- func (d *DataIndexHandler) GetEnvironmentVariables() []corev1.EnvVar
- func (d *DataIndexHandler) GetLocalServiceBaseUrl() string
- func (d *DataIndexHandler) GetPDBSpec() *operatorapi.PodDisruptionBudgetSpec
- func (d *DataIndexHandler) GetPodResourceRequirements() corev1.ResourceRequirements
- func (d *DataIndexHandler) GetReplicaCount() int32
- func (d *DataIndexHandler) GetServiceBaseUrl() string
- func (d *DataIndexHandler) GetServiceCmName() string
- func (d DataIndexHandler) GetServiceImageName(persistenceType constants.PersistenceType) string
- func (d *DataIndexHandler) GetServiceName() string
- func (d *DataIndexHandler) GetServiceSource() *duckv1.Destination
- func (d *DataIndexHandler) GetSourceBroker() *duckv1.Destination
- func (d DataIndexHandler) IsPersistenceEnabledtInSpec() bool
- func (d *DataIndexHandler) IsServiceEnabled() bool
- func (d *DataIndexHandler) IsServiceEnabledInSpec() bool
- func (d DataIndexHandler) IsServiceSetInSpec() bool
- func (d DataIndexHandler) MergeContainerSpec(containerSpec *corev1.Container) (*corev1.Container, error)
- func (d *DataIndexHandler) MergePodSpec(podSpec corev1.PodSpec) (corev1.PodSpec, error)
- func (d DataIndexHandler) SetServiceUrlInPlatformStatus(clusterRefPlatform *operatorapi.SonataFlowPlatform)
- func (d DataIndexHandler) SetServiceUrlInWorkflowStatus(workflow *operatorapi.SonataFlow)
- type JobServiceHandler
- func (d *JobServiceHandler) AcceptsHPA() bool
- func (d *JobServiceHandler) AcceptsPDB() bool
- func (j *JobServiceHandler) CheckKSinkInjected() (bool, error)
- func (j *JobServiceHandler) ConfigurePersistence(containerSpec *corev1.Container) *corev1.Container
- func (j *JobServiceHandler) GenerateKnativeResources(platform *operatorapi.SonataFlowPlatform, lbl map[string]string) ([]client.Object, *corev1.Event, error)
- func (j *JobServiceHandler) GenerateServiceProperties() (*properties.Properties, error)
- func (j *JobServiceHandler) GetContainerName() string
- func (j *JobServiceHandler) GetDBMigrationStrategy() operatorapi.DBMigrationStrategyType
- func (j *JobServiceHandler) GetDeploymentStrategy() appsv1.DeploymentStrategy
- func (j *JobServiceHandler) GetEnvironmentVariables() []corev1.EnvVar
- func (j *JobServiceHandler) GetLocalServiceBaseUrl() string
- func (d *JobServiceHandler) GetPDBSpec() *operatorapi.PodDisruptionBudgetSpec
- func (j *JobServiceHandler) GetPodResourceRequirements() corev1.ResourceRequirements
- func (j *JobServiceHandler) GetReplicaCount() int32
- func (j *JobServiceHandler) GetServiceBaseUrl() string
- func (j *JobServiceHandler) GetServiceCmName() string
- func (j JobServiceHandler) GetServiceImageName(persistenceType constants.PersistenceType) string
- func (j *JobServiceHandler) GetServiceName() string
- func (j *JobServiceHandler) GetServiceSink() *duckv1.Destination
- func (j *JobServiceHandler) GetServiceSource() *duckv1.Destination
- func (d JobServiceHandler) GetSink() *duckv1.Destination
- func (d JobServiceHandler) GetSourceBroker() *duckv1.Destination
- func (j JobServiceHandler) IsPersistenceEnabledtInSpec() bool
- func (j *JobServiceHandler) IsServiceEnabled() bool
- func (j *JobServiceHandler) IsServiceEnabledInSpec() bool
- func (j JobServiceHandler) IsServiceSetInSpec() bool
- func (j JobServiceHandler) MergeContainerSpec(containerSpec *corev1.Container) (*corev1.Container, error)
- func (j *JobServiceHandler) MergePodSpec(podSpec corev1.PodSpec) (corev1.PodSpec, error)
- func (j JobServiceHandler) SetServiceUrlInPlatformStatus(clusterRefPlatform *operatorapi.SonataFlowPlatform)
- func (j JobServiceHandler) SetServiceUrlInWorkflowStatus(workflow *operatorapi.SonataFlow)
- type PlatformServiceHandler
- type ServiceAppPropertyHandler
Constants ¶
const DefaultHTTPServicePortInt = 8080
const (
WaitingKnativeEventing = "WaitingKnativeEventing"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateDataIndexWorkflowProperties ¶
func GenerateDataIndexWorkflowProperties(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (*properties.Properties, error)
GenerateDataIndexWorkflowProperties returns the set of application properties required for the workflow to interact with the Data Index. For the calculation this function considers if the Data Index is present in the SonataFlowPlatform, if not present, no properties. Never nil.
func GenerateJobServiceWorkflowProperties ¶
func GenerateJobServiceWorkflowProperties(workflow *operatorapi.SonataFlow, platform *operatorapi.SonataFlowPlatform) (*properties.Properties, error)
GenerateJobServiceWorkflowProperties returns the set of application properties required for the workflow to interact with the Job Service. For the calculation this function considers if the Job Service is present in the SonataFlowPlatform, if not present, no properties. Never nil.
func GenerateServiceURL ¶
func GetDBMigrationStrategy ¶
func GetDBMigrationStrategy(persistence *operatorapi.PersistenceOptionsSpec) operatorapi.DBMigrationStrategyType
func GetPlatformBroker ¶
func GetPlatformBroker(platform *operatorapi.SonataFlowPlatform) *duckv1.Destination
GetPlatformBroker gets the default broker for the platform.
func GetSecretKeyValueString ¶
func IsDataIndexEnabled ¶
func IsDataIndexEnabled(plf *operatorapi.SonataFlowPlatform) bool
func IsJobServiceEnabled ¶
func IsJobServiceEnabled(plf *operatorapi.SonataFlowPlatform) bool
func IsJobsBasedDBMigration ¶
func IsJobsBasedDBMigration(persistence *operatorapi.PersistenceOptionsSpec) bool
func IsNoDBMigration ¶
func IsNoDBMigration(persistence *operatorapi.PersistenceOptionsSpec) bool
func IsServiceBasedDBMigration ¶
func IsServiceBasedDBMigration(persistence *operatorapi.PersistenceOptionsSpec) bool
func SetServiceUrlsInWorkflowStatus ¶
func SetServiceUrlsInWorkflowStatus(pl *operatorapi.SonataFlowPlatform, workflow *operatorapi.SonataFlow)
Types ¶
type DataIndexHandler ¶
type DataIndexHandler struct {
// contains filtered or unexported fields
}
func (*DataIndexHandler) AcceptsHPA ¶
func (d *DataIndexHandler) AcceptsHPA() bool
func (*DataIndexHandler) AcceptsPDB ¶
func (d *DataIndexHandler) AcceptsPDB() bool
func (*DataIndexHandler) CheckKSinkInjected ¶
func (d *DataIndexHandler) CheckKSinkInjected() (bool, error)
func (*DataIndexHandler) ConfigurePersistence ¶
func (d *DataIndexHandler) ConfigurePersistence(containerSpec *corev1.Container) *corev1.Container
func (*DataIndexHandler) GenerateKnativeResources ¶
func (d *DataIndexHandler) GenerateKnativeResources(platform *operatorapi.SonataFlowPlatform, lbl map[string]string) ([]client.Object, *corev1.Event, error)
func (*DataIndexHandler) GenerateServiceProperties ¶
func (d *DataIndexHandler) GenerateServiceProperties() (*properties.Properties, error)
func (*DataIndexHandler) GetContainerName ¶
func (d *DataIndexHandler) GetContainerName() string
func (*DataIndexHandler) GetDBMigrationStrategy ¶
func (d *DataIndexHandler) GetDBMigrationStrategy() operatorapi.DBMigrationStrategyType
GetDBMigrationStrategy returns DB migration approach
func (*DataIndexHandler) GetDeploymentStrategy ¶
func (d *DataIndexHandler) GetDeploymentStrategy() appsv1.DeploymentStrategy
func (*DataIndexHandler) GetEnvironmentVariables ¶
func (d *DataIndexHandler) GetEnvironmentVariables() []corev1.EnvVar
func (*DataIndexHandler) GetLocalServiceBaseUrl ¶
func (d *DataIndexHandler) GetLocalServiceBaseUrl() string
func (*DataIndexHandler) GetPDBSpec ¶
func (d *DataIndexHandler) GetPDBSpec() *operatorapi.PodDisruptionBudgetSpec
func (*DataIndexHandler) GetPodResourceRequirements ¶
func (d *DataIndexHandler) GetPodResourceRequirements() corev1.ResourceRequirements
func (*DataIndexHandler) GetReplicaCount ¶
func (d *DataIndexHandler) GetReplicaCount() int32
func (*DataIndexHandler) GetServiceBaseUrl ¶
func (d *DataIndexHandler) GetServiceBaseUrl() string
func (*DataIndexHandler) GetServiceCmName ¶
func (d *DataIndexHandler) GetServiceCmName() string
func (DataIndexHandler) GetServiceImageName ¶
func (d DataIndexHandler) GetServiceImageName(persistenceType constants.PersistenceType) string
func (*DataIndexHandler) GetServiceName ¶
func (d *DataIndexHandler) GetServiceName() string
func (*DataIndexHandler) GetServiceSource ¶
func (d *DataIndexHandler) GetServiceSource() *duckv1.Destination
func (*DataIndexHandler) GetSourceBroker ¶
func (d *DataIndexHandler) GetSourceBroker() *duckv1.Destination
func (DataIndexHandler) IsPersistenceEnabledtInSpec ¶
func (d DataIndexHandler) IsPersistenceEnabledtInSpec() bool
func (*DataIndexHandler) IsServiceEnabled ¶
func (d *DataIndexHandler) IsServiceEnabled() bool
func (*DataIndexHandler) IsServiceEnabledInSpec ¶
func (d *DataIndexHandler) IsServiceEnabledInSpec() bool
func (DataIndexHandler) IsServiceSetInSpec ¶
func (d DataIndexHandler) IsServiceSetInSpec() bool
func (DataIndexHandler) MergeContainerSpec ¶
func (*DataIndexHandler) MergePodSpec ¶
func (DataIndexHandler) SetServiceUrlInPlatformStatus ¶
func (d DataIndexHandler) SetServiceUrlInPlatformStatus(clusterRefPlatform *operatorapi.SonataFlowPlatform)
func (DataIndexHandler) SetServiceUrlInWorkflowStatus ¶
func (d DataIndexHandler) SetServiceUrlInWorkflowStatus(workflow *operatorapi.SonataFlow)
type JobServiceHandler ¶
type JobServiceHandler struct {
// contains filtered or unexported fields
}
func (*JobServiceHandler) AcceptsHPA ¶
func (d *JobServiceHandler) AcceptsHPA() bool
func (*JobServiceHandler) AcceptsPDB ¶
func (d *JobServiceHandler) AcceptsPDB() bool
func (*JobServiceHandler) CheckKSinkInjected ¶
func (j *JobServiceHandler) CheckKSinkInjected() (bool, error)
func (*JobServiceHandler) ConfigurePersistence ¶
func (j *JobServiceHandler) ConfigurePersistence(containerSpec *corev1.Container) *corev1.Container
func (*JobServiceHandler) GenerateKnativeResources ¶
func (j *JobServiceHandler) GenerateKnativeResources(platform *operatorapi.SonataFlowPlatform, lbl map[string]string) ([]client.Object, *corev1.Event, error)
func (*JobServiceHandler) GenerateServiceProperties ¶
func (j *JobServiceHandler) GenerateServiceProperties() (*properties.Properties, error)
func (*JobServiceHandler) GetContainerName ¶
func (j *JobServiceHandler) GetContainerName() string
func (*JobServiceHandler) GetDBMigrationStrategy ¶
func (j *JobServiceHandler) GetDBMigrationStrategy() operatorapi.DBMigrationStrategyType
GetDBMigrationStrategy returns db migration approach otherwise
func (*JobServiceHandler) GetDeploymentStrategy ¶
func (j *JobServiceHandler) GetDeploymentStrategy() appsv1.DeploymentStrategy
func (*JobServiceHandler) GetEnvironmentVariables ¶
func (j *JobServiceHandler) GetEnvironmentVariables() []corev1.EnvVar
func (*JobServiceHandler) GetLocalServiceBaseUrl ¶
func (j *JobServiceHandler) GetLocalServiceBaseUrl() string
func (*JobServiceHandler) GetPDBSpec ¶
func (d *JobServiceHandler) GetPDBSpec() *operatorapi.PodDisruptionBudgetSpec
func (*JobServiceHandler) GetPodResourceRequirements ¶
func (j *JobServiceHandler) GetPodResourceRequirements() corev1.ResourceRequirements
func (*JobServiceHandler) GetReplicaCount ¶
func (j *JobServiceHandler) GetReplicaCount() int32
func (*JobServiceHandler) GetServiceBaseUrl ¶
func (j *JobServiceHandler) GetServiceBaseUrl() string
func (*JobServiceHandler) GetServiceCmName ¶
func (j *JobServiceHandler) GetServiceCmName() string
func (JobServiceHandler) GetServiceImageName ¶
func (j JobServiceHandler) GetServiceImageName(persistenceType constants.PersistenceType) string
func (*JobServiceHandler) GetServiceName ¶
func (j *JobServiceHandler) GetServiceName() string
func (*JobServiceHandler) GetServiceSink ¶
func (j *JobServiceHandler) GetServiceSink() *duckv1.Destination
func (*JobServiceHandler) GetServiceSource ¶
func (j *JobServiceHandler) GetServiceSource() *duckv1.Destination
func (JobServiceHandler) GetSink ¶
func (d JobServiceHandler) GetSink() *duckv1.Destination
func (JobServiceHandler) GetSourceBroker ¶
func (d JobServiceHandler) GetSourceBroker() *duckv1.Destination
func (JobServiceHandler) IsPersistenceEnabledtInSpec ¶
func (j JobServiceHandler) IsPersistenceEnabledtInSpec() bool
func (*JobServiceHandler) IsServiceEnabled ¶
func (j *JobServiceHandler) IsServiceEnabled() bool
func (*JobServiceHandler) IsServiceEnabledInSpec ¶
func (j *JobServiceHandler) IsServiceEnabledInSpec() bool
func (JobServiceHandler) IsServiceSetInSpec ¶
func (j JobServiceHandler) IsServiceSetInSpec() bool
func (JobServiceHandler) MergeContainerSpec ¶
func (*JobServiceHandler) MergePodSpec ¶
func (JobServiceHandler) SetServiceUrlInPlatformStatus ¶
func (j JobServiceHandler) SetServiceUrlInPlatformStatus(clusterRefPlatform *operatorapi.SonataFlowPlatform)
func (JobServiceHandler) SetServiceUrlInWorkflowStatus ¶
func (j JobServiceHandler) SetServiceUrlInWorkflowStatus(workflow *operatorapi.SonataFlow)
type PlatformServiceHandler ¶
type PlatformServiceHandler interface {
// GetContainerName returns the name of the service's container in the deployment.
GetContainerName() string
// GetServiceImageName returns the image name of the service's container. It takes in the service and persistence types and returns a string
// that contains the FQDN of the image, including the tag.
GetServiceImageName(persistenceName constants.PersistenceType) string
// GetServiceName returns the name of the kubernetes service prefixed with the platform name
GetServiceName() string
// GetServiceCmName returns the name of the configmap associated to the service
GetServiceCmName() string
// GetEnvironmentVariables returns the env variables to be injected to the service container
GetEnvironmentVariables() []corev1.EnvVar
// GetPodResourceRequirements returns the pod's memory and CPU resource requirements
// Values for job service taken from
// https://github.com/parodos-dev/orchestrator-helm-chart/blob/52d09eda56fdbed3060782df29847c97f172600f/charts/orchestrator/values.yaml#L68-L72
GetPodResourceRequirements() corev1.ResourceRequirements
// GetReplicaCount Returns the default pod replica count for the given service
GetReplicaCount() int32
// GetDeploymentStrategy Returns the deployment strategy for the service
GetDeploymentStrategy() appsv1.DeploymentStrategy
// MergeContainerSpec performs a merge with override using the containerSpec argument and the expected values based on the service's pod template specifications. The returning
// object is the merged result
MergeContainerSpec(containerSpec *corev1.Container) (*corev1.Container, error)
// ConfigurePersistence sets the persistence's image and environment values when it is defined in the Persistence field of the service, overriding any existing value.
ConfigurePersistence(containerSpec *corev1.Container) *corev1.Container
// MergePodSpec performs a merge with override between the podSpec argument and the expected values based on the service's pod template specification. The returning
// object is the result of the merge
MergePodSpec(podSpec corev1.PodSpec) (corev1.PodSpec, error)
// GenerateServiceProperties returns a property object that contains the application properties required by the service deployment
GenerateServiceProperties() (*properties.Properties, error)
// GenerateKnativeResources returns knative resources that bridge between workflow deploys and the service
GenerateKnativeResources(platform *operatorapi.SonataFlowPlatform, lbl map[string]string) ([]client.Object, *corev1.Event, error)
// IsServiceSetInSpec returns true if the service is set in the spec.
IsServiceSetInSpec() bool
// IsServiceEnabledInSpec returns true if the service is enabled in the spec.
IsServiceEnabledInSpec() bool
// IsPersistenceEnabledtInSpec returns true if the service has persistence set in the spec.
IsPersistenceEnabledtInSpec() bool
// GetLocalServiceBaseUrl returns the base url of the local service
GetLocalServiceBaseUrl() string
// GetServiceBaseUrl returns the base url of the service, based on whether using local or cluster-scoped service.
GetServiceBaseUrl() string
// IsServiceEnabled returns true if the service is enabled in either the spec or the status.clusterPlatformRef.
IsServiceEnabled() bool
// SetServiceUrlInPlatformStatus sets the service url in the platform's status. if reconciled instance does not have service set in spec AND
// if cluster referenced platform has said service enabled, use the cluster platform's service
SetServiceUrlInPlatformStatus(clusterRefPlatform *operatorapi.SonataFlowPlatform)
// SetServiceUrlInWorkflowStatus sets the service url in a workflow's status.
SetServiceUrlInWorkflowStatus(workflow *operatorapi.SonataFlow)
// GetServiceSource returns the source Broker configured for the given service by applying the following precedence rule.
// The source declared in the given service definition is returned first, if any, otherwise a source declared in the
// service platform is returned, if any.
GetServiceSource() *duckv1.Destination
// Check if K_SINK has injected for Job Service. No Op for Data Index
CheckKSinkInjected() (bool, error)
// Returns whether job based, service based or no DB migration is needed
GetDBMigrationStrategy() operatorapi.DBMigrationStrategyType
// AcceptsHPA returns true if the service accepts an external HPA configuration.
AcceptsHPA() bool
// AcceptsPDB returns true if the service accepts the operator managed PDB generation.
AcceptsPDB() bool
// GetPDBSpec returns the configured PodDisruptionBudgetSpec for the given service.
GetPDBSpec() *operatorapi.PodDisruptionBudgetSpec
}
func NewDataIndexHandler ¶
func NewDataIndexHandler(platform *operatorapi.SonataFlowPlatform) PlatformServiceHandler
func NewJobServiceHandler ¶
func NewJobServiceHandler(platform *operatorapi.SonataFlowPlatform) PlatformServiceHandler
type ServiceAppPropertyHandler ¶
type ServiceAppPropertyHandler interface {
WithUserProperties(userProperties string) ServiceAppPropertyHandler
Build() string
}
func NewServiceAppPropertyHandler ¶
func NewServiceAppPropertyHandler(serviceHandler PlatformServiceHandler) (ServiceAppPropertyHandler, error)
NewServiceAppPropertyHandler creates the default service configurations property handler The set of properties is initialized with the operator provided immutable properties. The set of defaultManagedProperties is initialized with the operator provided properties that the user might override.