v1beta1

package
v0.9.0-beta.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 12 Imported by: 6

Documentation

Overview

+k8s:deepcopy-gen=package,register +k8s:openapi-gen=true +groupName=apps.kubeblocks.io

Package v1beta1 contains API Schema definitions for the apps v1beta1 API group +kubebuilder:object:generate=true +groupName=apps.kubeblocks.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "apps.kubeblocks.io", Version: "v1beta1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = GroupVersion

SchemeGroupVersion is group version used to register these objects.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AutoTrigger

type AutoTrigger struct {
	// The name of the process.
	//
	// +optional
	ProcessName string `json:"processName,omitempty"`
}

AutoTrigger automatically perform the reload when specified conditions are met.

func (*AutoTrigger) DeepCopy

func (in *AutoTrigger) DeepCopy() *AutoTrigger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoTrigger.

func (*AutoTrigger) DeepCopyInto

func (in *AutoTrigger) DeepCopyInto(out *AutoTrigger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CfgFileFormat

type CfgFileFormat string

CfgFileFormat defines formatter of configuration files. +enum +kubebuilder:validation:Enum={xml,ini,yaml,json,hcl,dotenv,toml,properties,redis,props-plus}

const (
	Ini            CfgFileFormat = "ini"
	YAML           CfgFileFormat = "yaml"
	JSON           CfgFileFormat = "json"
	XML            CfgFileFormat = "xml"
	HCL            CfgFileFormat = "hcl"
	Dotenv         CfgFileFormat = "dotenv"
	TOML           CfgFileFormat = "toml"
	Properties     CfgFileFormat = "properties"
	RedisCfg       CfgFileFormat = "redis"
	PropertiesPlus CfgFileFormat = "props-plus"
)

type ConfigConstraint

type ConfigConstraint struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ConfigConstraintSpec   `json:"spec,omitempty"`
	Status ConfigConstraintStatus `json:"status,omitempty"`
}

ConfigConstraint manages the parameters across multiple configuration files contained in a single configure template. These configuration files should have the same format (e.g. ini, xml, properties, json).

It provides the following functionalities:

1. **Parameter Value Validation**: Validates and ensures compliance of parameter values with defined constraints. 2. **Dynamic Reload on Modification**: Monitors parameter changes and triggers dynamic reloads to apply updates. 3. **Parameter Rendering in Templates**: Injects parameters into templates to generate up-to-date configuration files.

+genclient +k8s:openapi-gen=true +genclient:nonNamespaced +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:storageversion +kubebuilder:resource:categories={kubeblocks},scope=Cluster,shortName=cc +kubebuilder:printcolumn:name="PHASE",type="string",JSONPath=".status.phase",description="status phase" +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"

func (*ConfigConstraint) DeepCopy

func (in *ConfigConstraint) DeepCopy() *ConfigConstraint

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigConstraint.

func (*ConfigConstraint) DeepCopyInto

func (in *ConfigConstraint) DeepCopyInto(out *ConfigConstraint)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ConfigConstraint) DeepCopyObject

func (in *ConfigConstraint) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ConfigConstraint) Hub

func (r *ConfigConstraint) Hub()

func (*ConfigConstraint) SetupWebhookWithManager

func (r *ConfigConstraint) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*ConfigConstraint) ValidateCreate

func (r *ConfigConstraint) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*ConfigConstraint) ValidateDelete

func (r *ConfigConstraint) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*ConfigConstraint) ValidateUpdate

func (r *ConfigConstraint) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type ConfigConstraintList

type ConfigConstraintList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ConfigConstraint `json:"items"`
}

ConfigConstraintList contains a list of ConfigConstraints.

+kubebuilder:object:root=true

func (*ConfigConstraintList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigConstraintList.

func (*ConfigConstraintList) DeepCopyInto

func (in *ConfigConstraintList) DeepCopyInto(out *ConfigConstraintList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ConfigConstraintList) DeepCopyObject

func (in *ConfigConstraintList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ConfigConstraintPhase

type ConfigConstraintPhase string

ConfigConstraintPhase defines the ConfigConstraint CR .status.phase +enum +kubebuilder:validation:Enum={Available,Unavailable, Deleting}

const (
	CCAvailablePhase   ConfigConstraintPhase = "Available"
	CCUnavailablePhase ConfigConstraintPhase = "Unavailable"
	CCDeletingPhase    ConfigConstraintPhase = "Deleting"
)

type ConfigConstraintSpec

type ConfigConstraintSpec struct {
	// Specifies the dynamic reload (dynamic reconfiguration) actions supported by the engine.
	// When set, the controller executes the scripts defined in these actions to handle dynamic parameter updates.
	//
	// Dynamic reloading is triggered only if both of the following conditions are met:
	//
	// 1. The modified parameters are listed in the `dynamicParameters` field.
	//    If `dynamicParameterSelectedPolicy` is set to "all", modifications to `staticParameters`
	//    can also trigger a reload.
	// 2. `dynamicReloadAction` is set.
	//
	// If `dynamicReloadAction` is not set or the modified parameters are not listed in `dynamicParameters`,
	// dynamic reloading will not be triggered.
	//
	// Example:
	// “`yaml
	// reloadOptions:
	//  tplScriptTrigger:
	//    namespace: kb-system
	//    scriptConfigMapRef: mysql-reload-script
	//    sync: true
	// “`
	//
	// +optional
	DynamicReloadAction *DynamicReloadAction `json:"dynamicReloadAction,omitempty"`

	// Indicates whether to consolidate dynamic reload and restart actions into a single restart.
	//
	// - If true, updates requiring both actions will result in only a restart, merging the actions.
	// - If false, updates will trigger both actions executed sequentially: first dynamic reload, then restart.
	//
	// This flag allows for more efficient handling of configuration changes by potentially eliminating
	// an unnecessary reload step.
	//
	// +optional
	DynamicActionCanBeMerged *bool `json:"dynamicActionCanBeMerged,omitempty"`

	// Configures whether the dynamic reload specified in `dynamicReloadAction` applies only to dynamic parameters or
	// to all parameters (including static parameters).
	//
	// - "dynamic" (default): Only modifications to the dynamic parameters listed in `dynamicParameters`
	//   will trigger a dynamic reload.
	// - "all": Modifications to both dynamic parameters listed in `dynamicParameters` and static parameters
	//   listed in `staticParameters` will trigger a dynamic reload.
	//   The "all" option is for certain engines that require static parameters to be set
	//   via SQL statements before they can take effect on restart.
	//
	// +optional
	DynamicParameterSelectedPolicy *DynamicParameterSelectedPolicy `json:"dynamicParameterSelectedPolicy,omitempty"`

	// Specifies the tools container image used by ShellTrigger for dynamic reload.
	// If the dynamic reload action is triggered by a ShellTrigger, this field is required.
	// This image must contain all necessary tools for executing the ShellTrigger scripts.
	//
	// Usually the specified image is referenced by the init container,
	// which is then responsible for copy the tools from the image to a bin volume.
	// This ensures that the tools are available to the 'config-manager' sidecar.
	//
	// +optional
	ReloadToolsImage *ReloadToolsImage `json:"reloadToolsImage,omitempty"`

	// Specifies a list of actions to execute specified commands based on Pod labels.
	//
	// It utilizes the K8s Downward API to mount label information as a volume into the pod.
	// The 'config-manager' sidecar container watches for changes in the role label and dynamically invoke
	// registered commands (usually execute some SQL statements) when a change is detected.
	//
	// It is designed for scenarios where:
	//
	// - Replicas with different roles have different configurations, such as Redis primary & secondary replicas.
	// - After a role switch (e.g., from secondary to primary), some changes in configuration are needed
	//   to reflect the new role.
	//
	// +optional
	DownwardActions []DownwardAction `json:"downwardActions,omitempty"`

	// A list of ScriptConfig Object.
	//
	// Each ScriptConfig object specifies a ConfigMap that contains script files that should be mounted inside the pod.
	// The scripts are mounted as volumes and can be referenced and executed by the dynamic reload
	// and DownwardAction to perform specific tasks or configurations.
	//
	// +optional
	// +patchMergeKey=scriptConfigMapRef
	// +patchStrategy=merge,retainKeys
	// +listType=map
	// +listMapKey=scriptConfigMapRef
	ScriptConfigs []ScriptConfig `json:"scriptConfigs,omitempty"`

	// Specifies the top-level key in the 'configSchema.cue' that organizes the validation rules for parameters.
	// This key must exist within the CUE script defined in 'configSchema.cue'.
	//
	// +optional
	ConfigSchemaTopLevelKey string `json:"configSchemaTopLevelKey,omitempty"`

	// Defines a list of parameters including their names, default values, descriptions,
	// types, and constraints (permissible values or the range of valid values).
	//
	// +optional
	ConfigSchema *ConfigSchema `json:"configSchema,omitempty"`

	// List static parameters.
	// Modifications to any of these parameters require a restart of the process to take effect.
	//
	// +listType=set
	// +optional
	StaticParameters []string `json:"staticParameters,omitempty"`

	// List dynamic parameters.
	// Modifications to these parameters trigger a configuration reload without requiring a process restart.
	//
	// +listType=set
	// +optional
	DynamicParameters []string `json:"dynamicParameters,omitempty"`

	// Lists the parameters that cannot be modified once set.
	// Attempting to change any of these parameters will be ignored.
	//
	// +listType=set
	// +optional
	ImmutableParameters []string `json:"immutableParameters,omitempty"`

	// Used to match labels on the pod to determine whether a dynamic reload should be performed.
	//
	// In some scenarios, only specific pods (e.g., primary replicas) need to undergo a dynamic reload.
	// The `dynamicReloadSelector` allows you to specify label selectors to target the desired pods for the reload process.
	//
	// If the `dynamicReloadSelector` is not specified or is nil, all pods managed by the workload will be considered for the dynamic
	// reload.
	//
	// +optional
	DynamicReloadSelector *metav1.LabelSelector `json:"dynamicReloadSelector,omitempty"`

	// Specifies the format of the configuration file and any associated parameters that are specific to the chosen format.
	// Supported formats include `ini`, `xml`, `yaml`, `json`, `hcl`, `dotenv`, `properties`, and `toml`.
	//
	// Each format may have its own set of parameters that can be configured.
	// For instance, when using the `ini` format, you can specify the section name.
	//
	// Example:
	// “`
	// formatterConfig:
	//  format: ini
	//  iniConfig:
	//    sectionName: mysqld
	// “`
	//
	// +kubebuilder:validation:Required
	FormatterConfig *FormatterConfig `json:"formatterConfig"`
}

ConfigConstraintSpec defines the desired state of ConfigConstraint

func (*ConfigConstraintSpec) BatchReload

func (in *ConfigConstraintSpec) BatchReload() bool

func (*ConfigConstraintSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigConstraintSpec.

func (*ConfigConstraintSpec) DeepCopyInto

func (in *ConfigConstraintSpec) DeepCopyInto(out *ConfigConstraintSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ConfigConstraintSpec) DynamicParametersPolicy

func (in *ConfigConstraintSpec) DynamicParametersPolicy() DynamicParameterSelectedPolicy

func (*ConfigConstraintSpec) NeedDynamicReloadAction

func (in *ConfigConstraintSpec) NeedDynamicReloadAction() bool

func (*ConfigConstraintSpec) ShellTrigger

func (in *ConfigConstraintSpec) ShellTrigger() bool

type ConfigConstraintStatus

type ConfigConstraintStatus struct {

	// Specifies the status of the configuration template.
	// When set to CCAvailablePhase, the ConfigConstraint can be referenced by ClusterDefinition or ClusterVersion.
	//
	// +optional
	Phase ConfigConstraintPhase `json:"phase,omitempty"`

	// Provides descriptions for abnormal states.
	//
	// +optional
	Message string `json:"message,omitempty"`

	// Refers to the most recent generation observed for this ConfigConstraint. This value is updated by the API Server.
	//
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

ConfigConstraintStatus represents the observed state of a ConfigConstraint.

func (*ConfigConstraintStatus) ConfigConstraintTerminalPhases

func (cs *ConfigConstraintStatus) ConfigConstraintTerminalPhases() bool

func (*ConfigConstraintStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigConstraintStatus.

func (*ConfigConstraintStatus) DeepCopyInto

func (in *ConfigConstraintStatus) DeepCopyInto(out *ConfigConstraintStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConfigSchema

type ConfigSchema struct {
	// Hold a string that contains a script written in CUE language that defines a list of configuration items.
	// Each item is detailed with its name, default value, description, type (e.g. string, integer, float),
	// and constraints (permissible values or the valid range of values).
	//
	// CUE (Configure, Unify, Execute) is a declarative language designed for defining and validating
	// complex data configurations.
	// It is particularly useful in environments like K8s where complex configurations and validation rules are common.
	//
	// This script functions as a validator for user-provided configurations, ensuring compliance with
	// the established specifications and constraints.
	//
	// +optional
	CUE string `json:"cue,omitempty"`

	// Generated from the 'cue' field and transformed into a JSON format.
	//
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:ComponentDefRef=object
	// +kubebuilder:pruning:PreserveUnknownFields
	SchemaInJSON *apiext.JSONSchemaProps `json:"schemaInJSON,omitempty"`
}

ConfigSchema Defines a list of configuration items with their names, default values, descriptions, types, and constraints.

func (*ConfigSchema) DeepCopy

func (in *ConfigSchema) DeepCopy() *ConfigSchema

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSchema.

func (*ConfigSchema) DeepCopyInto

func (in *ConfigSchema) DeepCopyInto(out *ConfigSchema)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DownwardAction

type DownwardAction struct {
	// Specifies the name of the field. It must be a string of maximum length 63.
	// The name should match the regex pattern `^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
	Name string `json:"name"`

	// Specifies the mount point of the Downward API volume.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=128
	MountPoint string `json:"mountPoint"`

	// Represents a list of files under the Downward API volume.
	//
	// +kubebuilder:validation:Required
	Items []corev1.DownwardAPIVolumeFile `json:"items"`

	// Specifies the command to be triggered when changes are detected in Downward API volume files.
	// It relies on the inotify mechanism in the config-manager sidecar to monitor file changes.
	//
	// +optional
	Command []string `json:"command,omitempty"`
}

DownwardAction defines an action that triggers specific commands in response to changes in Pod labels. For example, a command might be executed when the 'role' label of the Pod is updated.

func (*DownwardAction) DeepCopy

func (in *DownwardAction) DeepCopy() *DownwardAction

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DownwardAction.

func (*DownwardAction) DeepCopyInto

func (in *DownwardAction) DeepCopyInto(out *DownwardAction)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DynamicParameterSelectedPolicy

type DynamicParameterSelectedPolicy string

DynamicParameterSelectedPolicy determines how to select the parameters of dynamic reload actions

+enum +kubebuilder:validation:Enum={all,dynamic}

const (
	SelectedAllParameters     DynamicParameterSelectedPolicy = "all"
	SelectedDynamicParameters DynamicParameterSelectedPolicy = "dynamic"
)

type DynamicReloadAction

type DynamicReloadAction struct {
	// Used to trigger a reload by sending a specific Unix signal to the process.
	//
	// +optional
	UnixSignalTrigger *UnixSignalTrigger `json:"unixSignalTrigger,omitempty"`

	// Allows to execute a custom shell script to reload the process.
	//
	// +optional
	ShellTrigger *ShellTrigger `json:"shellTrigger,omitempty"`

	// Enables reloading process using a Go template script.
	//
	// +optional
	TPLScriptTrigger *TPLScriptTrigger `json:"tplScriptTrigger"`

	// Automatically perform the reload when specified conditions are met.
	//
	// +optional
	AutoTrigger *AutoTrigger `json:"autoTrigger,omitempty"`
}

DynamicReloadAction defines the mechanisms available for dynamically reloading a process within K8s without requiring a restart.

Only one of the mechanisms can be specified at a time.

func (*DynamicReloadAction) DeepCopy

func (in *DynamicReloadAction) DeepCopy() *DynamicReloadAction

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicReloadAction.

func (*DynamicReloadAction) DeepCopyInto

func (in *DynamicReloadAction) DeepCopyInto(out *DynamicReloadAction)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DynamicReloadType

type DynamicReloadType string

DynamicReloadType defines reload method. +enum

const (
	UnixSignalType DynamicReloadType = "signal"
	SQLType        DynamicReloadType = "sql"
	ShellType      DynamicReloadType = "exec"
	HTTPType       DynamicReloadType = "http"
	TPLScriptType  DynamicReloadType = "tpl"
	AutoType       DynamicReloadType = "auto"
)

type FormatterAction

type FormatterAction struct {
	// Holds options specific to the 'ini' file format.
	//
	// +optional
	IniConfig *IniConfig `json:"iniConfig,omitempty"`
}

FormatterAction configures format-specific options for different configuration file format. Note: Only one of its members should be specified at any given time.

func (*FormatterAction) DeepCopy

func (in *FormatterAction) DeepCopy() *FormatterAction

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FormatterAction.

func (*FormatterAction) DeepCopyInto

func (in *FormatterAction) DeepCopyInto(out *FormatterAction)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FormatterConfig

type FormatterConfig struct {
	// Each format may have its own set of parameters that can be configured.
	// For instance, when using the `ini` format, you can specify the section name.
	//
	// +optional
	FormatterAction `json:",inline"`

	// The config file format. Valid values are `ini`, `xml`, `yaml`, `json`,
	// `hcl`, `dotenv`, `properties` and `toml`. Each format has its own characteristics and use cases.
	//
	// - ini: is a text-based content with a structure and syntax comprising key–value pairs for properties, reference wiki: https://en.wikipedia.org/wiki/INI_file
	// - xml: refers to wiki: https://en.wikipedia.org/wiki/XML
	// - yaml: supports for complex data types and structures.
	// - json: refers to wiki: https://en.wikipedia.org/wiki/JSON
	// - hcl: The HashiCorp Configuration Language (HCL) is a configuration language authored by HashiCorp, reference url: https://www.linode.com/docs/guides/introduction-to-hcl/
	// - dotenv: is a plain text file with simple key–value pairs, reference wiki: https://en.wikipedia.org/wiki/Configuration_file#MS-DOS
	// - properties: a file extension mainly used in Java, reference wiki: https://en.wikipedia.org/wiki/.properties
	// - toml: refers to wiki: https://en.wikipedia.org/wiki/TOML
	// - props-plus: a file extension mainly used in Java, supports CamelCase(e.g: brokerMaxConnectionsPerIp)
	//
	// +kubebuilder:validation:Required
	Format CfgFileFormat `json:"format"`
}

FormatterConfig specifies the format of the configuration file and any associated parameters that are specific to the chosen format.

func (*FormatterConfig) DeepCopy

func (in *FormatterConfig) DeepCopy() *FormatterConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FormatterConfig.

func (*FormatterConfig) DeepCopyInto

func (in *FormatterConfig) DeepCopyInto(out *FormatterConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IniConfig

type IniConfig struct {
	// A string that describes the name of the ini section.
	//
	// +optional
	SectionName string `json:"sectionName,omitempty"`
}

IniConfig holds options specific to the 'ini' file format.

func (*IniConfig) DeepCopy

func (in *IniConfig) DeepCopy() *IniConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IniConfig.

func (*IniConfig) DeepCopyInto

func (in *IniConfig) DeepCopyInto(out *IniConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReloadToolsImage

type ReloadToolsImage struct {

	// Specifies the directory path in the container where the tools-related files are to be copied.
	// This field is typically used with an emptyDir volume to ensure a temporary, empty directory is provided at pod creation.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=128
	MountPoint string `json:"mountPoint"`

	// Specifies a list of settings of init containers that prepare tools for dynamic reload.
	//
	// +optional
	ToolConfigs []ToolConfig `json:"toolConfigs,omitempty"`
}

ReloadToolsImage specifies the tools container image used by ShellTrigger for dynamic reload.

func (*ReloadToolsImage) DeepCopy

func (in *ReloadToolsImage) DeepCopy() *ReloadToolsImage

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReloadToolsImage.

func (*ReloadToolsImage) DeepCopyInto

func (in *ReloadToolsImage) DeepCopyInto(out *ReloadToolsImage)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ScriptConfig

type ScriptConfig struct {
	// Specifies the reference to the ConfigMap that contains the script to be executed for reload.
	//
	// +kubebuilder:validation:Required
	ScriptConfigMapRef string `json:"scriptConfigMapRef"`

	// Specifies the namespace where the referenced tpl script ConfigMap in.
	// If left empty, by default in the "default" namespace.
	//
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:default="default"
	// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$`
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

ScriptConfig specifies the ConfigMap that contains the script to be executed for reload.

func (*ScriptConfig) DeepCopy

func (in *ScriptConfig) DeepCopy() *ScriptConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScriptConfig.

func (*ScriptConfig) DeepCopyInto

func (in *ScriptConfig) DeepCopyInto(out *ScriptConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ShellTrigger

type ShellTrigger struct {
	// Specifies the command to execute in order to reload the process. It should be a valid shell command.
	//
	// +kubebuilder:validation:Required
	Command []string `json:"command"`

	// Determines whether parameter updates should be synchronized with the config manager.
	// Specifies the controller's reload strategy:
	//
	// - If set to 'True', the controller executes the reload action in synchronous mode,
	//   pausing execution until the reload completes.
	// - If set to 'False', the controller executes the reload action in asynchronous mode,
	//   updating the ConfigMap without waiting for the reload process to finish.
	//
	// +optional
	Sync *bool `json:"sync,omitempty"`

	// Specifies whether to process dynamic parameter updates individually or collectively in a batch:
	//
	// - Set to 'True' to execute all parameter changes in one batch reload action.
	// - Set to 'False' to execute a reload action for each individual parameter change.
	// The default behavior, if not specified, is 'False'.
	//
	// +optional
	BatchReload *bool `json:"batchReload,omitempty"`

	// BatchParametersTemplate provides an optional Go template string to format the batch input data
	// passed into the STDIN of the script when `batchReload` is set to 'True'.
	// The template uses the updated parameters' key-value pairs, accessible via the '$' variable.
	// This allows for custom formatting of the input data.
	// Example template:
	//
	// “`yaml
	// batchParametersTemplate: |-
	// {{- range $pKey, $pValue := $ }}
	// {{ printf "%s:%s" $pKey $pValue }}
	// {{- end }}
	// “`
	//
	// This example generates batch input data in a key:value format, sorted by keys.
	// “`
	// key1:value1
	// key2:value2
	// key3:value3
	// “`
	//
	// If not specified, the default format is key=value, sorted by keys, for each updated parameter.
	// “`
	// key1=value1
	// key2=value2
	// key3=value3
	// “`
	//
	// +optional
	BatchParametersTemplate string `json:"batchParametersTemplate,omitempty"`
}

ShellTrigger allows to execute a custom shell script to reload the process.

func (*ShellTrigger) DeepCopy

func (in *ShellTrigger) DeepCopy() *ShellTrigger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShellTrigger.

func (*ShellTrigger) DeepCopyInto

func (in *ShellTrigger) DeepCopyInto(out *ShellTrigger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SignalType

type SignalType string

SignalType defines which signals are valid. +enum +kubebuilder:validation:Enum={SIGHUP,SIGINT,SIGQUIT,SIGILL,SIGTRAP,SIGABRT,SIGBUS,SIGFPE,SIGKILL,SIGUSR1,SIGSEGV,SIGUSR2,SIGPIPE,SIGALRM,SIGTERM,SIGSTKFLT,SIGCHLD,SIGCONT,SIGSTOP,SIGTSTP,SIGTTIN,SIGTTOU,SIGURG,SIGXCPU,SIGXFSZ,SIGVTALRM,SIGPROF,SIGWINCH,SIGIO,SIGPWR,SIGSYS}

const (
	SIGHUP    SignalType = "SIGHUP"
	SIGINT    SignalType = "SIGINT"
	SIGQUIT   SignalType = "SIGQUIT"
	SIGILL    SignalType = "SIGILL"
	SIGTRAP   SignalType = "SIGTRAP"
	SIGABRT   SignalType = "SIGABRT"
	SIGBUS    SignalType = "SIGBUS"
	SIGFPE    SignalType = "SIGFPE"
	SIGKILL   SignalType = "SIGKILL"
	SIGUSR1   SignalType = "SIGUSR1"
	SIGSEGV   SignalType = "SIGSEGV"
	SIGUSR2   SignalType = "SIGUSR2"
	SIGPIPE   SignalType = "SIGPIPE"
	SIGALRM   SignalType = "SIGALRM"
	SIGTERM   SignalType = "SIGTERM"
	SIGSTKFLT SignalType = "SIGSTKFLT"
	SIGCHLD   SignalType = "SIGCHLD"
	SIGCONT   SignalType = "SIGCONT"
	SIGSTOP   SignalType = "SIGSTOP"
	SIGTSTP   SignalType = "SIGTSTP"
	SIGTTIN   SignalType = "SIGTTIN"
	SIGTTOU   SignalType = "SIGTTOU"
	SIGURG    SignalType = "SIGURG"
	SIGXCPU   SignalType = "SIGXCPU"
	SIGXFSZ   SignalType = "SIGXFSZ"
	SIGVTALRM SignalType = "SIGVTALRM"
	SIGPROF   SignalType = "SIGPROF"
	SIGWINCH  SignalType = "SIGWINCH"
	SIGIO     SignalType = "SIGIO"
	SIGPWR    SignalType = "SIGPWR"
	SIGSYS    SignalType = "SIGSYS"
)

type TPLScriptTrigger

type TPLScriptTrigger struct {
	// Specifies the ConfigMap that contains the script to be executed for reload.
	//
	ScriptConfig `json:",inline"`

	// Determines whether parameter updates should be synchronized with the config manager.
	// Specifies the controller's reload strategy:
	//
	// - If set to 'True', the controller executes the reload action in synchronous mode,
	//   pausing execution until the reload completes.
	// - If set to 'False', the controller executes the reload action in asynchronous mode,
	//   updating the ConfigMap without waiting for the reload process to finish.
	//
	// +optional
	Sync *bool `json:"sync,omitempty"`
}

TPLScriptTrigger Enables reloading process using a Go template script.

func (*TPLScriptTrigger) DeepCopy

func (in *TPLScriptTrigger) DeepCopy() *TPLScriptTrigger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TPLScriptTrigger.

func (*TPLScriptTrigger) DeepCopyInto

func (in *TPLScriptTrigger) DeepCopyInto(out *TPLScriptTrigger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ToolConfig

type ToolConfig struct {
	// Specifies the name of the init container.
	//
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern:=`^[a-z]([a-z0-9\-]*[a-z0-9])?$`
	Name string `json:"name,omitempty"`

	// Specifies the tool container image.
	//
	// +optional
	Image string `json:"image,omitempty"`

	// Specifies the command to be executed by the init container.
	//
	// +kubebuilder:validation:Required
	Command []string `json:"command"`
}

ToolConfig specifies the settings of an init container that prepare tools for dynamic reload.

func (*ToolConfig) DeepCopy

func (in *ToolConfig) DeepCopy() *ToolConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ToolConfig.

func (*ToolConfig) DeepCopyInto

func (in *ToolConfig) DeepCopyInto(out *ToolConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UnixSignalTrigger

type UnixSignalTrigger struct {
	// Specifies a valid Unix signal to be sent.
	// For a comprehensive list of all Unix signals, see: ../../pkg/configuration/configmap/handler.go:allUnixSignals
	//
	// +kubebuilder:validation:Required
	Signal SignalType `json:"signal"`

	// Identifies the name of the process to which the Unix signal will be sent.
	//
	// +kubebuilder:validation:Required
	ProcessName string `json:"processName"`
}

UnixSignalTrigger is used to trigger a reload by sending a specific Unix signal to the process.

func (*UnixSignalTrigger) DeepCopy

func (in *UnixSignalTrigger) DeepCopy() *UnixSignalTrigger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnixSignalTrigger.

func (*UnixSignalTrigger) DeepCopyInto

func (in *UnixSignalTrigger) DeepCopyInto(out *UnixSignalTrigger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL