Skip to content

Commit 1d86fc0

Browse files
authored
chore: support reconfigure args (#10350)
1 parent 19bdb32 commit 1d86fc0

43 files changed

Lines changed: 642 additions & 84 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apis/apps/v1/componentdefinition_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ type ComponentFileTemplate struct {
11151115
//
11161116
// If specified, this action overrides the global reconfigure action defined in lifecycle actions
11171117
// for this specific file template.
1118+
// External-managed systems may define different behavior for this action entry.
11181119
//
11191120
// The container executing this action has access to following variables:
11201121
//

apis/apps/v1/types.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ type ClusterComponentConfig struct {
522522
// +optional
523523
Name *string `json:"name,omitempty"`
524524

525-
// Variables are key-value pairs for dynamic configuration values that can be provided by the user.
525+
// Variables are template variables used to render managed configuration templates.
526526
//
527527
// +optional
528528
Variables map[string]string `json:"variables,omitempty"`
@@ -571,6 +571,11 @@ type ClusterComponentConfig struct {
571571
//
572572
// +optional
573573
ReconfigureAction *Action `json:"reconfigureAction,omitempty"`
574+
575+
// ReconfigureArgs is a list of runtime argument groups for the reconfigure action.
576+
//
577+
// +optional
578+
ReconfigureArgs [][]string `json:"reconfigureArgs,omitempty"`
574579
}
575580

576581
// ClusterComponentConfigSource represents the source of a configuration for a component.

apis/apps/v1/zz_generated.deepcopy.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/parameters/v1alpha1/parametersdefinition_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ type ParametersDefinitionSpec struct {
147147

148148
// List dynamic parameters.
149149
// Modifications to these parameters trigger a configuration reload without requiring a process restart.
150+
// When parameter updates are applied through a ComponentDefinition config template reconfigure ExecAction,
151+
// the controller invokes the action once for each updated
152+
// parameter and appends the parameter name and value as the last arguments.
153+
// HTTP and gRPC reconfigure actions are not currently supported for parameter updates.
150154
//
151155
// +listType=set
152156
// +optional

apis/workloads/v1/instanceset_types.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,15 @@ type ConfigTemplate struct {
556556
// +optional
557557
ReconfigureActionName string `json:"reconfigureActionName,omitempty"`
558558

559-
// The parameters to call the reconfigure action.
559+
// The env/template parameters to call the reconfigure action.
560560
//
561561
// +optional
562562
Parameters map[string]string `json:"parameters,omitempty"`
563+
564+
// ReconfigureArgs is the runtime argv payload for the reconfigure action.
565+
//
566+
// +optional
567+
ReconfigureArgs [][]string `json:"reconfigureArgs,omitempty"`
563568
}
564569

565570
type InstanceStatus struct {

apis/workloads/v1/zz_generated.deepcopy.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/apps.kubeblocks.io_clusters.yaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -713,15 +713,23 @@ spec:
713713
format: int32
714714
type: integer
715715
type: object
716+
reconfigureArgs:
717+
description: ReconfigureArgs is a list of runtime argument
718+
groups for the reconfigure action.
719+
items:
720+
items:
721+
type: string
722+
type: array
723+
type: array
716724
restart:
717725
description: Specifies whether to restart the component
718726
to reload the updated configuration.
719727
type: boolean
720728
variables:
721729
additionalProperties:
722730
type: string
723-
description: Variables are key-value pairs for dynamic
724-
configuration values that can be provided by the user.
731+
description: Variables are template variables used to
732+
render managed configuration templates.
725733
type: object
726734
type: object
727735
type: array
@@ -11927,16 +11935,23 @@ spec:
1192711935
format: int32
1192811936
type: integer
1192911937
type: object
11938+
reconfigureArgs:
11939+
description: ReconfigureArgs is a list of runtime
11940+
argument groups for the reconfigure action.
11941+
items:
11942+
items:
11943+
type: string
11944+
type: array
11945+
type: array
1193011946
restart:
1193111947
description: Specifies whether to restart the component
1193211948
to reload the updated configuration.
1193311949
type: boolean
1193411950
variables:
1193511951
additionalProperties:
1193611952
type: string
11937-
description: Variables are key-value pairs for dynamic
11938-
configuration values that can be provided by the
11939-
user.
11953+
description: Variables are template variables used
11954+
to render managed configuration templates.
1194011955
type: object
1194111956
type: object
1194211957
type: array

config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3733,6 +3733,7 @@ spec:
37333733

37343734
If specified, this action overrides the global reconfigure action defined in lifecycle actions
37353735
for this specific file template.
3736+
External-managed systems may define different behavior for this action entry.
37363737

37373738
The container executing this action has access to following variables:
37383739

@@ -17567,6 +17568,7 @@ spec:
1756717568

1756817569
If specified, this action overrides the global reconfigure action defined in lifecycle actions
1756917570
for this specific file template.
17571+
External-managed systems may define different behavior for this action entry.
1757017572

1757117573
The container executing this action has access to following variables:
1757217574

config/crd/bases/apps.kubeblocks.io_components.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,15 +595,23 @@ spec:
595595
format: int32
596596
type: integer
597597
type: object
598+
reconfigureArgs:
599+
description: ReconfigureArgs is a list of runtime argument groups
600+
for the reconfigure action.
601+
items:
602+
items:
603+
type: string
604+
type: array
605+
type: array
598606
restart:
599607
description: Specifies whether to restart the component to reload
600608
the updated configuration.
601609
type: boolean
602610
variables:
603611
additionalProperties:
604612
type: string
605-
description: Variables are key-value pairs for dynamic configuration
606-
values that can be provided by the user.
613+
description: Variables are template variables used to render
614+
managed configuration templates.
607615
type: object
608616
type: object
609617
type: array

config/crd/bases/apps.kubeblocks.io_sidecardefinitions.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ spec:
109109
110110
If specified, this action overrides the global reconfigure action defined in lifecycle actions
111111
for this specific file template.
112+
External-managed systems may define different behavior for this action entry.
112113
113114
The container executing this action has access to following variables:
114115
@@ -1968,6 +1969,7 @@ spec:
19681969
19691970
If specified, this action overrides the global reconfigure action defined in lifecycle actions
19701971
for this specific file template.
1972+
External-managed systems may define different behavior for this action entry.
19711973
19721974
The container executing this action has access to following variables:
19731975

0 commit comments

Comments
 (0)