@@ -17,7 +17,6 @@ limitations under the License.
1717package v1alpha1
1818
1919import (
20- corev1 "k8s.io/api/core/v1"
2120 apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2221 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2322)
@@ -81,35 +80,10 @@ type ParametersDefinitionSpec struct {
8180 // If `reloadAction` is not set or the modified parameters are not listed in `dynamicParameters`,
8281 // dynamic reloading will not be triggered.
8382 //
84- // Example:
85- // ```yaml
86- // dynamicReloadAction:
87- // tplScriptTrigger:
88- // namespace: kb-system
89- // scriptConfigMapRef: mysql-reload-script
90- // sync: true
91- // ```
92- //
83+ // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 1.2.0"
9384 // +optional
9485 ReloadAction * ReloadAction `json:"reloadAction,omitempty"`
9586
96- // TODO: migrate DownwardAPITriggeredActions to ComponentDefinition.spec.lifecycleActions
97- // Specifies a list of actions to execute specified commands based on Pod labels.
98- //
99- // It utilizes the K8s Downward API to mount label information as a volume into the pod.
100- // The 'config-manager' sidecar container watches for changes in the role label and dynamically invoke
101- // registered commands (usually execute some SQL statements) when a change is detected.
102- //
103- // It is designed for scenarios where:
104- //
105- // - Replicas with different roles have different configurations, such as Redis primary & secondary replicas.
106- // - After a role switch (e.g., from secondary to primary), some changes in configuration are needed
107- // to reflect the new role.
108- //
109- // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 1.1.0"
110- // +optional
111- DownwardAPIChangeTriggeredActions []DownwardAPIChangeTriggeredAction `json:"downwardAPIChangeTriggeredActions,omitempty"`
112-
11387 // Specifies the policy when parameter be removed.
11488 //
11589 // +optional
@@ -123,6 +97,7 @@ type ParametersDefinitionSpec struct {
12397 // This flag allows for more efficient handling of configuration changes by potentially eliminating
12498 // an unnecessary reload step.
12599 //
100+ // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 1.2.0"
126101 // +optional
127102 MergeReloadAndRestart * bool `json:"mergeReloadAndRestart,omitempty"`
128103
@@ -136,6 +111,7 @@ type ParametersDefinitionSpec struct {
136111 // The "all" option is for certain engines that require static parameters to be set
137112 // via SQL statements before they can take effect on restart.
138113 //
114+ // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 1.2.0"
139115 // +optional
140116 ReloadStaticParamsBeforeRestart * bool `json:"reloadStaticParamsBeforeRestart,omitempty"`
141117
@@ -206,23 +182,11 @@ type ParametersDefinitionStatus struct {
206182//
207183// Only one of the mechanisms can be specified at a time.
208184type ReloadAction struct {
209- // Used to trigger a reload by sending a specific Unix signal to the process.
210- //
211- // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 1.1.0"
212- // +optional
213- UnixSignalTrigger * UnixSignalTrigger `json:"unixSignalTrigger,omitempty"`
214-
215185 // Allows to execute a custom shell script to reload the process.
216186 //
217187 // +optional
218188 ShellTrigger * ShellTrigger `json:"shellTrigger,omitempty"`
219189
220- // Enables reloading process using a Go template script.
221- //
222- // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 1.1.0"
223- // +optional
224- TPLScriptTrigger * TPLScriptTrigger `json:"tplScriptTrigger"`
225-
226190 // Automatically perform the reload when specified conditions are met.
227191 //
228192 // +optional
@@ -240,19 +204,6 @@ type ReloadAction struct {
240204 TargetPodSelector * metav1.LabelSelector `json:"targetPodSelector,omitempty"`
241205}
242206
243- // UnixSignalTrigger is used to trigger a reload by sending a specific Unix signal to the process.
244- type UnixSignalTrigger struct {
245- // Specifies a valid Unix signal to be sent.
246- //
247- // +kubebuilder:validation:Required
248- Signal SignalType `json:"signal"`
249-
250- // Identifies the name of the process to which the Unix signal will be sent.
251- //
252- // +kubebuilder:validation:Required
253- ProcessName string `json:"processName"`
254- }
255-
256207// ToolsSetup prepares the tools for dynamic reloads used in ShellTrigger from a specified container image.
257208//
258209// Example:
@@ -375,41 +326,6 @@ type ImageMapping struct {
375326 Image string `json:"image"`
376327}
377328
378- // DownwardAPIChangeTriggeredAction defines an action that triggers specific commands in response to changes in Pod labels.
379- // For example, a command might be executed when the 'role' label of the Pod is updated.
380- type DownwardAPIChangeTriggeredAction struct {
381- // Specifies the name of the field. It must be a string of maximum length 63.
382- // The name should match the regex pattern `^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`.
383- //
384- // +kubebuilder:validation:Required
385- // +kubebuilder:validation:MaxLength=63
386- // +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
387- Name string `json:"name"`
388-
389- // Specifies the mount point of the Downward API volume.
390- //
391- // +kubebuilder:validation:Required
392- // +kubebuilder:validation:MaxLength=128
393- MountPoint string `json:"mountPoint"`
394-
395- // Represents a list of files under the Downward API volume.
396- //
397- // +kubebuilder:validation:Required
398- Items []corev1.DownwardAPIVolumeFile `json:"items"`
399-
400- // Specifies the command to be triggered when changes are detected in Downward API volume files.
401- // It relies on the inotify mechanism in the config-manager sidecar to monitor file changes.
402- //
403- // +optional
404- Command []string `json:"command,omitempty"`
405-
406- // ScriptConfig object specifies a ConfigMap that contains script files that should be mounted inside the pod.
407- // The scripts are mounted as volumes and can be referenced and executed by the DownwardAction to perform specific tasks or configurations.
408- //
409- // +optional
410- ScriptConfig * ScriptConfig `json:"scriptConfig,omitempty"`
411- }
412-
413329type ScriptConfig struct {
414330 // Specifies the reference to the ConfigMap containing the scripts.
415331 //
@@ -441,49 +357,6 @@ type ShellTrigger struct {
441357 // +optional
442358 Sync * bool `json:"sync,omitempty"`
443359
444- // Controls whether parameter updates are processed individually or collectively in a batch:
445- //
446- // - 'True': Processes all changes in one batch reload.
447- // - 'False': Processes each change individually.
448- //
449- // Defaults to 'False' if unspecified.
450- //
451- // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 1.1.0"
452- // +optional
453- BatchReload * bool `json:"batchReload,omitempty"`
454-
455- // Specifies a Go template string for formatting batch input data.
456- // It's used when `batchReload` is 'True' to format data passed into STDIN of the script.
457- // The template accesses key-value pairs of updated parameters via the '$' variable.
458- // This allows for custom formatting of the input data.
459- //
460- // Example template:
461- //
462- // ```yaml
463- // batchParamsFormatterTemplate: |-
464- // {{- range $pKey, $pValue := $ }}
465- // {{ printf "%s:%s" $pKey $pValue }}
466- // {{- end }}
467- // ```
468- //
469- // This example generates batch input data in a key:value format, sorted by keys.
470- // ```
471- // key1:value1
472- // key2:value2
473- // key3:value3
474- // ```
475- //
476- // If not specified, the default format is key=value, sorted by keys, for each updated parameter.
477- // ```
478- // key1=value1
479- // key2=value2
480- // key3=value3
481- // ```
482- //
483- // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 1.1.0"
484- // +optional
485- BatchParamsFormatterTemplate string `json:"batchParamsFormatterTemplate,omitempty"`
486-
487360 // Specifies the tools container image used by ShellTrigger for dynamic reload.
488361 // If the dynamic reload action is triggered by a ShellTrigger, this field is required.
489362 // This image must contain all necessary tools for executing the ShellTrigger scripts.
@@ -502,24 +375,6 @@ type ShellTrigger struct {
502375 ScriptConfig * ScriptConfig `json:"scriptConfig,omitempty"`
503376}
504377
505- // TPLScriptTrigger Enables reloading process using a Go template script.
506- type TPLScriptTrigger struct {
507- // Specifies the ConfigMap that contains the script to be executed for reload.
508- //
509- ScriptConfig `json:",inline"`
510-
511- // Determines whether parameter updates should be synchronized with the "config-manager".
512- // Specifies the controller's reload strategy:
513- //
514- // - If set to 'True', the controller executes the reload action in synchronous mode,
515- // pausing execution until the reload completes.
516- // - If set to 'False', the controller executes the reload action in asynchronous mode,
517- // updating the ConfigMap without waiting for the reload process to finish.
518- //
519- // +optional
520- Sync * bool `json:"sync,omitempty"`
521- }
522-
523378// AutoTrigger automatically perform the reload when specified conditions are met.
524379type AutoTrigger struct {
525380 // The name of the process.
0 commit comments