v1beta1

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	ClusterStateCreating         = "Creating"
	ClusterStateRunning          = "Running"
	ClusterStateReconciling      = "Reconciling"
	ClusterStateUpdating         = "Updating"
	ClusterStateStopping         = "Stopping"
	ClusterStatePartiallyStopped = "PartiallyStopped"
	ClusterStateStopped          = "Stopped"
)

ClusterState defines states for a cluster.

View Source
const (
	ComponentStateNotReady = "NotReady"
	ComponentStateReady    = "Ready"
	ComponentStateUpdating = "Updating"
	ComponentStateDeleted  = "Deleted"
)

ComponentState defines states for a cluster component.

View Source
const (
	JobStatePending   = "Pending"
	JobStateRunning   = "Running"
	JobStateUpdating  = "Updating"
	JobStateSucceeded = "Succeeded"
	JobStateFailed    = "Failed"
	JobStateCancelled = "Cancelled"
	JobStateSuspended = "Suspended"
	JobStateUnknown   = "Unknown"
	JobStateLost      = "Lost"
)

JobState defines states for a Flink job deployment.

View Source
const (
	AccessScopeCluster  = "Cluster"
	AccessScopeVPC      = "VPC"
	AccessScopeExternal = "External"
	AccessScopeNodePort = "NodePort"
	AccessScopeHeadless = "Headless"
)

AccessScope defines the access scope of JobManager service.

View Source
const (
	// control annotation key
	ControlAnnotation = "flinkclusters.flinkoperator.streamnative.io/user-control"

	// control name
	ControlNameSavepoint = "savepoint"
	ControlNameJobCancel = "job-cancel"

	// control state
	ControlStateProgressing = "Progressing"
	ControlStateSucceeded   = "Succeeded"
	ControlStateFailed      = "Failed"
)

User requested control

View Source
const (
	SavepointStateNotTriggered  = "NotTriggered"
	SavepointStateInProgress    = "InProgress"
	SavepointStateTriggerFailed = "TriggerFailed"
	SavepointStateFailed        = "Failed"
	SavepointStateSucceeded     = "Succeeded"

	SavepointTriggerReasonUserRequested    = "user requested"
	SavepointTriggerReasonScheduled        = "scheduled"
	SavepointTriggerReasonScheduledInitial = "scheduled initial" // The first triggered savepoint has slightly different flow
	SavepointTriggerReasonJobCancel        = "job cancel"
	SavepointTriggerReasonUpdate           = "update"
)

Savepoint status

View Source
const (
	// CleanupActionKeepCluster - keep the entire cluster.
	CleanupActionKeepCluster = "KeepCluster"
	// CleanupActionDeleteCluster - delete the entire cluster.
	CleanupActionDeleteCluster = "DeleteCluster"
	// CleanupActionDeleteTaskManager - delete task manager, keep job manager.
	CleanupActionDeleteTaskManager = "DeleteTaskManager"
)
View Source
const (
	InvalidControlAnnMsg           = "invalid value for annotation key: %v, value: %v, available values: savepoint, job-cancel"
	InvalidJobStateForJobCancelMsg = "job-cancel is not allowed because job is not started yet or already terminated, annotation: %v"
	InvalidJobStateForSavepointMsg = "savepoint is not allowed because job is not started yet or already stopped, annotation: %v"
	InvalidSavepointDirMsg         = "savepoint is not allowed without spec.job.savepointsDir, annotation: %v"
	SessionClusterWarnMsg          = "%v is not allowed for session cluster, annotation: %v"
	ControlChangeWarnMsg           = "change is not allowed for control in progress, annotation: %v"
)

Variables

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

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

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type CleanupAction

type CleanupAction string

CleanupAction defines the action to take after job finishes.

type CleanupPolicy

type CleanupPolicy struct {
	// Action to take after job succeeds.
	AfterJobSucceeds CleanupAction `json:"afterJobSucceeds,omitempty"`
	// Action to take after job fails.
	AfterJobFails CleanupAction `json:"afterJobFails,omitempty"`
	// Action to take after job is cancelled.
	AfterJobCancelled CleanupAction `json:"afterJobCancelled,omitempty"`
}

CleanupPolicy defines the action to take after job finishes.

func (*CleanupPolicy) DeepCopy

func (in *CleanupPolicy) DeepCopy() *CleanupPolicy

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

func (*CleanupPolicy) DeepCopyInto

func (in *CleanupPolicy) DeepCopyInto(out *CleanupPolicy)

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

type FlinkCluster

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

	Spec   FlinkClusterSpec   `json:"spec"`
	Status FlinkClusterStatus `json:"status,omitempty"`
}

FlinkCluster is the Schema for the flinkclusters API

func (*FlinkCluster) DeepCopy

func (in *FlinkCluster) DeepCopy() *FlinkCluster

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

func (*FlinkCluster) DeepCopyInto

func (in *FlinkCluster) DeepCopyInto(out *FlinkCluster)

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

func (*FlinkCluster) DeepCopyObject

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

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

func (*FlinkCluster) Default

func (cluster *FlinkCluster) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type.

func (*FlinkCluster) SetupWebhookWithManager

func (cluster *FlinkCluster) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager adds webhook for FlinkCluster.

func (*FlinkCluster) ValidateCreate

func (cluster *FlinkCluster) ValidateCreate() error

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

func (*FlinkCluster) ValidateDelete

func (cluster *FlinkCluster) ValidateDelete() error

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

func (*FlinkCluster) ValidateUpdate

func (cluster *FlinkCluster) ValidateUpdate(old runtime.Object) error

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

type FlinkClusterComponentState

type FlinkClusterComponentState struct {
	// The resource name of the component.
	Name string `json:"name"`

	// The state of the component.
	State string `json:"state"`
}

FlinkClusterComponentState defines the observed state of a component of a FlinkCluster.

func (*FlinkClusterComponentState) DeepCopy

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

func (*FlinkClusterComponentState) DeepCopyInto

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

type FlinkClusterComponentsStatus

type FlinkClusterComponentsStatus struct {
	// The state of configMap.
	ConfigMap FlinkClusterComponentState `json:"configMap"`

	// The state of JobManager StatefulSet.
	JobManagerStatefulSet FlinkClusterComponentState `json:"jobManagerStatefulSet"`

	// The state of JobManager service.
	JobManagerService JobManagerServiceStatus `json:"jobManagerService"`

	// The state of JobManager ingress.
	JobManagerIngress *JobManagerIngressStatus `json:"jobManagerIngress,omitempty"`

	// The state of TaskManager StatefulSet.
	TaskManagerStatefulSet FlinkClusterComponentState `json:"taskManagerStatefulSet"`

	// The status of the job, available only when JobSpec is provided.
	Job *JobStatus `json:"job,omitempty"`
}

FlinkClusterComponentsStatus defines the observed status of the components of a FlinkCluster.

func (*FlinkClusterComponentsStatus) DeepCopy

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

func (*FlinkClusterComponentsStatus) DeepCopyInto

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

type FlinkClusterControlStatus

type FlinkClusterControlStatus struct {
	// Control name
	Name string `json:"name"`

	// Control data
	Details map[string]string `json:"details,omitempty"`

	// State
	State string `json:"state"`

	// Message
	Message string `json:"message,omitempty"`

	// State update time
	UpdateTime string `json:"updateTime"`
}

Control state

func (*FlinkClusterControlStatus) DeepCopy

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

func (*FlinkClusterControlStatus) DeepCopyInto

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

type FlinkClusterList

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

FlinkClusterList contains a list of FlinkCluster

func (*FlinkClusterList) DeepCopy

func (in *FlinkClusterList) DeepCopy() *FlinkClusterList

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

func (*FlinkClusterList) DeepCopyInto

func (in *FlinkClusterList) DeepCopyInto(out *FlinkClusterList)

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

func (*FlinkClusterList) DeepCopyObject

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

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

type FlinkClusterSpec

type FlinkClusterSpec struct {
	// Flink image spec for the cluster's components.
	Image ImageSpec `json:"image"`

	// The service account assigned to JobManager, TaskManager and Job submitter Pods. If empty, the default service account in the namespace will be used.
	ServiceAccountName *string `json:"serviceAccountName,omitempty"`

	// BatchSchedulerName specifies the batch scheduler name for JobManager, TaskManager.
	// If empty, no batch scheduling is enabled.
	BatchSchedulerName *string `json:"batchSchedulerName,omitempty"`

	// Flink JobManager spec.
	JobManager JobManagerSpec `json:"jobManager"`

	// Flink TaskManager spec.
	TaskManager TaskManagerSpec `json:"taskManager"`

	// (Optional) Job spec. If specified, this cluster is an ephemeral Job
	// Cluster, which will be automatically terminated after the job finishes;
	// otherwise, it is a long-running Session Cluster.
	Job *JobSpec `json:"job,omitempty"`

	// Environment variables shared by all JobManager, TaskManager and job
	// containers.
	EnvVars []corev1.EnvVar `json:"envVars,omitempty"`

	// Environment variables injected from a source, shared by all JobManager,
	// TaskManager and job containers.
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`

	// Flink properties which are appened to flink-conf.yaml.
	FlinkProperties map[string]string `json:"flinkProperties,omitempty"`

	// Config for Hadoop.
	HadoopConfig *HadoopConfig `json:"hadoopConfig,omitempty"`

	// Config for GCP.
	GCPConfig *GCPConfig `json:"gcpConfig,omitempty"`

	// The logging configuration, which should have keys 'log4j-console.properties' and 'logback-console.xml'.
	// These will end up in the 'flink-config-volume' ConfigMap, which gets mounted at /opt/flink/conf.
	// If not provided, defaults that log to console only will be used.
	LogConfig map[string]string `json:"logConfig,omitempty"`

	// The maximum number of revision history to keep, default: 10.
	RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`

	// Recreate components when updating flinkcluster, default: true.
	RecreateOnUpdate *bool `json:"recreateOnUpdate,omitempty"`
}

FlinkClusterSpec defines the desired state of FlinkCluster

func (*FlinkClusterSpec) DeepCopy

func (in *FlinkClusterSpec) DeepCopy() *FlinkClusterSpec

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

func (*FlinkClusterSpec) DeepCopyInto

func (in *FlinkClusterSpec) DeepCopyInto(out *FlinkClusterSpec)

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

type FlinkClusterStatus

type FlinkClusterStatus struct {

	// The overall state of the Flink cluster.
	State string `json:"state"`

	// The status of the components.
	Components FlinkClusterComponentsStatus `json:"components"`

	// The status of control requested by user
	Control *FlinkClusterControlStatus `json:"control,omitempty"`

	// The status of savepoint progress
	Savepoint *SavepointStatus `json:"savepoint,omitempty"`

	// CurrentRevision indicates the version of FlinkCluster.
	CurrentRevision string `json:"currentRevision,omitempty"`

	// NextRevision indicates the version of FlinkCluster updating.
	NextRevision string `json:"nextRevision,omitempty"`

	// collisionCount is the count of hash collisions for the FlinkCluster. The controller
	// uses this field as a collision avoidance mechanism when it needs to create the name for the
	// newest ControllerRevision.
	CollisionCount *int32 `json:"collisionCount,omitempty"`

	// Last update timestamp for this status.
	LastUpdateTime string `json:"lastUpdateTime,omitempty"`
}

FlinkClusterStatus defines the observed state of FlinkCluster

func (*FlinkClusterStatus) DeepCopy

func (in *FlinkClusterStatus) DeepCopy() *FlinkClusterStatus

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

func (*FlinkClusterStatus) DeepCopyInto

func (in *FlinkClusterStatus) DeepCopyInto(out *FlinkClusterStatus)

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

type GCPConfig

type GCPConfig struct {
	// GCP service account.
	ServiceAccount *GCPServiceAccount `json:"serviceAccount,omitempty"`
}

GCPConfig defines configs for GCP.

func (*GCPConfig) DeepCopy

func (in *GCPConfig) DeepCopy() *GCPConfig

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

func (*GCPConfig) DeepCopyInto

func (in *GCPConfig) DeepCopyInto(out *GCPConfig)

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

type GCPServiceAccount

type GCPServiceAccount struct {
	// The name of the Secret holding the GCP service account key file.
	// The Secret must be in the same namespace as the FlinkCluster.
	SecretName string `json:"secretName,omitempty"`

	// The name of the service account key file.
	KeyFile string `json:"keyFile,omitempty"`

	// The path where to mount the Volume of the Secret.
	MountPath string `json:"mountPath,omitempty"`
}

GCPServiceAccount defines the config about GCP service account.

func (*GCPServiceAccount) DeepCopy

func (in *GCPServiceAccount) DeepCopy() *GCPServiceAccount

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

func (*GCPServiceAccount) DeepCopyInto

func (in *GCPServiceAccount) DeepCopyInto(out *GCPServiceAccount)

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

type HadoopConfig

type HadoopConfig struct {
	// The name of the ConfigMap which contains the Hadoop config files.
	// The ConfigMap must be in the same namespace as the FlinkCluster.
	ConfigMapName string `json:"configMapName,omitempty"`

	// The path where to mount the Volume of the ConfigMap.
	MountPath string `json:"mountPath,omitempty"`
}

HadoopConfig defines configs for Hadoop.

func (*HadoopConfig) DeepCopy

func (in *HadoopConfig) DeepCopy() *HadoopConfig

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

func (*HadoopConfig) DeepCopyInto

func (in *HadoopConfig) DeepCopyInto(out *HadoopConfig)

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

type ImageSpec

type ImageSpec struct {
	// Flink image name.
	Name string `json:"name"`

	// Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always
	// if :latest tag is specified, or IfNotPresent otherwise.
	PullPolicy corev1.PullPolicy `json:"pullPolicy,omitempty"`

	// Secrets for image pull.
	PullSecrets []corev1.LocalObjectReference `json:"pullSecrets,omitempty"`
}

ImageSpec defines Flink image of JobManager and TaskManager containers.

func (*ImageSpec) DeepCopy

func (in *ImageSpec) DeepCopy() *ImageSpec

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

func (*ImageSpec) DeepCopyInto

func (in *ImageSpec) DeepCopyInto(out *ImageSpec)

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

type JobManagerIngressSpec

type JobManagerIngressSpec struct {
	// Ingress host format. ex) {{$clusterName}}.example.com
	HostFormat *string `json:"hostFormat,omitempty"`

	// Ingress annotations.
	Annotations map[string]string `json:"annotations,omitempty"`

	// TLS use.
	UseTLS *bool `json:"useTls,omitempty"`

	// TLS secret name.
	TLSSecretName *string `json:"tlsSecretName,omitempty"`
}

JobManagerIngressSpec defines ingress of JobManager

func (*JobManagerIngressSpec) DeepCopy

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

func (*JobManagerIngressSpec) DeepCopyInto

func (in *JobManagerIngressSpec) DeepCopyInto(out *JobManagerIngressSpec)

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

type JobManagerIngressStatus

type JobManagerIngressStatus struct {
	// The name of the Kubernetes ingress resource.
	Name string `json:"name"`

	// The state of the component.
	State string `json:"state"`

	// The URLs of ingress.
	URLs []string `json:"urls,omitempty"`
}

JobManagerIngressStatus defines the status of a JobManager ingress.

func (*JobManagerIngressStatus) DeepCopy

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

func (*JobManagerIngressStatus) DeepCopyInto

func (in *JobManagerIngressStatus) DeepCopyInto(out *JobManagerIngressStatus)

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

type JobManagerPorts

type JobManagerPorts struct {
	// RPC port, default: 6123.
	RPC *int32 `json:"rpc,omitempty"`

	// Blob port, default: 6124.
	Blob *int32 `json:"blob,omitempty"`

	// Query port, default: 6125.
	Query *int32 `json:"query,omitempty"`

	// UI port, default: 8081.
	UI *int32 `json:"ui,omitempty"`
}

JobManagerPorts defines ports of JobManager.

func (*JobManagerPorts) DeepCopy

func (in *JobManagerPorts) DeepCopy() *JobManagerPorts

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

func (*JobManagerPorts) DeepCopyInto

func (in *JobManagerPorts) DeepCopyInto(out *JobManagerPorts)

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

type JobManagerServiceStatus

type JobManagerServiceStatus struct {
	// The name of the Kubernetes jobManager service.
	Name string `json:"name"`

	// The state of the component.
	State string `json:"state"`

	// (Optional) The node port, present when `accessScope` is `NodePort`.
	NodePort int32 `json:"nodePort,omitempty"`
}

JobManagerServiceStatus defines the observed state of FlinkCluster

func (*JobManagerServiceStatus) DeepCopy

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

func (*JobManagerServiceStatus) DeepCopyInto

func (in *JobManagerServiceStatus) DeepCopyInto(out *JobManagerServiceStatus)

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

type JobManagerSpec

type JobManagerSpec struct {
	// The number of replicas.
	Replicas *int32 `json:"replicas,omitempty"`

	// Access scope, enum("Cluster", "VPC", "External").
	AccessScope string `json:"accessScope"`

	// (Optional) Ingress.
	Ingress *JobManagerIngressSpec `json:"ingress,omitempty"`

	// Ports.
	Ports JobManagerPorts `json:"ports,omitempty"`

	// Extra ports to be exposed. For example, Flink metrics reporter ports: Prometheus, JMX and so on.
	ExtraPorts []NamedPort `json:"extraPorts,omitempty"`

	// Compute resources required by each JobManager container.
	// If omitted, a default value will be used.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Percentage of off-heap memory in containers, as a safety margin to avoid OOM kill, default: 25
	MemoryOffHeapRatio *int32 `json:"memoryOffHeapRatio,omitempty"`

	// Minimum amount of off-heap memory in containers, as a safety margin to avoid OOM kill, default: 600M
	// You can express this value like 600M, 572Mi and 600e6
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
	MemoryOffHeapMin resource.Quantity `json:"memoryOffHeapMin,omitempty"`

	// Volumes in the JobManager pod.
	Volumes []corev1.Volume `json:"volumes,omitempty"`

	// Volume mounts in the JobManager container.
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`

	VolumeClaimTemplates []corev1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`

	// Init containers of the Job Manager pod.
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// Selector which must match a node's labels for the JobManager pod to be
	// scheduled on that node.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Defines the node affinity of the pod
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// Sidecar containers running alongside with the JobManager container in the
	// pod.
	Sidecars []corev1.Container `json:"sidecars,omitempty"`

	// JobManager StatefulSet pod template annotations.
	PodAnnotations map[string]string `json:"podAnnotations,omitempty"`

	// SecurityContext of the JM pod.
	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`

	// JobManager StatefulSet pod template labels.
	PodLabels map[string]string `json:"podLabels,omitempty"`
}

JobManagerSpec defines properties of JobManager.

func (*JobManagerSpec) DeepCopy

func (in *JobManagerSpec) DeepCopy() *JobManagerSpec

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

func (*JobManagerSpec) DeepCopyInto

func (in *JobManagerSpec) DeepCopyInto(out *JobManagerSpec)

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

type JobRestartPolicy

type JobRestartPolicy string

JobRestartPolicy defines the restart policy when a job fails.

const (
	// JobRestartPolicyNever - never restarts a failed job.
	JobRestartPolicyNever JobRestartPolicy = "Never"

	// JobRestartPolicyFromSavepointOnFailure - restart the job from the latest
	// savepoint if available, otherwise do not restart.
	JobRestartPolicyFromSavepointOnFailure JobRestartPolicy = "FromSavepointOnFailure"
)

type JobSpec

type JobSpec struct {
	// JAR file of the job.
	JarFile string `json:"jarFile"`

	// Fully qualified Java class name of the job.
	ClassName *string `json:"className,omitempty"`

	// Args of the job.
	Args []string `json:"args,omitempty"`

	// FromSavepoint where to restore the job from (e.g., gs://my-savepoint/1234).
	FromSavepoint *string `json:"fromSavepoint,omitempty"`

	// Allow non-restored state, default: false.
	AllowNonRestoredState *bool `json:"allowNonRestoredState,omitempty"`

	// Should take savepoint before upgrading the job, default: false.
	TakeSavepointOnUpgrade *bool `json:"takeSavepointOnUpgrade,omitempty"`

	// Savepoints dir where to store savepoints of the job.
	SavepointsDir *string `json:"savepointsDir,omitempty"`

	// Automatically take a savepoint to the `savepointsDir` every n seconds.
	AutoSavepointSeconds *int32 `json:"autoSavepointSeconds,omitempty"`

	// Update this field to `jobStatus.savepointGeneration + 1` for a running job
	// cluster to trigger a new savepoint to `savepointsDir` on demand.
	SavepointGeneration int32 `json:"savepointGeneration,omitempty"`

	// Job parallelism, default: 1.
	Parallelism *int32 `json:"parallelism,omitempty"`

	// No logging output to STDOUT, default: false.
	NoLoggingToStdout *bool `json:"noLoggingToStdout,omitempty"`

	// Volumes in the Job pod.
	// More info: https://kubernetes.io/docs/concepts/storage/volumes/
	Volumes []corev1.Volume `json:"volumes,omitempty"`

	// Volume mounts in the Job container.
	// More info: https://kubernetes.io/docs/concepts/storage/volumes/
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`

	// Init containers of the Job pod. A typical use case could be using an init
	// container to download a remote job jar to a local path which is
	// referenced by the `jarFile` property.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// Restart policy when the job fails, "Never" or "FromSavepointOnFailure",
	// default: "Never".
	//
	// "Never" means the operator will never try to restart a failed job, manual
	// cleanup and restart is required.
	//
	// "FromSavepointOnFailure" means the operator will try to restart the failed
	// job from the savepoint recorded in the job status if available; otherwise,
	// the job will stay in failed state. This option is usually used together
	// with `autoSavepointSeconds` and `savepointsDir`.
	RestartPolicy *JobRestartPolicy `json:"restartPolicy"`

	// The action to take after job finishes.
	CleanupPolicy *CleanupPolicy `json:"cleanupPolicy,omitempty"`

	// Request the job to be cancelled. Only applies to running jobs. If
	// `savePointsDir` is provided, a savepoint will be taken before stopping the
	// job.
	CancelRequested *bool `json:"cancelRequested,omitempty"`

	// Job pod template annotations.
	PodAnnotations map[string]string `json:"podAnnotations,omitempty"`

	// Job pod template labels.
	PodLabels map[string]string `json:"podLabels,omitempty"`

	// Compute resources required by each Job container.
	// If omitted, a default value will be used.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
}

JobSpec defines properties of a Flink job.

func (*JobSpec) DeepCopy

func (in *JobSpec) DeepCopy() *JobSpec

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

func (*JobSpec) DeepCopyInto

func (in *JobSpec) DeepCopyInto(out *JobSpec)

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

type JobStatus

type JobStatus struct {
	// The name of the Kubernetes job resource.
	Name string `json:"name,omitempty"`

	// The ID of the Flink job.
	ID string `json:"id,omitempty"`

	// The state of the Kubernetes job.
	State string `json:"state"`

	// The actual savepoint from which this job started.
	// In case of restart, it might be different from the savepoint in the job
	// spec.
	FromSavepoint string `json:"fromSavepoint,omitempty"`

	// The generation of the savepoint in `savepointsDir` taken by the operator.
	// The value starts from 0 when there is no savepoint and increases by 1 for
	// each successful savepoint.
	SavepointGeneration int32 `json:"savepointGeneration,omitempty"`

	// Savepoint location.
	SavepointLocation string `json:"savepointLocation,omitempty"`

	// Last savepoint trigger ID.
	LastSavepointTriggerID string `json:"lastSavepointTriggerID,omitempty"`

	// Last savepoint trigger time. This is updated to make sure multiple
	// savepoints will not be taken simultaneously.
	LastSavepointTriggerTime string `json:"lastSavepointTriggerTime,omitempty"`

	// Last successful or failed savepoint operation timestamp.
	LastSavepointTime string `json:"lastSavepointTime,omitempty"`

	// The number of restarts.
	RestartCount int32 `json:"restartCount,omitempty"`
}

JobStatus defines the status of a job.

func (*JobStatus) DeepCopy

func (in *JobStatus) DeepCopy() *JobStatus

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

func (*JobStatus) DeepCopyInto

func (in *JobStatus) DeepCopyInto(out *JobStatus)

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

type NamedPort

type NamedPort struct {
	// If specified, this must be an IANA_SVC_NAME and unique within the pod. Each
	// named port in a pod must have a unique name. Name for the port that can be
	// referred to by services.
	Name string `json:"name,omitempty"`

	// Number of port to expose on the pod's IP address.
	// This must be a valid port number, 0 < x < 65536.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	ContainerPort int32 `json:"containerPort"`

	// Protocol for port. Must be UDP, TCP, or SCTP.
	// Defaults to "TCP".
	// +kubebuilder:validation:Enum=TCP;UDP;SCTP
	Protocol string `json:"protocol,omitempty"`
}

NamedPort defines the container port properties.

func (*NamedPort) DeepCopy

func (in *NamedPort) DeepCopy() *NamedPort

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

func (*NamedPort) DeepCopyInto

func (in *NamedPort) DeepCopyInto(out *NamedPort)

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

type SavepointStatus

type SavepointStatus struct {
	// The ID of the Flink job.
	JobID string `json:"jobID,omitempty"`

	// Savepoint trigger ID.
	TriggerID string `json:"triggerID,omitempty"`

	// Savepoint triggered time.
	TriggerTime string `json:"triggerTime,omitempty"`

	// Savepoint triggered reason.
	TriggerReason string `json:"triggerReason,omitempty"`

	// Savepoint requested time.
	RequestTime string `json:"requestTime,omitempty"`

	// Savepoint state.
	State string `json:"state"`

	// Savepoint message.
	Message string `json:"message,omitempty"`
}

SavepointStatus defines the status of savepoint progress

func (*SavepointStatus) DeepCopy

func (in *SavepointStatus) DeepCopy() *SavepointStatus

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

func (*SavepointStatus) DeepCopyInto

func (in *SavepointStatus) DeepCopyInto(out *SavepointStatus)

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

type TaskManagerPorts

type TaskManagerPorts struct {
	// Data port, default: 6121.
	Data *int32 `json:"data,omitempty"`

	// RPC port, default: 6122.
	RPC *int32 `json:"rpc,omitempty"`

	// Query port.
	Query *int32 `json:"query,omitempty"`
}

TaskManagerPorts defines ports of TaskManager.

func (*TaskManagerPorts) DeepCopy

func (in *TaskManagerPorts) DeepCopy() *TaskManagerPorts

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

func (*TaskManagerPorts) DeepCopyInto

func (in *TaskManagerPorts) DeepCopyInto(out *TaskManagerPorts)

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

type TaskManagerSpec

type TaskManagerSpec struct {
	// The number of replicas.
	Replicas int32 `json:"replicas"`

	// Ports.
	Ports TaskManagerPorts `json:"ports,omitempty"`

	// Extra ports to be exposed. For example, Flink metrics reporter ports: Prometheus, JMX and so on.
	ExtraPorts []NamedPort `json:"extraPorts,omitempty"`

	// Compute resources required by each TaskManager container.
	// If omitted, a default value will be used.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Percentage of off-heap memory in containers, as a safety margin to avoid OOM kill, default: 25
	MemoryOffHeapRatio *int32 `json:"memoryOffHeapRatio,omitempty"`

	// Minimum amount of off-heap memory in containers, as a safety margin to avoid OOM kill, default: 600M
	// You can express this value like 600M, 572Mi and 600e6
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
	MemoryOffHeapMin resource.Quantity `json:"memoryOffHeapMin,omitempty"`

	// Volumes in the TaskManager pods.
	// More info: https://kubernetes.io/docs/concepts/storage/volumes/
	Volumes []corev1.Volume `json:"volumes,omitempty"`

	// Volume mounts in the TaskManager containers.
	// More info: https://kubernetes.io/docs/concepts/storage/volumes/
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`

	VolumeClaimTemplates []corev1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`

	// Init containers of the Task Manager pod.
	InitContainers []corev1.Container `json:"initContainers,omitempty"`

	// Selector which must match a node's labels for the TaskManager pod to be
	// scheduled on that node.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// Defines the node affinity of the pod
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// Sidecar containers running alongside with the TaskManager container in the
	// pod.
	Sidecars []corev1.Container `json:"sidecars,omitempty"`

	// TaskManager StatefulSet pod template annotations.
	PodAnnotations map[string]string `json:"podAnnotations,omitempty"`

	// SecurityContext of the TM pod.
	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`

	// TaskManager StatefulSet pod template labels.
	PodLabels map[string]string `json:"podLabels,omitempty"`
}

TaskManagerSpec defines properties of TaskManager.

func (*TaskManagerSpec) DeepCopy

func (in *TaskManagerSpec) DeepCopy() *TaskManagerSpec

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

func (*TaskManagerSpec) DeepCopyInto

func (in *TaskManagerSpec) DeepCopyInto(out *TaskManagerSpec)

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

type Validator

type Validator struct{}

Validator validates CUD requests for the CR.

func (*Validator) DeepCopy

func (in *Validator) DeepCopy() *Validator

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

func (*Validator) DeepCopyInto

func (in *Validator) DeepCopyInto(out *Validator)

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

func (*Validator) ValidateCreate

func (v *Validator) ValidateCreate(cluster *FlinkCluster) error

ValidateCreate validates create request.

func (*Validator) ValidateUpdate

func (v *Validator) ValidateUpdate(old *FlinkCluster, new *FlinkCluster) error

ValidateUpdate validates update request.

Jump to

Keyboard shortcuts

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