v1alpha2

package
v0.0.0-...-87df8d5 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	HMetaReady   string = "HMetaReady"
	HStoreReady  string = "HStoreReady"
	HServerReady string = "HServerReady"
	GatewayReady string = "GatewayReady"
	ConsoleReady string = "ConsoleReady"
	Ready        string = "Ready"
)
View Source
const (
	// LastSpecKey provides the annotation name we use to store the hash of the
	// object spec.
	LastSpecKey = "hstream.io/last-applied-spec"
	// ComponentKey provide the label name we use to store the type fo the
	// component
	ComponentKey = "hstream.io/component"
	// InstanceKey provide the label name we use to store the instance name
	InstanceKey = "hstream.io/instance"
)

Variables

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

	// 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 Component

type Component struct {
	//+kubebuilder:validation:Required
	Image string `json:"image"`

	// Image pull policy.
	// One of Always, Never, IfNotPresent.
	// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// Replicas is the desired number of replicas of the given Template.
	// These are replicas in the sense that they are instantiations of the
	// same Template, but individual replicas also have a consistent identity.
	// +kubebuilder:validation:Required
	Replicas int32 `json:"replicas"`

	// List of volumes that can be mounted by containers belonging to the pod.
	// More info: https://kubernetes.io/docs/concepts/storage/volumes
	// +optional
	// +patchMergeKey=name
	// +patchStrategy=merge,retainKeys
	Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,1,rep,name=volumes"`
	// List of initialization containers belonging to the pod.
	// Init containers are executed in order prior to containers being started. If any
	// init container fails, the pod is considered to have failed and is handled according
	// to its restartPolicy. The name for an init container or normal container must be
	// unique among all containers.
	// Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
	// The resourceRequirements of an init container are taken into account during scheduling
	// by finding the highest request/limit for each resource type, and then using the max of
	// of that value or the sum of the normal containers. Limits are applied to init containers
	// in a similar fashion.
	// Init containers cannot currently be added or removed.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
	// +patchMergeKey=name
	// +patchStrategy=merge
	// +optional
	InitContainers []corev1.Container `json:"initContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,20,rep,name=initContainers"`
	// SidecarContainers represents extra containers to be added to the pod.
	// +patchMergeKey=name
	// +patchStrategy=merge
	// +optional
	SidecarContainers []corev1.Container `json:"sidecarContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,20,rep,name=sidecarContainers"`
	// container belonging to the pod.
	// Container cannot currently be added or removed.
	// Cannot be updated.
	Container corev1.Container `json:"container" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=container"`
	// NodeSelector is a selector which must be true for the pod to fit on a node.
	// Selector which must match a node's labels for the pod to be scheduled on that node.
	// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
	// +optional
	// +mapType=atomic
	NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"`
	// NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
	// the scheduler simply schedules this pod onto that node, assuming that it fits resource
	// requirements.
	// +optional
	NodeName string `json:"nodeName,omitempty" protobuf:"bytes,10,opt,name=nodeName"`
	// SecurityContext holds pod-level security attributes and common container settings.
	// Optional: Defaults to empty.  See type description for default values of each field.
	// +optional
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty" protobuf:"bytes,14,opt,name=podSecurityContext"`
	// If specified, the pod's scheduling constraints
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"`
	// If specified, the pod's tolerations.
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"`

	// VolumeClaimTemplate allows customizing the persistent volume claim for the pod.
	// +optional
	VolumeClaimTemplate *corev1.PersistentVolumeClaimTemplate `json:"volumeClaimTemplate,omitempty"`
}

func (*Component) DeepCopy

func (in *Component) DeepCopy() *Component

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

func (*Component) DeepCopyInto

func (in *Component) DeepCopyInto(out *Component)

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

type ComponentType

type ComponentType string
const (
	ComponentTypeGateway     ComponentType = "gateway"
	ComponentTypeAdminServer ComponentType = "admin-server"
	ComponentTypeConsole     ComponentType = "console"
	ComponentTypeHServer     ComponentType = "hserver"
	ComponentTypeHStore      ComponentType = "hstore"
	ComponentTypeHMeta       ComponentType = "hmeta"
)

func (ComponentType) GetHeadlessService

func (ct ComponentType) GetHeadlessService(hdb *HStreamDB, ports []corev1.ServicePort) corev1.Service

func (ComponentType) GetInternalResName

func (ct ComponentType) GetInternalResName(hdb *HStreamDB) string

func (ComponentType) GetObjectMeta

func (ct ComponentType) GetObjectMeta(hdb *HStreamDB, meta *metav1.ObjectMeta) metav1.ObjectMeta

func (ComponentType) GetResName

func (ct ComponentType) GetResName(hdb *HStreamDB) string

func (ComponentType) GetService

func (ct ComponentType) GetService(hdb *HStreamDB, ports []corev1.ServicePort) corev1.Service

type Config

type Config struct {
	// MetadataReplicateAcross metadata replication must less than or equal to HStore replicas.
	// If this is not specified, it will be set to HStore replicas or 3 if HStore replica more than 3
	// Cannot be updated.
	// More info: https://logdevice.io/docs/Config.html#metadata-logs-metadata-logs
	//
	// +kubebuilder:validation:Minimum:=1
	// +optional
	MetadataReplicateAcross *int32 `json:"metadata-replicate-across,omitempty"`

	// NShards the number of HStore data shard
	// Cannot be updated.
	//
	// +kubebuilder:default:=1
	// +kubebuilder:validation:Minimum:=1
	// +optional
	NShards int32 `json:"nshards,omitempty"`

	// log device bootstrap config, json style
	// More info: https://logdevice.io/docs/Config.html
	// Example: https://github.com/hstreamdb/hstream/blob/main/deploy/k8s/config.json
	//
	// +optional
	LogDeviceConfig runtime.RawExtension `json:"logDeviceConfig,omitempty"`
}

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

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

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

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

type ExternalHMeta

type ExternalHMeta struct {
	// Host set external HMeta cluster host, it can be ip addr or service name
	// +kubebuilder:validation:Required
	Host string `json:"host"`
	// +kubebuilder:validation:Required
	Port int32 `json:"port"`
	// Namespace the namespace of external HMeta cluster
	// +kubebuilder:default:=default
	// +optional
	Namespace string `json:"namespace"`
}

func (*ExternalHMeta) DeepCopy

func (in *ExternalHMeta) DeepCopy() *ExternalHMeta

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

func (*ExternalHMeta) DeepCopyInto

func (in *ExternalHMeta) DeepCopyInto(out *ExternalHMeta)

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

func (*ExternalHMeta) GetAddr

func (er *ExternalHMeta) GetAddr() string

type Gateway

type Gateway struct {
	Component `json:",inline"`
	//+kubebuilder:validation:Required
	Endpoint string `json:"endpoint"`
	//+kubebuilder:default:=14789
	Port int32 `json:"port,omitempty"`
	// Must 'kubernetes.io/tls' secret, and the tls.key must the PKCS8 format
	SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
}

func (*Gateway) DeepCopy

func (in *Gateway) DeepCopy() *Gateway

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

func (*Gateway) DeepCopyInto

func (in *Gateway) DeepCopyInto(out *Gateway)

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

type HMetaNode

type HMetaNode struct {
	NodeId    string `json:"nodeId"`
	Reachable bool   `json:"reachable"`
	Leader    bool   `json:"leader"`
	Error     string `json:"error,omitempty"`
}

func (*HMetaNode) DeepCopy

func (in *HMetaNode) DeepCopy() *HMetaNode

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

func (*HMetaNode) DeepCopyInto

func (in *HMetaNode) DeepCopyInto(out *HMetaNode)

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

type HMetaStatus

type HMetaStatus struct {
	// Nodes the status of node that return by api http://localhost:4001/status?pretty in HMeta pod
	Nodes   []HMetaNode `json:"nodes"`
	Version string      `json:"version"`
}

func (*HMetaStatus) DeepCopy

func (in *HMetaStatus) DeepCopy() *HMetaStatus

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

func (*HMetaStatus) DeepCopyInto

func (in *HMetaStatus) DeepCopyInto(out *HMetaStatus)

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

type HStreamDB

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

	Spec   HStreamDBSpec   `json:"spec,omitempty"`
	Status HStreamDBStatus `json:"status,omitempty"`
}

HStreamDB is the Schema for the hstreamdbs API

func (*HStreamDB) DeepCopy

func (in *HStreamDB) DeepCopy() *HStreamDB

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

func (*HStreamDB) DeepCopyInto

func (in *HStreamDB) DeepCopyInto(out *HStreamDB)

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

func (*HStreamDB) DeepCopyObject

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

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

func (*HStreamDB) GetCondition

func (hdb *HStreamDB) GetCondition(conditionType string) (int, *metav1.Condition)

func (*HStreamDB) IsConditionTrue

func (hdb *HStreamDB) IsConditionTrue(conditionType string) bool

func (*HStreamDB) SetCondition

func (hdb *HStreamDB) SetCondition(condition metav1.Condition)

type HStreamDBList

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

HStreamDBList contains a list of HStreamDB

func (*HStreamDBList) DeepCopy

func (in *HStreamDBList) DeepCopy() *HStreamDBList

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

func (*HStreamDBList) DeepCopyInto

func (in *HStreamDBList) DeepCopyInto(out *HStreamDBList)

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

func (*HStreamDBList) DeepCopyObject

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

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

type HStreamDBSpec

type HStreamDBSpec struct {
	// ExternalHMeta set external HMeta cluster addr
	// +optional
	ExternalHMeta *ExternalHMeta `json:"externalHmeta,omitempty"`

	Config Config `json:"config,omitempty"`

	Gateway     *Gateway   `json:"gateway,omitempty"`
	Console     *Component `json:"console,omitempty"`
	AdminServer Component  `json:"adminServer,omitempty"`
	HServer     Component  `json:"hserver,omitempty"`
	HStore      Component  `json:"hstore,omitempty"`
	HMeta       Component  `json:"hmeta,omitempty"`
}

HStreamDBSpec defines the desired state of HStreamDB

func (*HStreamDBSpec) DeepCopy

func (in *HStreamDBSpec) DeepCopy() *HStreamDBSpec

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

func (*HStreamDBSpec) DeepCopyInto

func (in *HStreamDBSpec) DeepCopyInto(out *HStreamDBSpec)

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

type HStreamDBStatus

type HStreamDBStatus struct {
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// HMeta store the status of HMeta cluster
	HMeta HMetaStatus `json:"hmeta"`
}

HStreamDBStatus defines the observed state of HStreamDB

func (*HStreamDBStatus) DeepCopy

func (in *HStreamDBStatus) DeepCopy() *HStreamDBStatus

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

func (*HStreamDBStatus) DeepCopyInto

func (in *HStreamDBStatus) DeepCopyInto(out *HStreamDBStatus)

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

Jump to

Keyboard shortcuts

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