diff --git a/components/operator/api/v1alpha1/serverless_types.go b/components/operator/api/v1alpha1/serverless_types.go index 58f6b65a3..407229a9f 100644 --- a/components/operator/api/v1alpha1/serverless_types.go +++ b/components/operator/api/v1alpha1/serverless_types.go @@ -49,10 +49,6 @@ type ServerlessSpec struct { FunctionBuildMaxSimultaneousJobs string `json:"functionBuildMaxSimultaneousJobs,omitempty"` // Sets the timeout for the Function health check. The default value in seconds is `10` HealthzLivenessTimeout string `json:"healthzLivenessTimeout,omitempty"` - // Used to configure the maximum size limit for the request body of a Function. The default value is `1` megabyte - FunctionRequestBodyLimitMb string `json:"functionRequestBodyLimitMb,omitempty"` - // Sets the maximum execution time limit for a Function. By default, the value is `180` seconds - FunctionTimeoutSec string `json:"functionTimeoutSec,omitempty"` // Configures the default build Job preset to be used DefaultBuildJobPreset string `json:"defaultBuildJobPreset,omitempty"` // Configures the default runtime Pod preset to be used @@ -110,8 +106,6 @@ type ServerlessStatus struct { BuildExecutorArgs string `json:"functionBuildExecutorArgs,omitempty"` BuildMaxSimultaneousJobs string `json:"functionBuildMaxSimultaneousJobs,omitempty"` HealthzLivenessTimeout string `json:"healthzLivenessTimeout,omitempty"` - RequestBodyLimitMb string `json:"functionRequestBodyLimitMb,omitempty"` - TimeoutSec string `json:"functionTimeoutSec,omitempty"` DefaultBuildJobPreset string `json:"defaultBuildJobPreset,omitempty"` DefaultRuntimePodPreset string `json:"defaultRuntimePodPreset,omitempty"` diff --git a/components/operator/internal/chart/flags.go b/components/operator/internal/chart/flags.go index f412cee1b..d9ace87c4 100644 --- a/components/operator/internal/chart/flags.go +++ b/components/operator/internal/chart/flags.go @@ -7,7 +7,7 @@ import ( type FlagsBuilder interface { Build() map[string]interface{} - WithControllerConfiguration(CPUUtilizationPercentage string, requeueDuration string, buildExecutorArgs string, maxSimultaneousJobs string, healthzLivenessTimeout string, requestBodyLimitMb string, timeoutSec string) *flagsBuilder + WithControllerConfiguration(CPUUtilizationPercentage string, requeueDuration string, buildExecutorArgs string, maxSimultaneousJobs string, healthzLivenessTimeout string) *flagsBuilder WithDefaultPresetFlags(defaultBuildJobPreset string, defaultRuntimePodPreset string) *flagsBuilder WithOptionalDependencies(publisherURL string, traceCollectorURL string) *flagsBuilder WithRegistryAddresses(registryAddress string, serverAddress string) *flagsBuilder @@ -62,7 +62,7 @@ func nextDeeperFlag(currentFlag map[string]interface{}, path string) map[string] return currentFlag[path].(map[string]interface{}) } -func (fb *flagsBuilder) WithControllerConfiguration(CPUUtilizationPercentage, requeueDuration, buildExecutorArgs, maxSimultaneousJobs, healthzLivenessTimeout, requestBodyLimitMb, timeoutSec string) *flagsBuilder { +func (fb *flagsBuilder) WithControllerConfiguration(CPUUtilizationPercentage, requeueDuration, buildExecutorArgs, maxSimultaneousJobs, healthzLivenessTimeout string) *flagsBuilder { optionalFlags := []struct { key string value string @@ -72,8 +72,6 @@ func (fb *flagsBuilder) WithControllerConfiguration(CPUUtilizationPercentage, re {"functionBuildExecutorArgs", buildExecutorArgs}, {"functionBuildMaxSimultaneousJobs", maxSimultaneousJobs}, {"healthzLivenessTimeout", healthzLivenessTimeout}, - {"functionRequestBodyLimitMb", requestBodyLimitMb}, - {"functionTimeoutSec", timeoutSec}, } for _, flag := range optionalFlags { diff --git a/components/operator/internal/chart/flags_test.go b/components/operator/internal/chart/flags_test.go index 05a59f7f3..1e95a9361 100644 --- a/components/operator/internal/chart/flags_test.go +++ b/components/operator/internal/chart/flags_test.go @@ -21,9 +21,7 @@ func Test_flagsBuilder_Build(t *testing.T) { "functionBuildExecutorArgs": "testBuildExecutorArgs", "functionBuildMaxSimultaneousJobs": "testMaxSimultaneousJobs", "functionPublisherProxyAddress": "testPublisherURL", - "functionRequestBodyLimitMb": "testRequestBodyLimitMb", "functionRequeueDuration": "testRequeueDuration", - "functionTimeoutSec": "testTimeoutSec", "functionTraceCollectorEndpoint": "testCollectorURL", "healthzLivenessTimeout": "testHealthzLivenessTimeout", "targetCPUUtilizationPercentage": "testCPUUtilizationPercentage", @@ -73,8 +71,6 @@ func Test_flagsBuilder_Build(t *testing.T) { "testBuildExecutorArgs", "testMaxSimultaneousJobs", "testHealthzLivenessTimeout", - "testRequestBodyLimitMb", - "testTimeoutSec", ).Build() require.Equal(t, expectedFlags, flags) @@ -105,7 +101,6 @@ func Test_flagsBuilder_Build(t *testing.T) { "configuration": map[string]interface{}{ "data": map[string]interface{}{ "functionBuildMaxSimultaneousJobs": "testMaxSimultaneousJobs", - "functionRequestBodyLimitMb": "testRequestBodyLimitMb", "healthzLivenessTimeout": "testHealthzLivenessTimeout", "targetCPUUtilizationPercentage": "testCPUUtilizationPercentage", }, @@ -121,8 +116,6 @@ func Test_flagsBuilder_Build(t *testing.T) { "", "testMaxSimultaneousJobs", "testHealthzLivenessTimeout", - "testRequestBodyLimitMb", - "", ).Build() require.Equal(t, expectedFlags, flags) diff --git a/components/operator/internal/state/controller_configuration.go b/components/operator/internal/state/controller_configuration.go index 1e5b281c5..459e948d9 100644 --- a/components/operator/internal/state/controller_configuration.go +++ b/components/operator/internal/state/controller_configuration.go @@ -14,8 +14,6 @@ const ( slowRuntimePreset = "XS" fastBuildPreset = "fast" fastRuntimePreset = "L" - functionTimeoutDepreciationMessage = "spec.functionTimeoutSec is unused and will be removed. Remove it from your Serverless CR." - functionRequestBodyLimitDepreciationMessage = "spec.functionRequestBodyLimitMb is unused and will be removed. Remove it from your Serverless CR." ) func sFnControllerConfiguration(ctx context.Context, r *reconciler, s *systemState) (stateFn, *controllerruntime.Result, error) { @@ -25,7 +23,6 @@ func sFnControllerConfiguration(ctx context.Context, r *reconciler, s *systemSta } configureControllerConfigurationFlags(s) - warnAboutDeadFields(s) s.setState(v1alpha1.StateProcessing) s.instance.UpdateConditionTrue( @@ -37,15 +34,6 @@ func sFnControllerConfiguration(ctx context.Context, r *reconciler, s *systemSta return nextState(sFnApplyResources) } -func warnAboutDeadFields(s *systemState) { - if s.instance.Spec.FunctionTimeoutSec != "" { - s.warningBuilder.With(functionTimeoutDepreciationMessage) - } - if s.instance.Spec.FunctionRequestBodyLimitMb != "" { - s.warningBuilder.With(functionRequestBodyLimitDepreciationMessage) - } -} - func updateControllerConfigurationStatus(ctx context.Context, r *reconciler, instance *v1alpha1.Serverless) error { nodesLen, err := getNodesLen(ctx, r.client) if err != nil { @@ -66,8 +54,6 @@ func updateControllerConfigurationStatus(ctx context.Context, r *reconciler, ins {spec.FunctionBuildExecutorArgs, &instance.Status.BuildExecutorArgs, "Function build executor args", ""}, {spec.FunctionBuildMaxSimultaneousJobs, &instance.Status.BuildMaxSimultaneousJobs, "Max number of simultaneous jobs", ""}, {spec.HealthzLivenessTimeout, &instance.Status.HealthzLivenessTimeout, "Duration of health check", ""}, - {spec.FunctionRequestBodyLimitMb, &instance.Status.RequestBodyLimitMb, "Max size of request body", ""}, - {spec.FunctionTimeoutSec, &instance.Status.TimeoutSec, "Timeout", ""}, {spec.DefaultBuildJobPreset, &instance.Status.DefaultBuildJobPreset, "Default build job preset", defaultBuildPreset}, {spec.DefaultRuntimePodPreset, &instance.Status.DefaultRuntimePodPreset, "Default runtime pod preset", defaultRuntimePreset}, } @@ -84,8 +70,6 @@ func configureControllerConfigurationFlags(s *systemState) { s.instance.Status.BuildExecutorArgs, s.instance.Status.BuildMaxSimultaneousJobs, s.instance.Status.HealthzLivenessTimeout, - s.instance.Status.RequestBodyLimitMb, - s.instance.Status.TimeoutSec, ). WithDefaultPresetFlags( s.instance.Status.DefaultBuildJobPreset, diff --git a/components/operator/internal/state/controller_configuration_test.go b/components/operator/internal/state/controller_configuration_test.go index 1f333070e..7ab8953c4 100644 --- a/components/operator/internal/state/controller_configuration_test.go +++ b/components/operator/internal/state/controller_configuration_test.go @@ -3,11 +3,9 @@ package state import ( "context" "testing" - "fmt" "github.com/kyma-project/serverless/components/operator/api/v1alpha1" "github.com/kyma-project/serverless/components/operator/internal/chart" - "github.com/kyma-project/serverless/components/operator/internal/warning" "github.com/stretchr/testify/require" "go.uber.org/zap" corev1 "k8s.io/api/core/v1" @@ -23,8 +21,6 @@ const ( executorArgsTest = "test-build-executor-args" maxSimultaneousJobsTest = "test-max-simultaneous-jobs" healthzLivenessTimeoutTest = "test-healthz-liveness-timeout" - requestBodyLimitMbTest = "test-request-body-limit-mb" - timeoutSecTest = "test-timeout-sec" buildJobPresetTest = "test=default-build-job-preset" runtimePodPresetTest = "test-default-runtime-pod-preset" ) @@ -234,20 +230,6 @@ func Test_sFnControllerConfiguration(t *testing.T) { configurationReadyMsg) require.Equal(t, v1alpha1.StateProcessing, s.instance.Status.State) }) - - t.Run("enable dead fields", func(t *testing.T) { - s := &systemState{ - warningBuilder: warning.NewBuilder(), - instance: v1alpha1.Serverless{ - Spec: v1alpha1.ServerlessSpec{ - FunctionRequestBodyLimitMb: requestBodyLimitMbTest, - FunctionTimeoutSec: timeoutSecTest, - }, - }, - } - warnAboutDeadFields(s) - require.Equal(t, fmt.Sprintf("Warning: %s; %s", functionTimeoutDepreciationMessage, functionRequestBodyLimitDepreciationMessage), s.warningBuilder.Build()) - }) } diff --git a/config/operator/base/crd/bases/operator.kyma-project.io_serverlesses.yaml b/config/operator/base/crd/bases/operator.kyma-project.io_serverlesses.yaml index 0232ead03..e3fc668d9 100644 --- a/config/operator/base/crd/bases/operator.kyma-project.io_serverlesses.yaml +++ b/config/operator/base/crd/bases/operator.kyma-project.io_serverlesses.yaml @@ -87,19 +87,11 @@ spec: description: A number of simultaneous jobs that can run at the same time. The default value is `5` type: string - functionRequestBodyLimitMb: - description: Used to configure the maximum size limit for the request - body of a Function. The default value is `1` megabyte - type: string functionRequeueDuration: description: Sets the requeue duration for Function. By default, the Function associated with the default configuration is requeued every 5 minutes type: string - functionTimeoutSec: - description: Sets the maximum execution time limit for a Function. - By default, the value is `180` seconds - type: string healthzLivenessTimeout: description: Sets the timeout for the Function health check. The default value in seconds is `10` @@ -205,12 +197,8 @@ spec: type: string functionBuildMaxSimultaneousJobs: type: string - functionRequestBodyLimitMb: - type: string functionRequeueDuration: type: string - functionTimeoutSec: - type: string healthzLivenessTimeout: type: string served: diff --git a/config/operator/base/ui-extensions/serverless/details b/config/operator/base/ui-extensions/serverless/details index efdf0d861..c00f02cd3 100644 --- a/config/operator/base/ui-extensions/serverless/details +++ b/config/operator/base/ui-extensions/serverless/details @@ -42,12 +42,6 @@ body: - name: Max Simultaneous Builds source: spec.functionBuildMaxSimultaneousJobs visibility: '$exists($value)' - - name: Function Request Body Limit [Mb] - source: spec.functionRequestBodyLimitMb - visibility: '$exists($value)' - - name: Function Timeout [Sec] - source: spec.functionTimeoutSec - visibility: '$exists($value)' - name: Function Requeue Duration source: spec.functionRequeueDuration visibility: '$exists($value)' diff --git a/docs/user/00-20-configure-serverless.md b/docs/user/00-20-configure-serverless.md index c047046b9..978fcd70a 100644 --- a/docs/user/00-20-configure-serverless.md +++ b/docs/user/00-20-configure-serverless.md @@ -185,24 +185,6 @@ By default, the Function is considered unhealthy if the liveness health check en healthzLivenessTimeout: "10s" ``` -## Configure the Function Request Body Limit - -Use this field to configure the maximum size limit for the request body of a Function. The default value is set to `1` megabyte. - -```yaml - spec: - functionRequestBodyLimitMb: 1 -``` - -## Configure the Function Timeout - -By default, the maximum execution time limit for a Function is set to `180` seconds. - -```yaml - spec: - functionTimeoutSec: 180 -``` - ## Configure the Default Build Job Preset You can configure the default build Job preset to be used. diff --git a/docs/user/resources/06-20-serverless-cr.md b/docs/user/resources/06-20-serverless-cr.md index 103c89044..ef27115b6 100644 --- a/docs/user/resources/06-20-serverless-cr.md +++ b/docs/user/resources/06-20-serverless-cr.md @@ -31,8 +31,6 @@ The following Serverless custom resource (CR) shows configuration of Serverless functionBuildExecutorArgs: "--insecure,--skip-tls-verify,--skip-unused-stages,--log-format=text,--cache=true,--use-new-run,--compressed-caching=false" functionBuildMaxSimultaneousJobs: 5 healthzLivenessTimeout: "10s" - functionRequestBodyLimitMb: 1 - functionTimeoutSec: 180 defaultBuildJobPreset: "normal" defaultRuntimePodPreset: "M" status: @@ -75,8 +73,6 @@ For details, see the [Serverless specification file](https://github.com/kyma-pro | **functionBuildExecutorArgs** | string | Specifies the arguments passed to the Function build executor | | **functionBuildMaxSimultaneousJobs** | string | A number of simultaneous jobs that can run at the same time. The default value is `5` | | **healthzLivenessTimeout** | string | Sets the timeout for the Function health check. The default value in seconds is `10` | -| **functionRequestBodyLimitMb** | string | Used to configure the maximum size limit for the request body of a Function. The default value is `1` megabyte | -| **functionTimeoutSec** | string | Sets the maximum execution time limit for a Function. By default, the value is `180` seconds | | **defaultBuildJobPreset** | string | Configures the default build Job preset to be used | | **defaultRuntimePodPreset** | string | Configures the default runtime Pod preset to be used | @@ -100,9 +96,7 @@ For details, see the [Serverless specification file](https://github.com/kyma-pro | **functionRequeueDuration** | string | Used the Function requeue duration. | | **functionBuildExecutorArgs** | string | Used the Function build executor arguments. | | **functionBuildMaxSimultaneousJobs** | string | Used the Function build max number of simultaneous jobs. | -| **healthzLivenessTimeout** | string | Used the healthz liveness timeout. | -| **functionRequestBodyLimitMb** | string | Used the Function request body limit. | -| **functionTimeoutSec** | string | Used the Function timeout. | +| **healthzLivenessTimeout** | string | Used the healthz liveness timeout. | | **defaultBuildJobPreset** | string | Used the default build Job preset. | | **defaultRuntimePodPreset** | string | Used the default runtime Pod preset. |