diff --git a/apis/apps/v1alpha1/componentdefinition_types.go b/apis/apps/v1alpha1/componentdefinition_types.go index 376b87d7cfb..f5f2f3a24a4 100644 --- a/apis/apps/v1alpha1/componentdefinition_types.go +++ b/apis/apps/v1alpha1/componentdefinition_types.go @@ -508,22 +508,34 @@ type Action struct { RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"` } +type LifecycleActionHandler struct { + // builtinHandler specifies the builtin handler name to do the action. + // Different lifecycleActions support different BuiltinHandlers. Details can be queried through official documentation in the future. + // use CustomHandler to define your own actions if none of them satisfies the requirement. + // +optional + BuiltinHandler *string `json:"builtinHandlerName,omitempty"` + + // customHandler defines the custom way to do action. + // +optional + CustomHandler *Action `json:"customHandler,omitempty"` +} + // ComponentLifecycleActions defines a set of operational actions for interacting with component services and processes. type ComponentLifecycleActions struct { // PostStart is called immediately after a component is created. // Cannot be updated. // +optional - PostStart *Action `json:"postStart,omitempty"` + PostStart *LifecycleActionHandler `json:"postStart,omitempty"` // PreStop is called immediately before a component is terminated due to an API request. // Cannot be updated. // +optional - PreStop *Action `json:"preStop,omitempty"` + PreStop *LifecycleActionHandler `json:"preStop,omitempty"` // RoleProbe defines how to probe the role of replicas. // Cannot be updated. // +optional - RoleProbe *corev1.Probe `json:"roleProbe,omitempty"` + RoleProbe *RoleProbeSpec `json:"roleProbe,omitempty"` // Switchover defines how to proactively switch the current leader to a new replica to minimize the impact on availability. // This action is typically invoked when the leader is about to become unavailable due to events, such as: @@ -543,7 +555,7 @@ type ComponentLifecycleActions struct { // It may involve updating configuration, notifying other members, and ensuring data consistency. // Cannot be updated. // +optional - MemberJoin *Action `json:"memberJoin,omitempty"` + MemberJoin *LifecycleActionHandler `json:"memberJoin,omitempty"` // MemberLeave defines how to remove a replica from the replication group. // This action is typically invoked when a replica needs to be removed, such as during scale-in. @@ -551,18 +563,18 @@ type ComponentLifecycleActions struct { // but it is advisable to avoid performing data migration within this action. // Cannot be updated. // +optional - MemberLeave *Action `json:"memberLeave,omitempty"` + MemberLeave *LifecycleActionHandler `json:"memberLeave,omitempty"` // Readonly defines how to set a replica service as read-only. // This action is used to protect a replica in case of volume space exhaustion or excessive traffic. // Cannot be updated. // +optional - Readonly *Action `json:"readonly,omitempty"` + Readonly *LifecycleActionHandler `json:"readonly,omitempty"` // Readwrite defines how to set a replica service as read-write. // Cannot be updated. // +optional - Readwrite *Action `json:"readwrite,omitempty"` + Readwrite *LifecycleActionHandler `json:"readwrite,omitempty"` // DataPopulate defines how to populate the data to create new replicas. // This action is typically used when a new replica needs to be constructed, such as: @@ -572,7 +584,7 @@ type ComponentLifecycleActions struct { // It should write the valid data to stdout without including any extraneous information. // Cannot be updated. // +optional - DataPopulate *Action `json:"dataPopulate,omitempty"` + DataPopulate *LifecycleActionHandler `json:"dataPopulate,omitempty"` // DataAssemble defines how to assemble data synchronized from external before starting the service for a new replica. // This action is typically used when creating a new replica, such as: @@ -583,17 +595,17 @@ type ComponentLifecycleActions struct { // the action must be able to guarantee idempotence to allow for retries from the beginning. // Cannot be updated. // +optional - DataAssemble *Action `json:"dataAssemble,omitempty"` + DataAssemble *LifecycleActionHandler `json:"dataAssemble,omitempty"` // Reconfigure defines how to notify the replica service that there is a configuration update. // Cannot be updated. // +optional - Reconfigure *Action `json:"reconfigure,omitempty"` + Reconfigure *LifecycleActionHandler `json:"reconfigure,omitempty"` // AccountProvision defines how to provision accounts. // Cannot be updated. // +optional - AccountProvision *Action `json:"accountProvision,omitempty"` + AccountProvision *LifecycleActionHandler `json:"accountProvision,omitempty"` } type ComponentSwitchoverSpec struct { @@ -611,6 +623,44 @@ type ComponentSwitchoverSpec struct { ScriptSpecSelectors []ScriptSpecSelector `json:"scriptSpecSelectors,omitempty"` } +type RoleProbeSpec struct { + LifecycleActionHandler `json:",inline"` + + // Number of seconds after the container has started before liveness probes are initiated. + // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + // +optional + InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty" protobuf:"varint,2,opt,name=initialDelaySeconds"` + // Number of seconds after which the probe times out. + // Defaults to 1 second. Minimum value is 1. + // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + // +optional + TimeoutSeconds int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,3,opt,name=timeoutSeconds"` + // How often (in seconds) to perform the probe. + // Default to 10 seconds. Minimum value is 1. + // +optional + PeriodSeconds int32 `json:"periodSeconds,omitempty" protobuf:"varint,4,opt,name=periodSeconds"` + // Minimum consecutive successes for the probe to be considered successful after having failed. + // Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + // +optional + SuccessThreshold int32 `json:"successThreshold,omitempty" protobuf:"varint,5,opt,name=successThreshold"` + // Minimum consecutive failures for the probe to be considered failed after having succeeded. + // Defaults to 3. Minimum value is 1. + // +optional + FailureThreshold int32 `json:"failureThreshold,omitempty" protobuf:"varint,6,opt,name=failureThreshold"` + // Optional duration in seconds the pod needs to terminate gracefully upon probe failure. + // The grace period is the duration in seconds after the processes running in the pod are sent + // a termination signal and the time when the processes are forcibly halted with a kill signal. + // Set this value longer than the expected cleanup time for your process. + // If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this + // value overrides the value provided by the pod spec. + // Value must be non-negative integer. The value zero indicates stop immediately via + // the kill signal (no opportunity to shut down). + // This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. + // Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + // +optional + TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty" protobuf:"varint,7,opt,name=terminationGracePeriodSeconds"` +} + // ValidateEnabledLogConfigs validates enabledLogs against component compDefName, and returns the invalid logNames undefined in ComponentDefinition. func (r *ComponentDefinition) ValidateEnabledLogConfigs(enabledLogs []string) []string { invalidLogNames := make([]string, 0, len(enabledLogs)) diff --git a/apis/apps/v1alpha1/zz_generated.deepcopy.go b/apis/apps/v1alpha1/zz_generated.deepcopy.go index 8a2440f2b1f..56de1244a2b 100644 --- a/apis/apps/v1alpha1/zz_generated.deepcopy.go +++ b/apis/apps/v1alpha1/zz_generated.deepcopy.go @@ -1721,17 +1721,17 @@ func (in *ComponentLifecycleActions) DeepCopyInto(out *ComponentLifecycleActions *out = *in if in.PostStart != nil { in, out := &in.PostStart, &out.PostStart - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } if in.PreStop != nil { in, out := &in.PreStop, &out.PreStop - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } if in.RoleProbe != nil { in, out := &in.RoleProbe, &out.RoleProbe - *out = new(v1.Probe) + *out = new(RoleProbeSpec) (*in).DeepCopyInto(*out) } if in.Switchover != nil { @@ -1741,42 +1741,42 @@ func (in *ComponentLifecycleActions) DeepCopyInto(out *ComponentLifecycleActions } if in.MemberJoin != nil { in, out := &in.MemberJoin, &out.MemberJoin - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } if in.MemberLeave != nil { in, out := &in.MemberLeave, &out.MemberLeave - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } if in.Readonly != nil { in, out := &in.Readonly, &out.Readonly - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } if in.Readwrite != nil { in, out := &in.Readwrite, &out.Readwrite - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } if in.DataPopulate != nil { in, out := &in.DataPopulate, &out.DataPopulate - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } if in.DataAssemble != nil { in, out := &in.DataAssemble, &out.DataAssemble - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } if in.Reconfigure != nil { in, out := &in.Reconfigure, &out.Reconfigure - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } if in.AccountProvision != nil { in, out := &in.AccountProvision, &out.AccountProvision - *out = new(Action) + *out = new(LifecycleActionHandler) (*in).DeepCopyInto(*out) } } @@ -3214,6 +3214,31 @@ func (in *LegacyRenderedTemplateSpec) DeepCopy() *LegacyRenderedTemplateSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LifecycleActionHandler) DeepCopyInto(out *LifecycleActionHandler) { + *out = *in + if in.BuiltinHandler != nil { + in, out := &in.BuiltinHandler, &out.BuiltinHandler + *out = new(string) + **out = **in + } + if in.CustomHandler != nil { + in, out := &in.CustomHandler, &out.CustomHandler + *out = new(Action) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LifecycleActionHandler. +func (in *LifecycleActionHandler) DeepCopy() *LifecycleActionHandler { + if in == nil { + return nil + } + out := new(LifecycleActionHandler) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LogConfig) DeepCopyInto(out *LogConfig) { *out = *in @@ -3981,6 +4006,27 @@ func (in *RetryPolicy) DeepCopy() *RetryPolicy { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleProbeSpec) DeepCopyInto(out *RoleProbeSpec) { + *out = *in + in.LifecycleActionHandler.DeepCopyInto(&out.LifecycleActionHandler) + if in.TerminationGracePeriodSeconds != nil { + in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleProbeSpec. +func (in *RoleProbeSpec) DeepCopy() *RoleProbeSpec { + if in == nil { + return nil + } + out := new(RoleProbeSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SchedulePolicy) DeepCopyInto(out *SchedulePolicy) { *out = *in diff --git a/config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml b/config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml index 84f363bbfad..d78cba70c81 100644 --- a/config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml +++ b/config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml @@ -225,2647 +225,2982 @@ spec: description: AccountProvision defines how to provision accounts. Cannot be updated. properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object required: - name - - value type: object type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - dataAssemble: - description: 'DataAssemble defines how to assemble data synchronized - from external before starting the service for a new replica. - This action is typically used when creating a new replica, such - as: - scale-out - rebuild - clone The data will be streamed - in via stdin. If any error occurs during the assembly process, - the action must be able to guarantee idempotence to allow for - retries from the beginning. Cannot be updated.' - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes properties: - key: - description: The key to select. - type: string name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string - fieldPath: - description: Path of the field to select in - the specified API version. + value: + description: The header field value type: string required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key + - name + - value type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - path: - description: Path to access on the HTTP server. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer type: object - dataPopulate: - description: 'DataPopulate defines how to populate the data to - create new replicas. This action is typically used when a new - replica needs to be constructed, such as: - scale-out - rebuild - - clone It should write the valid data to stdout without including - any extraneous information. Cannot be updated.' + dataAssemble: + description: 'DataAssemble defines how to assemble data synchronized + from external before starting the service for a new replica. + This action is typically used when creating a new replica, such + as: - scale-out - rebuild - clone The data will be streamed + in via stdin. If any error occurs during the assembly process, + the action must be able to guarantee idempotence to allow for + retries from the beginning. Cannot be updated.' properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - memberJoin: - description: MemberJoin defines how to add a new replica to the - replication group. This action is typically invoked when a new - replica needs to be added, such as during scale-out. It may - involve updating configuration, notifying other members, and - ensuring data consistency. Cannot be updated. - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string required: - name - - value type: object type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - memberLeave: - description: MemberLeave defines how to remove a replica from - the replication group. This action is typically invoked when - a replica needs to be removed, such as during scale-in. It may - involve configuration updates and notifying other members about - the departure, but it is advisable to avoid performing data - migration within this action. Cannot be updated. - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes properties: - key: - description: The key to select. - type: string name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' + value: + description: The header field value type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean required: - - key + - name + - value type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - path: - description: Path to access on the HTTP server. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer type: object - postStart: - description: PostStart is called immediately after a component - is created. Cannot be updated. + dataPopulate: + description: 'DataPopulate defines how to populate the data to + create new replicas. This action is typically used when a new + replica needs to be constructed, such as: - scale-out - rebuild + - clone It should write the valid data to stdout without including + any extraneous information. Cannot be updated.' properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - preStop: - description: PreStop is called immediately before a component - is terminated due to an API request. Cannot be updated. - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean required: - - key + - name + - value type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + memberJoin: + description: MemberJoin defines how to add a new replica to the + replication group. This action is typically invoked when a new + replica needs to be added, such as during scale-out. It may + involve updating configuration, notifying other members, and + ensuring data consistency. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - type: string - type: array + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + memberLeave: + description: MemberLeave defines how to remove a replica from + the replication group. This action is typically invoked when + a replica needs to be removed, such as during scale-in. It may + involve configuration updates and notifying other members about + the departure, but it is advisable to avoid performing data + migration within this action. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. + properties: + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. + items: + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + postStart: + description: PostStart is called immediately after a component + is created. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. + properties: + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. + items: + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + preStop: + description: PreStop is called immediately before a component + is terminated due to an API request. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. + properties: + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. + items: + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + readonly: + description: Readonly defines how to set a replica service as + read-only. This action is used to protect a replica in case + of volume space exhaustion or excessive traffic. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. + properties: + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. + items: + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + type: object + readwrite: + description: Readwrite defines how to set a replica service as + read-write. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object required: - name - - value type: object type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer type: object - readonly: - description: Readonly defines how to set a replica service as - read-only. This action is used to protect a replica in case - of volume space exhaustion or excessive traffic. Cannot be updated. + reconfigure: + description: Reconfigure defines how to notify the replica service + that there is a configuration update. Cannot be updated. properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object required: - name - - value type: object type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - path: - description: Path to access on the HTTP server. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer type: object - readwrite: - description: Readwrite defines how to set a replica service as - read-write. Cannot be updated. + roleProbe: + description: RoleProbe defines how to probe the role of replicas. + Cannot be updated. properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - reconfigure: - description: Reconfigure defines how to notify the replica service - that there is a configuration update. Cannot be updated. - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes properties: - key: - description: The key to select. - type: string name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' + value: + description: The header field value type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean required: - - key + - name + - value type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - path: - description: Path to access on the HTTP server. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - roleProbe: - description: RoleProbe defines how to probe the role of replicas. - Cannot be updated. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving a GRPC port. - properties: - port: - description: Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is - defined by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object initialDelaySeconds: description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' @@ -2883,25 +3218,6 @@ spec: 1. format: int32 type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP - port. - properties: - host: - description: 'Optional: Host name to connect to, defaults - to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object terminationGracePeriodSeconds: description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period diff --git a/controllers/apps/transformer_cluster_component.go b/controllers/apps/transformer_cluster_component.go index 84a4bf3cd82..d9eb85f24a1 100644 --- a/controllers/apps/transformer_cluster_component.go +++ b/controllers/apps/transformer_cluster_component.go @@ -133,25 +133,9 @@ func copyAndMergeComponent(oldCompObj, newCompObj *appsv1alpha1.Component, clust compObjCopy := oldCompObj.DeepCopy() compProto := newCompObj - // mergeAnnotations keeps the original annotations. - mergeMetadataMap := func(originalMap map[string]string, targetMap *map[string]string) { - if targetMap == nil || originalMap == nil { - return - } - if *targetMap == nil { - *targetMap = map[string]string{} - } - for k, v := range originalMap { - // if the annotation not exist in targetAnnotations, copy it from original. - if _, ok := (*targetMap)[k]; !ok { - (*targetMap)[k] = v - } - } - } - // merge labels and annotations - mergeMetadataMap(compObjCopy.Annotations, &compProto.Annotations) - mergeMetadataMap(compObjCopy.Labels, &compProto.Labels) + ictrlutil.MergeMetadataMap(compObjCopy.Annotations, &compProto.Annotations) + ictrlutil.MergeMetadataMap(compObjCopy.Labels, &compProto.Labels) compObjCopy.Annotations = compProto.Annotations compObjCopy.Labels = compProto.Labels diff --git a/deploy/helm/crds/apps.kubeblocks.io_componentdefinitions.yaml b/deploy/helm/crds/apps.kubeblocks.io_componentdefinitions.yaml index 84f363bbfad..d78cba70c81 100644 --- a/deploy/helm/crds/apps.kubeblocks.io_componentdefinitions.yaml +++ b/deploy/helm/crds/apps.kubeblocks.io_componentdefinitions.yaml @@ -225,2647 +225,2982 @@ spec: description: AccountProvision defines how to provision accounts. Cannot be updated. properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object required: - name - - value type: object type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - dataAssemble: - description: 'DataAssemble defines how to assemble data synchronized - from external before starting the service for a new replica. - This action is typically used when creating a new replica, such - as: - scale-out - rebuild - clone The data will be streamed - in via stdin. If any error occurs during the assembly process, - the action must be able to guarantee idempotence to allow for - retries from the beginning. Cannot be updated.' - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes properties: - key: - description: The key to select. - type: string name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string - fieldPath: - description: Path of the field to select in - the specified API version. + value: + description: The header field value type: string required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key + - name + - value type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - path: - description: Path to access on the HTTP server. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer type: object - dataPopulate: - description: 'DataPopulate defines how to populate the data to - create new replicas. This action is typically used when a new - replica needs to be constructed, such as: - scale-out - rebuild - - clone It should write the valid data to stdout without including - any extraneous information. Cannot be updated.' + dataAssemble: + description: 'DataAssemble defines how to assemble data synchronized + from external before starting the service for a new replica. + This action is typically used when creating a new replica, such + as: - scale-out - rebuild - clone The data will be streamed + in via stdin. If any error occurs during the assembly process, + the action must be able to guarantee idempotence to allow for + retries from the beginning. Cannot be updated.' properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - memberJoin: - description: MemberJoin defines how to add a new replica to the - replication group. This action is typically invoked when a new - replica needs to be added, such as during scale-out. It may - involve updating configuration, notifying other members, and - ensuring data consistency. Cannot be updated. - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string required: - name - - value type: object type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - memberLeave: - description: MemberLeave defines how to remove a replica from - the replication group. This action is typically invoked when - a replica needs to be removed, such as during scale-in. It may - involve configuration updates and notifying other members about - the departure, but it is advisable to avoid performing data - migration within this action. Cannot be updated. - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes properties: - key: - description: The key to select. - type: string name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' + value: + description: The header field value type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean required: - - key + - name + - value type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - path: - description: Path to access on the HTTP server. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer type: object - postStart: - description: PostStart is called immediately after a component - is created. Cannot be updated. + dataPopulate: + description: 'DataPopulate defines how to populate the data to + create new replicas. This action is typically used when a new + replica needs to be constructed, such as: - scale-out - rebuild + - clone It should write the valid data to stdout without including + any extraneous information. Cannot be updated.' properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - preStop: - description: PreStop is called immediately before a component - is terminated due to an API request. Cannot be updated. - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean required: - - key + - name + - value type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + memberJoin: + description: MemberJoin defines how to add a new replica to the + replication group. This action is typically invoked when a new + replica needs to be added, such as during scale-out. It may + involve updating configuration, notifying other members, and + ensuring data consistency. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - type: string - type: array + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + memberLeave: + description: MemberLeave defines how to remove a replica from + the replication group. This action is typically invoked when + a replica needs to be removed, such as during scale-in. It may + involve configuration updates and notifying other members about + the departure, but it is advisable to avoid performing data + migration within this action. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. + properties: + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. + items: + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + postStart: + description: PostStart is called immediately after a component + is created. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. + properties: + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. + items: + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + preStop: + description: PreStop is called immediately before a component + is terminated due to an API request. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. + properties: + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. + items: + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer + type: object + type: object + readonly: + description: Readonly defines how to set a replica service as + read-only. This action is used to protect a replica in case + of volume space exhaustion or excessive traffic. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. + properties: + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. + type: string + env: + description: List of environment variables to set in the + container. Cannot be updated. + items: + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. Must + be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. + type: string + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. + type: string + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: + default: 0 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 + type: integer type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + type: object + readwrite: + description: Readwrite defines how to set a replica service as + read-write. Cannot be updated. + properties: + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. + type: string + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object required: - name - - value type: object type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal + type: string + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer type: object - readonly: - description: Readonly defines how to set a replica service as - read-only. This action is used to protect a replica in case - of volume space exhaustion or excessive traffic. Cannot be updated. + reconfigure: + description: Reconfigure defines how to notify the replica service + that there is a configuration update. Cannot be updated. properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object required: - name - - value type: object type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - path: - description: Path to access on the HTTP server. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer type: object - readwrite: - description: Readwrite defines how to set a replica service as - read-write. Cannot be updated. + roleProbe: + description: RoleProbe defines how to probe the role of replicas. + Cannot be updated. properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. + builtinHandlerName: + description: builtinHandler specifies the builtin handler + name to do the action. Different lifecycleActions support + different BuiltinHandlers. Details can be queried through + official documentation in the future. use CustomHandler + to define your own actions if none of them satisfies the + requirement. type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. + customHandler: + description: customHandler defines the custom way to do action. properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. + container: + description: Container defines the name of the container + within the target Pod where the action will be executed. + If specified, it must be one of container declared in + @Runtime. Cannot be updated. type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. + env: + description: List of environment variables to set in the + container. Cannot be updated. items: - description: HTTPHeader describes a custom header to - be used in HTTP probes + description: EnvVar represents an environment variable + present in a Container. properties: name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. + description: Name of the environment variable. Must + be a C_IDENTIFIER. type: string value: - description: The header field value + description: 'Variable references $(VAR_NAME) are + expanded using the previously defined environment + variables in the container and any service environment + variables. If a variable cannot be resolved, the + reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows + for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" + will produce the string literal "$(VAR_NAME)". + Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults + to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports + metadata.name, metadata.namespace, `metadata.labels['''']`, + `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, + status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required for + volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format + of the exposed resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the + pod's namespace + properties: + key: + description: The key of the secret to select + from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + exec: + description: Exec specifies the action to take. Cannot + be updated. + properties: + args: + description: args is used to perform statements. + items: + type: string + type: array + command: + description: Command is the command line to execute + inside the container, the working directory for + the command is root ('/') in the container's filesystem. + The command is simply exec'd, it is not run inside + a shell, so traditional shell instructions ('|', + etc) won't work. To use a shell, you need to explicitly + call out to that shell. Exit status of 0 is treated + as live/healthy and non-zero is unhealthy. + items: type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. - type: string - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: - default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 - type: integer - type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - reconfigure: - description: Reconfigure defines how to notify the replica service - that there is a configuration update. Cannot be updated. - properties: - container: - description: Container defines the name of the container within - the target Pod where the action will be executed. If specified, - it must be one of container declared in @Runtime. Cannot - be updated. - type: string - env: - description: List of environment variables to set in the container. - Cannot be updated. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must - be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded - using the previously defined environment variables - in the container and any service environment variables. - If a variable cannot be resolved, the reference in - the input string will be unchanged. Double $$ are - reduced to a single $, which allows for escaping the - $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce - the string literal "$(VAR_NAME)". Escaped references - will never be expanded, regardless of whether the - variable exists or not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. + type: array + type: object + http: + description: HTTP specifies the http request to perform. + Cannot be updated. + properties: + host: + description: Host name to connect to, defaults to + the pod IP. You probably want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes properties: - key: - description: The key to select. - type: string name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or - its key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: 'Selects a field of the pod: supports - metadata.name, metadata.namespace, `metadata.labels['''']`, - `metadata.annotations['''']`, spec.nodeName, - spec.serviceAccountName, status.hostIP, status.podIP, - status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in - the specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: 'Selects a resource of the container: - only resources limits and requests (limits.cpu, - limits.memory, limits.ephemeral-storage, requests.cpu, - requests.memory and requests.ephemeral-storage) - are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of - the exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select - from. Must be a valid secret key. + description: The header field name. This will + be canonicalized upon output, so case-variant + names will be understood as the same header. type: string - name: - description: 'Name of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, - kind, uid?' + value: + description: The header field value type: string - optional: - description: Specify whether the Secret or its - key must be defined - type: boolean required: - - key + - name + - value type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - exec: - description: Exec specifies the action to take. Cannot be - updated. - properties: - args: - description: args is used to perform statements. - items: - type: string - type: array - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object - http: - description: HTTP specifies the http request to perform. Cannot - be updated. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - method: - description: Method represents the HTTP request method, - which can be one of the standard HTTP methods like "GET," - "POST," "PUT," etc. Defaults to Get. + type: array + method: + description: Method represents the HTTP request method, + which can be one of the standard HTTP methods like + "GET," "POST," "PUT," etc. Defaults to Get. + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port to access + on the container. Number must be in the range 1 + to 65535. Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + image: + description: Image defines the container image to run + the action. Cannot be updated. type: string - path: - description: Path to access on the HTTP server. + matchingKey: + description: MatchingKey uses to select the target pod(s) + actually. If the selector is AnyReplica or AllReplicas, + the matchingKey will be ignored. If the selector is + RoleSelector, any replica which has the same role with + matchingKey will be chosen. Cannot be updated. type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. + preconditions:omitempty: + description: Preconditions represent conditions that must + be met before executing the action. If any precondition + is not met, the action will not be executed. Cannot + be updated. + type: object + retryPolicy: + description: RetryPolicy defines the strategy for retrying + the action in case of failure. Cannot be updated. + properties: + maxRetries: + default: 0 + description: MaxRetries specifies the maximum number + of times the action should be retried. + type: integer + retryInterval: + default: 0 + description: RetryInterval specifies the interval + between retry attempts. + format: int64 + type: integer + type: object + targetPodSelector: + description: TargetPodSelector defines the way that how + to select the target Pod where the action will be performed, + if there may not have a target replica by default. Cannot + be updated. + enum: + - Any + - All + - Pod + - Role + - Ordinal type: string - required: - - port - type: object - image: - description: Image defines the container image to run the - action. Cannot be updated. - type: string - matchingKey: - description: MatchingKey uses to select the target pod(s) - actually. If the selector is AnyReplica or AllReplicas, - the matchingKey will be ignored. If the selector is RoleSelector, - any replica which has the same role with matchingKey will - be chosen. Cannot be updated. - type: string - preconditions:omitempty: - description: Preconditions represent conditions that must - be met before executing the action. If any precondition - is not met, the action will not be executed. Cannot be updated. - type: object - retryPolicy: - description: RetryPolicy defines the strategy for retrying - the action in case of failure. Cannot be updated. - properties: - maxRetries: - default: 0 - description: MaxRetries specifies the maximum number of - times the action should be retried. - type: integer - retryInterval: + timeoutSeconds:omitempty: default: 0 - description: RetryInterval specifies the interval between - retry attempts. - format: int64 + description: TimeoutSeconds defines the timeout duration + for the action in seconds. Cannot be updated. + format: int32 type: integer type: object - targetPodSelector: - description: TargetPodSelector defines the way that how to - select the target Pod where the action will be performed, - if there may not have a target replica by default. Cannot - be updated. - enum: - - Any - - All - - Pod - - Role - - Ordinal - type: string - timeoutSeconds:omitempty: - default: 0 - description: TimeoutSeconds defines the timeout duration for - the action in seconds. Cannot be updated. - format: int32 - type: integer - type: object - roleProbe: - description: RoleProbe defines how to probe the role of replicas. - Cannot be updated. - properties: - exec: - description: Exec specifies the action to take. - properties: - command: - description: Command is the command line to execute inside - the container, the working directory for the command is - root ('/') in the container's filesystem. The command - is simply exec'd, it is not run inside a shell, so traditional - shell instructions ('|', etc) won't work. To use a shell, - you need to explicitly call out to that shell. Exit - status of 0 is treated as live/healthy and non-zero - is unhealthy. - items: - type: string - type: array - type: object failureThreshold: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. format: int32 type: integer - grpc: - description: GRPC specifies an action involving a GRPC port. - properties: - port: - description: Port number of the gRPC service. Number must - be in the range 1 to 65535. - format: int32 - type: integer - service: - description: "Service is the name of the service to place - in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). - \n If this is not specified, the default behavior is - defined by gRPC." - type: string - required: - - port - type: object - httpGet: - description: HTTPGet specifies the http request to perform. - properties: - host: - description: Host name to connect to, defaults to the - pod IP. You probably want to set "Host" in httpHeaders - instead. - type: string - httpHeaders: - description: Custom headers to set in the request. HTTP - allows repeated headers. - items: - description: HTTPHeader describes a custom header to - be used in HTTP probes - properties: - name: - description: The header field name. This will be - canonicalized upon output, so case-variant names - will be understood as the same header. - type: string - value: - description: The header field value - type: string - required: - - name - - value - type: object - type: array - path: - description: Path to access on the HTTP server. - type: string - port: - anyOf: - - type: integer - - type: string - description: Name or number of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - scheme: - description: Scheme to use for connecting to the host. - Defaults to HTTP. - type: string - required: - - port - type: object initialDelaySeconds: description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' @@ -2883,25 +3218,6 @@ spec: 1. format: int32 type: integer - tcpSocket: - description: TCPSocket specifies an action involving a TCP - port. - properties: - host: - description: 'Optional: Host name to connect to, defaults - to the pod IP.' - type: string - port: - anyOf: - - type: integer - - type: string - description: Number or name of the port to access on the - container. Number must be in the range 1 to 65535. Name - must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true - required: - - port - type: object terminationGracePeriodSeconds: description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period diff --git a/pkg/constant/const.go b/pkg/constant/const.go index 041327cc23c..b41c5fccda2 100644 --- a/pkg/constant/const.go +++ b/pkg/constant/const.go @@ -69,10 +69,15 @@ const ( AppName = "kubeblocks" - // K8s recommonded well-known labels and annotation keys - AppInstanceLabelKey = "app.kubernetes.io/instance" // - AppNameLabelKey = "app.kubernetes.io/name" // refer clusterDefinition.Name - AppComponentLabelKey = "app.kubernetes.io/component" // refer clusterDefinition.Spec.ComponentDefs[*].Name + // K8S recommended well-known labels and annotation keys + + // AppInstanceLabelKey refer cluster.Name + AppInstanceLabelKey = "app.kubernetes.io/instance" + // AppNameLabelKey refer clusterDefinition.Name before KubeBlocks Version 0.8.0 or refer ComponentDefinition.Name after KubeBlocks Version 0.8.0 (TODOļ¼šPending) + AppNameLabelKey = "app.kubernetes.io/name" + // AppComponentLabelKey refer clusterDefinition.Spec.ComponentDefs[*].Name before KubeBlocks Version 0.8.0 or refer ComponentDefinition.Name after KubeBlocks Version 0.8.0 + AppComponentLabelKey = "app.kubernetes.io/component" + // AppVersionLabelKey refer clusterVersion.Name before KubeBlocks Version 0.8.0 or refer ComponentDefinition.Name after KubeBlocks Version 0.8.0 AppVersionLabelKey = "app.kubernetes.io/version" AppManagedByLabelKey = "app.kubernetes.io/managed-by" RegionLabelKey = "topology.kubernetes.io/region" diff --git a/pkg/constant/labels.go b/pkg/constant/labels.go index e49f1add126..1293ff85431 100644 --- a/pkg/constant/labels.go +++ b/pkg/constant/labels.go @@ -29,7 +29,7 @@ func GetKBConfigMapWellKnownLabels(cmTplName, clusterDefName, clusterName, compo } } -// GetKBWellKnownLabels returns the well-known labels for KB resources +// GetKBWellKnownLabels returns the well-known labels for KB resources with ClusterDefinition API func GetKBWellKnownLabels(clusterDefName, clusterName, componentName string) map[string]string { return map[string]string{ AppManagedByLabelKey: AppName, @@ -39,6 +39,16 @@ func GetKBWellKnownLabels(clusterDefName, clusterName, componentName string) map } } +// GetKBWellKnownLabelsWithCompDef returns the well-known labels for KB resources with ComponentDefinition API +func GetKBWellKnownLabelsWithCompDef(compDefName, clusterName, componentName string) map[string]string { + return map[string]string{ + AppManagedByLabelKey: AppName, + AppNameLabelKey: compDefName, // TODO: reusing AppNameLabelKey for compDefName ? + AppInstanceLabelKey: clusterName, + KBAppComponentLabelKey: componentName, + } +} + // GetComponentWellKnownLabels returns the well-known labels for Component API func GetComponentWellKnownLabels(clusterName, componentName string) map[string]string { return map[string]string{ @@ -48,6 +58,20 @@ func GetComponentWellKnownLabels(clusterName, componentName string) map[string]s } } +// GetAppVersionLabel returns the label for AppVersion +func GetAppVersionLabel(appVersion string) map[string]string { + return map[string]string{ + AppVersionLabelKey: appVersion, + } +} + +// GetComponentDefLabel returns the label for ComponentDefinition (refer ComponentDefinition.Name) +func GetComponentDefLabel(compDefName string) map[string]string { + return map[string]string{ + AppComponentLabelKey: compDefName, + } +} + // GetClusterCompDefLabel returns the label for ClusterComponentDefinition (refer clusterDefinition.Spec.ComponentDefs[*].Name) // TODO:ClusterCompDef will be deprecated in the future func GetClusterCompDefLabel(clusterCompDefName string) map[string]string { diff --git a/pkg/constant/pattern.go b/pkg/constant/pattern.go index 98afb1d7f71..7c0fa5e6aa7 100644 --- a/pkg/constant/pattern.go +++ b/pkg/constant/pattern.go @@ -60,3 +60,13 @@ func GenerateDefalutComponentHeadlessServiceEndpoint(clusterName, compName, name func GenerateClusterComponentPattern(clusterName, compName string) string { return fmt.Sprintf("%s-%s", clusterName, compName) } + +// GenerateRSMNamePattern generates rsm name pattern +func GenerateRSMNamePattern(clusterName, compName string) string { + return fmt.Sprintf("%s-%s", clusterName, compName) +} + +// GenerateRSMServiceNamePattern generates rsm name pattern +func GenerateRSMServiceNamePattern(rsmName string) string { + return fmt.Sprintf("%s-headless", rsmName) +} diff --git a/pkg/controller/component/component_definition_convertor.go b/pkg/controller/component/component_definition_convertor.go index bd6d9aa0dac..6abcf2e86d2 100644 --- a/pkg/controller/component/component_definition_convertor.go +++ b/pkg/controller/component/component_definition_convertor.go @@ -405,7 +405,7 @@ func (c *compDefLifecycleActionsConvertor) convert(args ...any) (any, error) { return lifecycleActions, nil // TODO } -func (c *compDefLifecycleActionsConvertor) convertRoleProbe(probe *appsv1alpha1.ClusterDefinitionProbe) *corev1.Probe { +func (c *compDefLifecycleActionsConvertor) convertRoleProbe(probe *appsv1alpha1.ClusterDefinitionProbe) *appsv1alpha1.RoleProbeSpec { if probe.Commands == nil || len(probe.Commands.Writes) == 0 || len(probe.Commands.Queries) == 0 { return nil } @@ -413,15 +413,18 @@ func (c *compDefLifecycleActionsConvertor) convertRoleProbe(probe *appsv1alpha1. if len(probe.Commands.Writes) == 0 { commands = probe.Commands.Queries } - return &corev1.Probe{ - ProbeHandler: corev1.ProbeHandler{ - Exec: &corev1.ExecAction{ - Command: commands, - }, - }, + + return &appsv1alpha1.RoleProbeSpec{ TimeoutSeconds: probe.TimeoutSeconds, PeriodSeconds: probe.PeriodSeconds, FailureThreshold: probe.FailureThreshold, + LifecycleActionHandler: appsv1alpha1.LifecycleActionHandler{ + CustomHandler: &appsv1alpha1.Action{ + Exec: &appsv1alpha1.ExecAction{ + Command: commands, + }, + }, + }, } } diff --git a/pkg/controller/component/rsm_convertor.go b/pkg/controller/component/rsm_convertor.go new file mode 100644 index 00000000000..ec0e87616c2 --- /dev/null +++ b/pkg/controller/component/rsm_convertor.go @@ -0,0 +1,199 @@ +/* +Copyright (C) 2022-2023 ApeCloud Co., Ltd + +This file is part of KubeBlocks project + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . +*/ + +package component + +import ( + "errors" + + appsv1alpha1 "github.com/apecloud/kubeblocks/apis/apps/v1alpha1" + workloads "github.com/apecloud/kubeblocks/apis/workloads/v1alpha1" +) + +// rsmServiceConvertor is an implementation of the convertor interface, used to convert the given object into ReplicatedStateMachine.Spec.Service. +type rsmServiceConvertor struct{} + +// rsmAlternativeServicesConvertor is an implementation of the convertor interface, used to convert the given object into ReplicatedStateMachine.Spec.AlternativeServices. +type rsmAlternativeServicesConvertor struct{} + +// rsmRolesConvertor is an implementation of the convertor interface, used to convert the given object into ReplicatedStateMachine.Spec.Roles. +type rsmRolesConvertor struct{} + +// rsmRoleProbeConvertor is an implementation of the convertor interface, used to convert the given object into ReplicatedStateMachine.Spec.RoleProbe. +type rsmRoleProbeConvertor struct{} + +// rsmMembershipReconfigurationConvertor is an implementation of the convertor interface, used to convert the given object into ReplicatedStateMachine.Spec.MembershipReconfiguration. +type rsmMembershipReconfigurationConvertor struct{} + +// rsmMemberUpdateStrategyConvertor is an implementation of the convertor interface, used to convert the given object into ReplicatedStateMachine.Spec.MemberUpdateStrategy. +type rsmMemberUpdateStrategyConvertor struct{} + +// BuildRSMFrom builds a new Component object based on Cluster, SynthesizedComponent. +func BuildRSMFrom(cluster *appsv1alpha1.Cluster, synthesizeComp *SynthesizedComponent, protoRSM *workloads.ReplicatedStateMachine) (*workloads.ReplicatedStateMachine, error) { + if cluster == nil || synthesizeComp == nil { + return nil, nil + } + if protoRSM == nil { + protoRSM = &workloads.ReplicatedStateMachine{} + } + convertors := map[string]convertor{ + "service": &rsmServiceConvertor{}, + "alternativeservices": &rsmAlternativeServicesConvertor{}, + "roles": &rsmRolesConvertor{}, + "roleprobe": &rsmRoleProbeConvertor{}, + "membershipreconfiguration": &rsmMembershipReconfigurationConvertor{}, + "memberupdatestrategy": &rsmMemberUpdateStrategyConvertor{}, + } + if err := covertObject(convertors, &protoRSM.Spec, cluster, synthesizeComp); err != nil { + return nil, err + } + return protoRSM, nil +} + +// parseRSMConvertorArgs parses the args of rsm convertor. +func parseRSMConvertorArgs(args ...any) (*appsv1alpha1.Cluster, *SynthesizedComponent, error) { + cluster, ok := args[0].(*appsv1alpha1.Cluster) + if !ok { + return nil, nil, errors.New("args[0] is not a cluster object") + } + synthesizeComp, ok := args[1].(*SynthesizedComponent) + if !ok { + return nil, nil, errors.New("args[1] not a SynthesizedComponent object") + } + return cluster, synthesizeComp, nil +} + +// rsmServiceConvertor converts the given object into ReplicatedStateMachine.Spec.Service. +// TODO(xingran): ComponentServices are not consistent with ReplicatedStateMachine.Spec.Service, If it is based on the new ComponentDefinition API, +// the services is temporarily handled in the component controller, and the corresponding ReplicatedStateMachine.Spec.Service is temporarily set nil. +func (c *rsmServiceConvertor) convert(args ...any) (any, error) { + /* + var compService appsv1alpha1.ComponentService + _, synthesizeComp, err := parseRSMConvertorArgs(args...) + if err != nil { + return nil, err + } + compServices := synthesizeComp.ComponentServices + if len(compServices) == 0 { + return nil, nil + } + // get the first component service as the rsm service + if len(compServices) > 0 { + compService = compServices[0] + } + + // TODO(xingran): ComponentService.Name and ComponentService.RoleSelector are not used in ReplicatedStateMachine.Spec.Service + rsmService := &corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: string(compService.ServiceName), + }, + Spec: compService.ServiceSpec, + } + return rsmService, nil + */ + return nil, nil +} + +// rsmAlternativeServicesConvertor converts the given object into ReplicatedStateMachine.Spec.AlternativeServices. +// TODO: ComponentServices are not consistent with ReplicatedStateMachine.Spec.AlternativeServices, If it is based on the new ComponentDefinition API, +// the services is temporarily handled in the component controller, and the corresponding ReplicatedStateMachine.Spec.AlternativeServices is temporarily set nil. +func (c *rsmAlternativeServicesConvertor) convert(args ...any) (any, error) { + return nil, nil +} + +// rsmRolesConvertor converts the ComponentDefinition.Spec.Roles into ReplicatedStateMachine.Spec.Roles. +func (c *rsmRolesConvertor) convert(args ...any) (any, error) { + _, synthesizeComp, err := parseRSMConvertorArgs(args...) + if err != nil { + return nil, err + } + rsmReplicaRoles := make([]workloads.ReplicaRole, len(synthesizeComp.Roles)) + compReplicaRoles := synthesizeComp.Roles + for _, compReplicaRole := range compReplicaRoles { + rsmReplicaRole := workloads.ReplicaRole{ + Name: compReplicaRole.Name, + IsLeader: false, + CanVote: false, + } + + if compReplicaRole.Writable { + rsmReplicaRole.IsLeader = true + rsmReplicaRole.CanVote = true + } + + // TODO(xingran): Serviceable equals to CanVote ? + if compReplicaRole.Serviceable { + rsmReplicaRole.CanVote = true + if compReplicaRole.Writable { + rsmReplicaRole.AccessMode = workloads.ReadWriteMode + } else { + rsmReplicaRole.AccessMode = workloads.ReadonlyMode + } + } else { + rsmReplicaRole.AccessMode = workloads.NoneMode + } + rsmReplicaRoles = append(rsmReplicaRoles, rsmReplicaRole) + } + return rsmReplicaRoles, nil +} + +// rsmRoleProbeConvertor converts the ComponentDefinition.Spec.LifecycleActions.RoleProbe into ReplicatedStateMachine.Spec.RoleProbe. +func (c *rsmRoleProbeConvertor) convert(args ...any) (any, error) { + _, synthesizeComp, err := parseRSMConvertorArgs(args...) + if err != nil { + return nil, err + } + + if synthesizeComp.LifecycleActions == nil || synthesizeComp.LifecycleActions.RoleProbe == nil { + return nil, nil + } + + rsmRoleProbe := &workloads.RoleProbe{ + InitialDelaySeconds: synthesizeComp.LifecycleActions.RoleProbe.InitialDelaySeconds, + TimeoutSeconds: synthesizeComp.LifecycleActions.RoleProbe.TimeoutSeconds, + PeriodSeconds: synthesizeComp.LifecycleActions.RoleProbe.PeriodSeconds, + SuccessThreshold: synthesizeComp.LifecycleActions.RoleProbe.SuccessThreshold, + FailureThreshold: synthesizeComp.LifecycleActions.RoleProbe.FailureThreshold, + } + + if synthesizeComp.LifecycleActions.RoleProbe.BuiltinHandler != nil { + rsmRoleProbe.BuiltinHandler = synthesizeComp.LifecycleActions.RoleProbe.BuiltinHandler + } + + // TODO(xingran): RSM Action does not support args[] yet + if synthesizeComp.LifecycleActions.RoleProbe.CustomHandler != nil { + rsmRoleProbeCmdAction := workloads.Action{ + Image: synthesizeComp.LifecycleActions.RoleProbe.CustomHandler.Image, + Command: synthesizeComp.LifecycleActions.RoleProbe.CustomHandler.Exec.Command, + } + rsmRoleProbe.CustomHandler = []workloads.Action{rsmRoleProbeCmdAction} + } + + return rsmRoleProbe, nil +} + +func (c *rsmMembershipReconfigurationConvertor) convert(args ...any) (any, error) { + // cluster, synthesizeComp, err := parseRSMConvertorArgs(args...) + return "", nil // TODO +} + +func (c *rsmMemberUpdateStrategyConvertor) convert(args ...any) (any, error) { + // cluster, synthesizeComp, err := parseRSMConvertorArgs(args...) + return "", nil // TODO +} diff --git a/pkg/controller/component/rsm_convertor_test.go b/pkg/controller/component/rsm_convertor_test.go new file mode 100644 index 00000000000..fdf0014c912 --- /dev/null +++ b/pkg/controller/component/rsm_convertor_test.go @@ -0,0 +1,28 @@ +/* +Copyright (C) 2022-2023 ApeCloud Co., Ltd + +This file is part of KubeBlocks project + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . +*/ + +package component + +import ( + . "github.com/onsi/ginkgo/v2" +) + +var _ = Describe("Test RSM Convertor", func() { + // TODO: add test cases +}) diff --git a/pkg/controller/factory/builder.go b/pkg/controller/factory/builder.go index cad64b62afa..3ff5984ecde 100644 --- a/pkg/controller/factory/builder.go +++ b/pkg/controller/factory/builder.go @@ -47,7 +47,6 @@ import ( "github.com/apecloud/kubeblocks/pkg/constant" "github.com/apecloud/kubeblocks/pkg/controller/builder" "github.com/apecloud/kubeblocks/pkg/controller/component" - "github.com/apecloud/kubeblocks/pkg/controller/rsm" intctrlutil "github.com/apecloud/kubeblocks/pkg/controllerutil" dptypes "github.com/apecloud/kubeblocks/pkg/dataprotection/types" ) @@ -247,144 +246,6 @@ func BuildSts(cluster *appsv1alpha1.Cluster, component *component.SynthesizedCom return sts, nil } -func BuildRSM(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*workloads.ReplicatedStateMachine, error) { - vctToPVC := func(vct corev1.PersistentVolumeClaimTemplate) corev1.PersistentVolumeClaim { - return corev1.PersistentVolumeClaim{ - ObjectMeta: vct.ObjectMeta, - Spec: vct.Spec, - } - } - - commonLabels := constant.GetKBWellKnownLabels(component.ClusterDefName, cluster.Name, component.Name) - addCommonLabels := func(service *corev1.Service) { - if service == nil { - return - } - labels := service.Labels - if labels == nil { - labels = make(map[string]string, 0) - } - for k, v := range commonLabels { - labels[k] = v - } - labels[constant.AppComponentLabelKey] = component.ClusterCompDefName - service.Labels = labels - } - - podBuilder := builder.NewPodBuilder("", ""). - AddLabelsInMap(commonLabels). - AddLabelsInMap(constant.GetClusterCompDefLabel(component.ClusterCompDefName)). - AddLabelsInMap(constant.GetWorkloadTypeLabel(string(component.WorkloadType))) - if len(cluster.Spec.ClusterVersionRef) > 0 { - podBuilder.AddLabelsInMap(constant.GetClusterVersionLabel(cluster.Spec.ClusterVersionRef)) - } - template := corev1.PodTemplateSpec{ - ObjectMeta: podBuilder.GetObject().ObjectMeta, - Spec: *component.PodSpec, - } - - monitorAnnotations := func() map[string]string { - annotations := make(map[string]string, 0) - falseStr := "false" - trueStr := "true" - switch { - case !component.Monitor.Enable: - annotations["monitor.kubeblocks.io/scrape"] = falseStr - annotations["monitor.kubeblocks.io/agamotto"] = falseStr - case component.Monitor.BuiltIn: - annotations["monitor.kubeblocks.io/scrape"] = falseStr - annotations["monitor.kubeblocks.io/agamotto"] = trueStr - default: - annotations["monitor.kubeblocks.io/scrape"] = trueStr - annotations["monitor.kubeblocks.io/path"] = component.Monitor.ScrapePath - annotations["monitor.kubeblocks.io/port"] = strconv.Itoa(int(component.Monitor.ScrapePort)) - annotations["monitor.kubeblocks.io/scheme"] = "http" - annotations["monitor.kubeblocks.io/agamotto"] = falseStr - } - return rsm.AddAnnotationScope(rsm.HeadlessServiceScope, annotations) - }() - rsmName := fmt.Sprintf("%s-%s", cluster.Name, component.Name) - rsmBuilder := builder.NewReplicatedStateMachineBuilder(cluster.Namespace, rsmName). - AddAnnotations(constant.KubeBlocksGenerationKey, strconv.FormatInt(cluster.Generation, 10)). - AddAnnotationsInMap(monitorAnnotations). - AddLabelsInMap(commonLabels). - AddLabelsInMap(constant.GetClusterCompDefLabel(component.ClusterCompDefName)). - AddMatchLabelsInMap(commonLabels). - SetServiceName(rsmName + "-headless"). - SetReplicas(component.Replicas). - SetTemplate(template) - - var vcts []corev1.PersistentVolumeClaim - for _, vct := range component.VolumeClaimTemplates { - vcts = append(vcts, vctToPVC(vct)) - } - rsmBuilder.SetVolumeClaimTemplates(vcts...) - - if component.StatefulSetWorkload != nil { - podManagementPolicy, updateStrategy := component.StatefulSetWorkload.FinalStsUpdateStrategy() - rsmBuilder.SetPodManagementPolicy(podManagementPolicy).SetUpdateStrategy(updateStrategy) - } - - service, alternativeServices := separateServices(component.Services) - addCommonLabels(service) - for i := range alternativeServices { - addCommonLabels(&alternativeServices[i]) - } - if service != nil { - rsmBuilder.SetService(service) - } - if len(alternativeServices) == 0 { - alternativeServices = nil - } - alternativeServices = fixService(cluster.Namespace, rsmName, component, alternativeServices...) - rsmBuilder.SetAlternativeServices(alternativeServices) - - secretName := fmt.Sprintf("%s-conn-credential", cluster.Name) - credential := workloads.Credential{ - Username: workloads.CredentialVar{ - ValueFrom: &corev1.EnvVarSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: secretName, - }, - Key: constant.AccountNameForSecret, - }, - }, - }, - Password: workloads.CredentialVar{ - ValueFrom: &corev1.EnvVarSource{ - SecretKeyRef: &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: secretName, - }, - Key: constant.AccountPasswdForSecret, - }, - }, - }, - } - rsmBuilder.SetCredential(credential) - - roles, roleProbe, membershipReconfiguration, memberUpdateStrategy := buildRoleInfo(component) - rsm := rsmBuilder.SetRoles(roles). - SetRoleProbe(roleProbe). - SetMembershipReconfiguration(membershipReconfiguration). - SetMemberUpdateStrategy(memberUpdateStrategy). - GetObject() - - // update sts.spec.volumeClaimTemplates[].metadata.labels - if len(rsm.Spec.VolumeClaimTemplates) > 0 && len(rsm.GetLabels()) > 0 { - for index, vct := range rsm.Spec.VolumeClaimTemplates { - BuildPersistentVolumeClaimLabels(component, &vct, vct.Name) - rsm.Spec.VolumeClaimTemplates[index] = vct - } - } - - if err := processContainersInjection(cluster, component, &rsm.Spec.Template.Spec); err != nil { - return nil, err - } - return rsm, nil -} - func fixService(namespace, prefix string, component *component.SynthesizedComponent, alternativeServices ...corev1.Service) []corev1.Service { leaderName := getLeaderName(component) for i := range alternativeServices { diff --git a/pkg/controller/factory/builder_rsm.go b/pkg/controller/factory/builder_rsm.go new file mode 100644 index 00000000000..fc9c334fae7 --- /dev/null +++ b/pkg/controller/factory/builder_rsm.go @@ -0,0 +1,287 @@ +/* +Copyright (C) 2022-2023 ApeCloud Co., Ltd + +This file is part of KubeBlocks project + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . +*/ + +package factory + +import ( + "strconv" + + corev1 "k8s.io/api/core/v1" + + appsv1alpha1 "github.com/apecloud/kubeblocks/apis/apps/v1alpha1" + workloads "github.com/apecloud/kubeblocks/apis/workloads/v1alpha1" + "github.com/apecloud/kubeblocks/pkg/constant" + "github.com/apecloud/kubeblocks/pkg/controller/builder" + "github.com/apecloud/kubeblocks/pkg/controller/component" + "github.com/apecloud/kubeblocks/pkg/controller/rsm" +) + +func BuildRSMWrapper(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*workloads.ReplicatedStateMachine, error) { + return nil, nil +} + +// BuildRSMFromConvertor builds a ReplicatedStateMachine object based on the new ComponentDefinition and Component API, and does not depend on the deprecated fields in the SynthesizedComponent. +func BuildRSMFromConvertor(cluster *appsv1alpha1.Cluster, synthesizeComp *component.SynthesizedComponent) (*workloads.ReplicatedStateMachine, error) { + commonLabels := constant.GetKBWellKnownLabelsWithCompDef(synthesizeComp.CompDefName, cluster.Name, synthesizeComp.Name) + + // TODO(xingran): Need to review how to set pod labels based on the new ComponentDefinition API. workloadType label has been removed. + podBuilder := builder.NewPodBuilder("", ""). + AddLabelsInMap(commonLabels). + AddLabelsInMap(constant.GetComponentDefLabel(synthesizeComp.CompDefName)). + AddLabelsInMap(constant.GetAppVersionLabel(synthesizeComp.CompDefName)) + + template := corev1.PodTemplateSpec{ + ObjectMeta: podBuilder.GetObject().ObjectMeta, + Spec: *synthesizeComp.PodSpec, + } + + monitorAnnotations := getMonitorAnnotations(synthesizeComp) + rsmName := constant.GenerateRSMNamePattern(cluster.Name, synthesizeComp.Name) + rsmBuilder := builder.NewReplicatedStateMachineBuilder(cluster.Namespace, rsmName). + AddAnnotations(constant.KubeBlocksGenerationKey, strconv.FormatInt(cluster.Generation, 10)). + AddAnnotationsInMap(monitorAnnotations). + AddLabelsInMap(commonLabels). + AddLabelsInMap(constant.GetComponentDefLabel(synthesizeComp.CompDefName)). + AddMatchLabelsInMap(commonLabels). + SetServiceName(constant.GenerateRSMServiceNamePattern(rsmName)). + SetReplicas(synthesizeComp.Replicas). + SetTemplate(template) + + var vcts []corev1.PersistentVolumeClaim + for _, vct := range synthesizeComp.VolumeClaimTemplates { + vcts = append(vcts, vctToPVC(vct)) + } + rsmBuilder.SetVolumeClaimTemplates(vcts...) + + // TODO(xingran): call rsm convertors to convert componentDef attributes to rsm attributes. including service, credential, roles, roleProbe, membershipReconfiguration, memberUpdateStrategy, etc. + rsm, err := component.BuildRSMFrom(cluster, synthesizeComp, rsmBuilder.GetObject()) + if err != nil { + return nil, err + } + + // return rsm, nil + + service, alternativeServices := separateServices(component.Services) + addServiceCommonLabels(service, commonLabels, synthesizeComp.CompDefName) + for i := range alternativeServices { + addServiceCommonLabels(&alternativeServices[i], commonLabels, synthesizeComp.CompDefName) + } + if service != nil { + rsmBuilder.SetService(service) + } + if len(alternativeServices) == 0 { + alternativeServices = nil + } + alternativeServices = fixService(cluster.Namespace, rsmName, component, alternativeServices...) + rsmBuilder.SetAlternativeServices(alternativeServices) + + secretName := constant.GenerateDefaultConnCredential(cluster.Name) + credential := workloads.Credential{ + Username: workloads.CredentialVar{ + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: secretName, + }, + Key: constant.AccountNameForSecret, + }, + }, + }, + Password: workloads.CredentialVar{ + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: secretName, + }, + Key: constant.AccountPasswdForSecret, + }, + }, + }, + } + rsmBuilder.SetCredential(credential) + + // update sts.spec.volumeClaimTemplates[].metadata.labels + if len(rsm.Spec.VolumeClaimTemplates) > 0 && len(rsm.GetLabels()) > 0 { + for index, vct := range rsm.Spec.VolumeClaimTemplates { + BuildPersistentVolumeClaimLabels(component, &vct, vct.Name) + rsm.Spec.VolumeClaimTemplates[index] = vct + } + } + + if err := processContainersInjection(cluster, synthesizeComp, &rsm.Spec.Template.Spec); err != nil { + return nil, err + } + return rsm, nil +} + +// BuildRSM builds a ReplicatedStateMachine object based on the old CLusterDefinition API, and depends on the the deprecated fields in the SynthesizedComponent. +// TODO(xingran): This function will be deprecated in the future, and the BuildRSMBaseOnCompDef function will be used instead. +func BuildRSM(cluster *appsv1alpha1.Cluster, component *component.SynthesizedComponent) (*workloads.ReplicatedStateMachine, error) { + commonLabels := constant.GetKBWellKnownLabels(component.ClusterDefName, cluster.Name, component.Name) + + podBuilder := builder.NewPodBuilder("", ""). + AddLabelsInMap(commonLabels). + AddLabelsInMap(constant.GetClusterCompDefLabel(component.ClusterCompDefName)). + AddLabelsInMap(constant.GetWorkloadTypeLabel(string(component.WorkloadType))) + if len(cluster.Spec.ClusterVersionRef) > 0 { + podBuilder.AddLabelsInMap(constant.GetClusterVersionLabel(cluster.Spec.ClusterVersionRef)) + } + template := corev1.PodTemplateSpec{ + ObjectMeta: podBuilder.GetObject().ObjectMeta, + Spec: *component.PodSpec, + } + + monitorAnnotations := getMonitorAnnotations(component) + rsmName := constant.GenerateRSMNamePattern(cluster.Name, component.Name) + rsmBuilder := builder.NewReplicatedStateMachineBuilder(cluster.Namespace, rsmName). + AddAnnotations(constant.KubeBlocksGenerationKey, strconv.FormatInt(cluster.Generation, 10)). + AddAnnotationsInMap(monitorAnnotations). + AddLabelsInMap(commonLabels). + AddLabelsInMap(constant.GetClusterCompDefLabel(component.ClusterCompDefName)). + AddMatchLabelsInMap(commonLabels). + SetServiceName(constant.GenerateRSMServiceNamePattern(rsmName)). + SetReplicas(component.Replicas). + SetTemplate(template) + + var vcts []corev1.PersistentVolumeClaim + for _, vct := range component.VolumeClaimTemplates { + vcts = append(vcts, vctToPVC(vct)) + } + rsmBuilder.SetVolumeClaimTemplates(vcts...) + + if component.StatefulSetWorkload != nil { + podManagementPolicy, updateStrategy := component.StatefulSetWorkload.FinalStsUpdateStrategy() + rsmBuilder.SetPodManagementPolicy(podManagementPolicy).SetUpdateStrategy(updateStrategy) + } + + service, alternativeServices := separateServices(component.Services) + addServiceCommonLabels(service, commonLabels, component.ClusterCompDefName) + for i := range alternativeServices { + addServiceCommonLabels(&alternativeServices[i], commonLabels, component.ClusterCompDefName) + } + if service != nil { + rsmBuilder.SetService(service) + } + if len(alternativeServices) == 0 { + alternativeServices = nil + } + alternativeServices = fixService(cluster.Namespace, rsmName, component, alternativeServices...) + rsmBuilder.SetAlternativeServices(alternativeServices) + + secretName := constant.GenerateDefaultConnCredential(cluster.Name) + credential := workloads.Credential{ + Username: workloads.CredentialVar{ + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: secretName, + }, + Key: constant.AccountNameForSecret, + }, + }, + }, + Password: workloads.CredentialVar{ + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: secretName, + }, + Key: constant.AccountPasswdForSecret, + }, + }, + }, + } + rsmBuilder.SetCredential(credential) + + roles, roleProbe, membershipReconfiguration, memberUpdateStrategy := buildRoleInfo(component) + rsm := rsmBuilder.SetRoles(roles). + SetRoleProbe(roleProbe). + SetMembershipReconfiguration(membershipReconfiguration). + SetMemberUpdateStrategy(memberUpdateStrategy). + GetObject() + + // update sts.spec.volumeClaimTemplates[].metadata.labels + if len(rsm.Spec.VolumeClaimTemplates) > 0 && len(rsm.GetLabels()) > 0 { + for index, vct := range rsm.Spec.VolumeClaimTemplates { + BuildPersistentVolumeClaimLabels(component, &vct, vct.Name) + rsm.Spec.VolumeClaimTemplates[index] = vct + } + } + + if err := processContainersInjection(cluster, component, &rsm.Spec.Template.Spec); err != nil { + return nil, err + } + return rsm, nil +} + +func vctToPVC(vct corev1.PersistentVolumeClaimTemplate) corev1.PersistentVolumeClaim { + return corev1.PersistentVolumeClaim{ + ObjectMeta: vct.ObjectMeta, + Spec: vct.Spec, + } +} + +// addServiceCommonLabels adds labels to the service. +func addServiceCommonLabels(service *corev1.Service, commonLabels map[string]string, compDefName string) { + if service == nil { + return + } + labels := service.Labels + if labels == nil { + labels = make(map[string]string, 0) + } + for k, v := range commonLabels { + labels[k] = v + } + labels[constant.AppComponentLabelKey] = compDefName + service.Labels = labels +} + +// getMonitorAnnotations returns the annotations for the monitor. +func getMonitorAnnotations(synthesizeComp *component.SynthesizedComponent) map[string]string { + annotations := make(map[string]string, 0) + falseStr := "false" + trueStr := "true" + switch { + case !synthesizeComp.Monitor.Enable: + annotations["monitor.kubeblocks.io/scrape"] = falseStr + annotations["monitor.kubeblocks.io/agamotto"] = falseStr + case synthesizeComp.Monitor.BuiltIn: + annotations["monitor.kubeblocks.io/scrape"] = falseStr + annotations["monitor.kubeblocks.io/agamotto"] = trueStr + default: + annotations["monitor.kubeblocks.io/scrape"] = trueStr + annotations["monitor.kubeblocks.io/path"] = synthesizeComp.Monitor.ScrapePath + annotations["monitor.kubeblocks.io/port"] = strconv.Itoa(int(synthesizeComp.Monitor.ScrapePort)) + annotations["monitor.kubeblocks.io/scheme"] = "http" + annotations["monitor.kubeblocks.io/agamotto"] = falseStr + } + return rsm.AddAnnotationScope(rsm.HeadlessServiceScope, annotations) +} + +// separateComponentDefServices separates 'services' to a main service from cd and alternative services from componentDefinition +// TODO(xingran): convert componentDef.services to rsm.Service +func separateComponentDefServices(services []corev1.Service) (*corev1.Service, []corev1.Service) { + if len(services) == 0 { + return nil, nil + } + // from component.buildComponent (which contains component.Services' building process), the first item should be the main service + // TODO(free6om): make two fields in component(i.e. Service and AlternativeServices) after RSM passes all testes. + return &services[0], services[1:] +} diff --git a/pkg/controllerutil/util.go b/pkg/controllerutil/util.go index c9d30bbee1b..01ea843f16d 100644 --- a/pkg/controllerutil/util.go +++ b/pkg/controllerutil/util.go @@ -118,3 +118,19 @@ func ValidateExistence(ctx context.Context, cli roclient.ReadonlyClient, key cli } return nil } + +// MergeMetadataMap merges two map[string]string, the targetMap will be updated. +func MergeMetadataMap(originalMap map[string]string, targetMap *map[string]string) { + if targetMap == nil || originalMap == nil { + return + } + if *targetMap == nil { + *targetMap = map[string]string{} + } + for k, v := range originalMap { + // if the annotation not exist in targetAnnotations, copy it from original. + if _, ok := (*targetMap)[k]; !ok { + (*targetMap)[k] = v + } + } +}