Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the crdb v1alpha1 API group +k8s:deepcopy-gen=package +k8s:defaulter-gen=TypeMeta +groupName=crdb.cockroachlabs.com +groupGoName=crdb
Package v1alpha1 contains API Schema definitions for the crdb v1alpha1 API group +k8s:deepcopy-gen=package +groupName=crdb.cockroachlabs.com
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- func SetClusterSpecDefaults(cs *CrdbClusterSpec)
- type ActionStatus
- type ActionType
- type ClusterAction
- type ClusterCondition
- type ClusterConditionType
- type ClusterRestartType
- type CrdbCluster
- type CrdbClusterList
- type CrdbClusterSpec
- type CrdbClusterStatus
- type PodImage
- type Volume
- type VolumeClaim
Constants ¶
const ( //Failed status Failed = iota //Starting status Starting //Finished status Finished //Unknown status Unknown )
const ( //RollingRestart used trigger an rolling restart RollingRestart = iota //FullCluster used to trigger a full cluster restart FullCluster )
Variables ¶
var ( DefaultGRPCPort int32 = 26258 DefaultSQLPort int32 = 26257 DefaultHTTPPort int32 = 8080 )
var ( // SchemeGroupVersion is group version used to register these objects with the k8s schema SchemeGroupVersion = schema.GroupVersion{Group: "crdb.cockroachlabs.com", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
func SetClusterSpecDefaults ¶
func SetClusterSpecDefaults(cs *CrdbClusterSpec)
SetClusterSpecDefaults sets various values to the default vars set above.
Types ¶
type ActionStatus ¶
type ActionStatus int
ActionStatus struct used to save the status of each action that the controller runs
func (ActionStatus) String ¶
func (a ActionStatus) String() string
type ActionType ¶
type ActionType string
ActionType type alias
const ( //VersionCheckerAction string VersionCheckerAction ActionType = "VersionCheckerAction" //ClusterRestartAction string ClusterRestartAction ActionType = "ClusterRestart" //DeployAction string DeployAction ActionType = "Deploy" //DecommissionAction string DecommissionAction ActionType = "Decommission" //InitializeAction string InitializeAction ActionType = "Initialize" //RequestCertAction string RequestCertAction ActionType = "RequestCert" //GenerateCert string GenerateCertAction ActionType = "GenerateCert" //RequestCertAction string ResizePVCAction ActionType = "ResizePVC" //UpgradeAction string UpgradeAction ActionType = "Upgrade" //PartialUpdateAction string PartialUpdateAction ActionType = "PartialUpdate" //UnknownAction string UnknownAction ActionType = "Unknown" )
type ClusterAction ¶
type ClusterAction struct { // +required // Type/Name of the action Type ActionType `json:"type"` // +optional // Message related to the status of the action Message string `json:"message"` // +required // Action status: Failed, Finished or Unknown Status string `json:"status"` // +required // The time when the condition was updated LastTransitionTime metav1.Time `json:"lastTransitionTime"` }
ClusterAction represents cluster status as it is perceived by the operator +k8s:deepcopy-gen=true
func (*ClusterAction) DeepCopy ¶
func (in *ClusterAction) DeepCopy() *ClusterAction
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAction.
func (*ClusterAction) DeepCopyInto ¶
func (in *ClusterAction) DeepCopyInto(out *ClusterAction)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterCondition ¶
type ClusterCondition struct { // +required // Type/Name of the condition Type ClusterConditionType `json:"type"` // +required // Condition status: True, False or Unknown Status metav1.ConditionStatus `json:"status"` // +required // The time when the condition was updated LastTransitionTime metav1.Time `json:"lastTransitionTime"` }
ClusterCondition represents cluster status as it is perceived by the operator
func (*ClusterCondition) DeepCopy ¶
func (in *ClusterCondition) DeepCopy() *ClusterCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition.
func (*ClusterCondition) DeepCopyInto ¶
func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ClusterConditionType ¶
type ClusterConditionType string
ClusterConditionType type alias
const ( //CrdbCertificateGenerated condition used to run the version checker and sync other actions CertificateGenerated ClusterConditionType = "CertificateGenerated" //CrdbVersionChecked condition used to run the version checker and sync other actions CrdbVersionChecked ClusterConditionType = "CrdbVersionChecked" //DecommissionCondition string DecommissionCondition ClusterConditionType = "Decommission" //InitializedCondition string InitializedCondition ClusterConditionType = "Initialized" //ClusterRestartCondition string ClusterRestartCondition ClusterConditionType = "RestartedCluster" )
type ClusterRestartType ¶
type ClusterRestartType int
ClusterRestartType type alias
func (ClusterRestartType) String ¶
func (r ClusterRestartType) String() string
type CrdbCluster ¶
type CrdbCluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec CrdbClusterSpec `json:"spec,omitempty"` Status CrdbClusterStatus `json:"status,omitempty"` }
CrdbCluster is the CRD for the cockroachDB clusters API
func (*CrdbCluster) DeepCopy ¶
func (in *CrdbCluster) DeepCopy() *CrdbCluster
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrdbCluster.
func (*CrdbCluster) DeepCopyInto ¶
func (in *CrdbCluster) DeepCopyInto(out *CrdbCluster)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CrdbCluster) DeepCopyObject ¶
func (in *CrdbCluster) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type CrdbClusterList ¶
type CrdbClusterList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []CrdbCluster `json:"items"` }
CrdbClusterList contains a list of Cluster
func (*CrdbClusterList) DeepCopy ¶
func (in *CrdbClusterList) DeepCopy() *CrdbClusterList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrdbClusterList.
func (*CrdbClusterList) DeepCopyInto ¶
func (in *CrdbClusterList) DeepCopyInto(out *CrdbClusterList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CrdbClusterList) DeepCopyObject ¶
func (in *CrdbClusterList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type CrdbClusterSpec ¶
type CrdbClusterSpec struct { // Number of nodes (pods) in the cluster // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Number of nodes",xDescriptors="urn:alm:descriptor:com.tectonic.ui:podCount" // +required Nodes int32 `json:"nodes"` // (Required) Container image information // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Cockroach Database Image" // +optional Image PodImage `json:"image"` // (Optional) The database port (`--port` CLI parameter when starting the service) // Default: 26258 // +optional GRPCPort *int32 `json:"grpcPort,omitempty"` // The web UI port (`--http-port` CLI parameter when starting the service) // Default: 8080 // +optional HTTPPort *int32 `json:"httpPort,omitempty"` // The SQL Port number // Default: 26257 // +optional SQLPort *int32 `json:"sqlPort,omitempty"` // (Optional) TLSEnabled determines if TLS is enabled for your CockroachDB Cluster // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="TLS Enabled",xDescriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch" // +optional TLSEnabled bool `json:"tlsEnabled,omitempty"` // (Optional) The secret with certificates and a private key for the TLS endpoint // on the database port. The standard naming of files is expected (tls.key, tls.crt, ca.crt) // Default: "" // +optional NodeTLSSecret string `json:"nodeTLSSecret,omitempty"` // (Optional) The secret with a certificate and a private key for root database user // Default: "" // +optional ClientTLSSecret string `json:"clientTLSSecret,omitempty"` // This number is set in the PodDistruptionBudget and defaults to 1. // +optional MaxUnavailable *int32 `json:"maxUnavailable,omitempty"` // (Optional) The min number of pods that can be unavailable during a rolling update. // This number is set in the PodDistruptionBudget and defaults to 1. // +optional MinAvailable *int32 `json:"minAvailable,omitempty"` // (Optional) The total size for caches (`--cache` command line parameter) // Default: "25%" // +optional Cache string `json:"cache,omitempty"` // (Optional) The maximum in-memory storage capacity available to store temporary // data for SQL queries (`--max-sql-memory` parameter) // Default: "25%" // +optional MaxSQLMemory string `json:"maxSQLMemory,omitempty"` // (Optional) Additional command line arguments for the `cockroach` binary // Default: "" // +optional AdditionalArgs []string `json:"additionalArgs,omitempty"` // (Optional) Database container resource limits. Any container limits // can be specified. // Default: (not specified) // +optional Resources corev1.ResourceRequirements `json:"resources,omitempty"` // (Required) Database disk storage configuration // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Data Store" // +required DataStore Volume `json:"dataStore,omitempty"` // (Optional) CockroachDBVersion sets the explicit version of the cockroachDB image // Default: "" // +optional CockroachDBVersion string `json:"cockroachDBVersion,omitempty"` }
CrdbClusterSpec defines the desired state of a CockroachDB Cluster that the operator maintains.
func (*CrdbClusterSpec) DeepCopy ¶
func (in *CrdbClusterSpec) DeepCopy() *CrdbClusterSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrdbClusterSpec.
func (*CrdbClusterSpec) DeepCopyInto ¶
func (in *CrdbClusterSpec) DeepCopyInto(out *CrdbClusterSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CrdbClusterStatus ¶
type CrdbClusterStatus struct { // List of conditions representing the current status of the cluster resource. // +operator-sdk:csv:customresourcedefinitions:type=status, displayName="Cluster Conditions",xDescriptors="urn:alm:descriptor:io.kubernetes.conditions" Conditions []ClusterCondition `json:"conditions,omitempty"` // +operator-sdk:csv:customresourcedefinitions:type=status, displayName="Crdb Actions",xDescriptors="urn:alm:descriptor:com.tectonic.ui:hidden" OperatorActions []ClusterAction `json:"operatorActions,omitempty"` // Database service version. Not populated and is just a placeholder currently. // +operator-sdk:csv:customresourcedefinitions:type=status, displayName="Version",xDescriptors="urn:alm:descriptor:com.tectonic.ui:hidden" Version string `json:"version,omitempty"` // CrdbContainerImage is the container that will be installed // +operator-sdk:csv:customresourcedefinitions:type=status, displayName="CrdbContainerImage",xDescriptors="urn:alm:descriptor:com.tectonic.ui:hidden" CrdbContainerImage string `json:"crdbcontainerimage,omitempty"` // OperatorStatus represent the status of the operator(Failed, Starting, Running or Other) // +operator-sdk:csv:customresourcedefinitions:type=status, displayName="OperatorStatus" ClusterStatus string `json:"clusterStatus,omitempty"` }
CrdbClusterStatus defines the observed state of Cluster
func (*CrdbClusterStatus) DeepCopy ¶
func (in *CrdbClusterStatus) DeepCopy() *CrdbClusterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrdbClusterStatus.
func (*CrdbClusterStatus) DeepCopyInto ¶
func (in *CrdbClusterStatus) DeepCopyInto(out *CrdbClusterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodImage ¶
type PodImage struct { // Container image with supported CockroachDB version. // This defaults to the version pinned to the operator and requires a full container and tag/sha name. // For instance: cockroachdb/cockroachdb:v20.1 // +required Name string `json:"name,omitempty"` // PullPolicy for the image, which defaults to IfNotPresent. // +required PullPolicyName *corev1.PullPolicy `json:"pullPolicy,omitempty"` // Secret name containing the dockerconfig to use for a // registry that requires authentication. The secret // must be configured first by the user. // +optional PullSecret *string `json:"pullSecret,omitempty"` }
PodImage represents the image information for a container that is used to build the StatefulSet.
func (*PodImage) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodImage.
func (*PodImage) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Volume ¶
type Volume struct { // Directory from the host node's filesystem // +optional HostPath *corev1.HostPathVolumeSource `json:"hostPath,omitempty"` // Persistent volume to use // +optional VolumeClaim *VolumeClaim `json:"pvc,omitempty"` // SupportsAutoResize marks that a PVC will resize without restarting the entire cluster // Default: false // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="PVC Supports Auto Resizing",xDescriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch" // +optional SupportsAutoResize bool `json:"supportsAutoResize"` }
Volume defined storage configuration for the container with the Database. Only one of the fields should set
func (*Volume) Apply ¶
func (v *Volume) Apply(name string, container string, path string, spec *appsv1.StatefulSetSpec, metaMutator func(name string) metav1.ObjectMeta) error
func (*Volume) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Volume.
func (*Volume) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VolumeClaim ¶
type VolumeClaim struct { // PVC to request a new persistent volume // +required PersistentVolumeClaimSpec corev1.PersistentVolumeClaimSpec `json:"spec,omitempty"` // Existing PVC in the same namespace // +required PersistentVolumeSource corev1.PersistentVolumeClaimVolumeSource `json:"source,omitempty"` }
VolumeClaim wraps a persistent volume claim (PVC) to use with the container. Only one of the fields should set
func (*VolumeClaim) DeepCopy ¶
func (in *VolumeClaim) DeepCopy() *VolumeClaim
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeClaim.
func (*VolumeClaim) DeepCopyInto ¶
func (in *VolumeClaim) DeepCopyInto(out *VolumeClaim)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.