@@ -336,7 +336,7 @@ type ComponentDefinitionSpec struct {
336
336
// +listType=map
337
337
// +listMapKey=name
338
338
// +optional
339
- Configs []ComponentConfigSpec `json:"configs,omitempty"`
339
+ Configs []ComponentTemplateSpec `json:"configs,omitempty"`
340
340
341
341
// Defines the types of logs generated by instances of the Component and their corresponding file paths.
342
342
// These logs can be collected for further analysis and monitoring.
@@ -1135,137 +1135,6 @@ type ComponentTemplateSpec struct {
1135
1135
DefaultMode * int32 `json:"defaultMode,omitempty" protobuf:"varint,3,opt,name=defaultMode"`
1136
1136
}
1137
1137
1138
- type ComponentConfigSpec struct {
1139
- ComponentTemplateSpec `json:",inline"`
1140
-
1141
- // Specifies the configuration files within the ConfigMap that support dynamic updates.
1142
- //
1143
- // A configuration template (provided in the form of a ConfigMap) may contain templates for multiple
1144
- // configuration files.
1145
- // Each configuration file corresponds to a key in the ConfigMap.
1146
- // Some of these configuration files may support dynamic modification and reloading without requiring
1147
- // a pod restart.
1148
- //
1149
- // If empty or omitted, all configuration files in the ConfigMap are assumed to support dynamic updates,
1150
- // and ConfigConstraint applies to all keys.
1151
- //
1152
- // +listType=set
1153
- // +optional
1154
- Keys []string `json:"keys,omitempty"`
1155
-
1156
- // Specifies the secondary rendered config spec for pod-specific customization.
1157
- //
1158
- // The template is rendered inside the pod (by the "config-manager" sidecar container) and merged with the main
1159
- // template's render result to generate the final configuration file.
1160
- //
1161
- // This field is intended to handle scenarios where different pods within the same Component have
1162
- // varying configurations. It allows for pod-specific customization of the configuration.
1163
- //
1164
- // Note: This field will be deprecated in future versions, and the functionality will be moved to
1165
- // `cluster.spec.componentSpecs[*].instances[*]`.
1166
- //
1167
- // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 0.9.0 and will be removed in 0.10.0"
1168
- // +optional
1169
- LegacyRenderedConfigSpec * LegacyRenderedTemplateSpec `json:"legacyRenderedConfigSpec,omitempty"`
1170
-
1171
- // Specifies the name of the referenced configuration constraints object.
1172
- //
1173
- // +kubebuilder:validation:MaxLength=63
1174
- // +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
1175
- // +optional
1176
- ConfigConstraintRef string `json:"constraintRef,omitempty"`
1177
-
1178
- // Specifies the containers to inject the ConfigMap parameters as environment variables.
1179
- //
1180
- // This is useful when application images accept parameters through environment variables and
1181
- // generate the final configuration file in the startup script based on these variables.
1182
- //
1183
- // This field allows users to specify a list of container names, and KubeBlocks will inject the environment
1184
- // variables converted from the ConfigMap into these designated containers. This provides a flexible way to
1185
- // pass the configuration items from the ConfigMap to the container without modifying the image.
1186
- //
1187
- // Deprecated: `asEnvFrom` has been deprecated since 0.9.0 and will be removed in 0.10.0.
1188
- // Use `injectEnvTo` instead.
1189
- //
1190
- // +kubebuilder:deprecatedversion:warning="This field has been deprecated since 0.9.0 and will be removed in 0.10.0"
1191
- // +listType=set
1192
- // +optional
1193
- AsEnvFrom []string `json:"asEnvFrom,omitempty"`
1194
-
1195
- // Specifies the containers to inject the ConfigMap parameters as environment variables.
1196
- //
1197
- // This is useful when application images accept parameters through environment variables and
1198
- // generate the final configuration file in the startup script based on these variables.
1199
- //
1200
- // This field allows users to specify a list of container names, and KubeBlocks will inject the environment
1201
- // variables converted from the ConfigMap into these designated containers. This provides a flexible way to
1202
- // pass the configuration items from the ConfigMap to the container without modifying the image.
1203
- //
1204
- //
1205
- // +listType=set
1206
- // +optional
1207
- InjectEnvTo []string `json:"injectEnvTo,omitempty"`
1208
-
1209
- // Specifies whether the configuration needs to be re-rendered after v-scale or h-scale operations to reflect changes.
1210
- //
1211
- // In some scenarios, the configuration may need to be updated to reflect the changes in resource allocation
1212
- // or cluster topology. Examples:
1213
- //
1214
- // - Redis: adjust maxmemory after v-scale operation.
1215
- // - MySQL: increase max connections after v-scale operation.
1216
- // - Zookeeper: update zoo.cfg with new node addresses after h-scale operation.
1217
- //
1218
- // +listType=set
1219
- // +optional
1220
- ReRenderResourceTypes []RerenderResourceType `json:"reRenderResourceTypes,omitempty"`
1221
-
1222
- // Whether to store the final rendered parameters as a secret.
1223
- //
1224
- // +optional
1225
- AsSecret * bool `json:"asSecret,omitempty"`
1226
- }
1227
-
1228
- // LegacyRenderedTemplateSpec describes the configuration extension for the lazy rendered template.
1229
- // Deprecated: LegacyRenderedTemplateSpec has been deprecated since 0.9.0 and will be removed in 0.10.0
1230
- type LegacyRenderedTemplateSpec struct {
1231
- // Extends the configuration template.
1232
- ConfigTemplateExtension `json:",inline"`
1233
- }
1234
-
1235
- type ConfigTemplateExtension struct {
1236
- // Specifies the name of the referenced configuration template ConfigMap object.
1237
- //
1238
- // +kubebuilder:validation:Required
1239
- // +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
1240
- TemplateRef string `json:"templateRef"`
1241
-
1242
- // Specifies the namespace of the referenced configuration template ConfigMap object.
1243
- // An empty namespace is equivalent to the "default" namespace.
1244
- //
1245
- // +kubebuilder:default="default"
1246
- // +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$`
1247
- // +optional
1248
- Namespace string `json:"namespace,omitempty"`
1249
-
1250
- // Defines the strategy for merging externally imported templates into component templates.
1251
- //
1252
- // +kubebuilder:default="none"
1253
- // +optional
1254
- Policy MergedPolicy `json:"policy,omitempty"`
1255
- }
1256
-
1257
- // MergedPolicy defines how to merge external imported templates into component templates.
1258
- // +enum
1259
- // +kubebuilder:validation:Enum={patch,replace,none}
1260
- type MergedPolicy string
1261
-
1262
- const (
1263
- PatchPolicy MergedPolicy = "patch"
1264
- ReplacePolicy MergedPolicy = "replace"
1265
- OnlyAddPolicy MergedPolicy = "add"
1266
- NoneMergePolicy MergedPolicy = "none"
1267
- )
1268
-
1269
1138
// RerenderResourceType defines the resource requirements for a component.
1270
1139
// +enum
1271
1140
// +kubebuilder:validation:Enum={vscale,hscale,tls}
0 commit comments