v1beta1

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v1beta1 contains API Schema definitions for the v1beta1 API group +kubebuilder:object:generate=true +groupName=kci.rocks

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "kci.rocks", 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 BackendServer

type BackendServer struct {
	Host          string `json:"host"`
	Port          uint16 `json:"port"`
	MaxConnection uint16 `json:"maxConn"`
	ReadOnly      bool   `json:"readonly,omitempty"`
}

BackendServer defines backend database server

func (*BackendServer) DeepCopy

func (in *BackendServer) DeepCopy() *BackendServer

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

func (*BackendServer) DeepCopyInto

func (in *BackendServer) DeepCopyInto(out *BackendServer)

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

type Database

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

	Spec   DatabaseSpec   `json:"spec,omitempty"`
	Status DatabaseStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:shortName=db +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="current db phase" +kubebuilder:printcolumn:name="Status",type=boolean,JSONPath=`.status.status`,description="current db status" +kubebuilder:printcolumn:name="Protected",type=boolean,JSONPath=`.spec.deletionProtected`,description="If database is protected to not get deleted." +kubebuilder:printcolumn:name="DBInstance",type=string,JSONPath=`.spec.instance`,description="instance reference" +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="time since creation of resource" +kubebuilder:storageversion Database is the Schema for the databases API

func (*Database) DeepCopy

func (in *Database) DeepCopy() *Database

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

func (*Database) DeepCopyInto

func (in *Database) DeepCopyInto(out *Database)

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

func (*Database) DeepCopyObject

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

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

func (*Database) Default

func (r *Database) Default()

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

func (*Database) GetBackendType

func (db *Database) GetBackendType() (string, error)

GetBackendType returns type of instance infrastructure. Infrastructure where database is running ex) google cloud sql, generic instance

func (*Database) GetEngineType

func (db *Database) GetEngineType() (string, error)

GetEngineType returns type of database engine ex) postgres or mysql

func (*Database) GetInstanceRef

func (db *Database) GetInstanceRef() (*DbInstance, error)

GetInstanceRef returns DbInstance pointer which used by Database

func (*Database) Hub

func (db *Database) Hub()

func (*Database) InstanceAccessSecretName

func (db *Database) InstanceAccessSecretName() string

AccessSecretName returns string value to define name of the secret resource for accessing instance

func (*Database) IsMonitoringEnabled

func (db *Database) IsMonitoringEnabled() (bool, error)

IsMonitoringEnabled returns true if monitoring is enabled in DbInstance spec.

func (*Database) SetupWebhookWithManager

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

func (*Database) ValidateCreate

func (r *Database) ValidateCreate() error

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

func (*Database) ValidateDelete

func (r *Database) ValidateDelete() error

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

func (*Database) ValidateUpdate

func (r *Database) ValidateUpdate(old runtime.Object) error

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

type DatabaseBackup

type DatabaseBackup struct {
	Enable bool   `json:"enable"`
	Cron   string `json:"cron"`
}

DatabaseBackup defines the desired state of backup and schedule

func (*DatabaseBackup) DeepCopy

func (in *DatabaseBackup) DeepCopy() *DatabaseBackup

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

func (*DatabaseBackup) DeepCopyInto

func (in *DatabaseBackup) DeepCopyInto(out *DatabaseBackup)

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

type DatabaseList

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

DatabaseList contains a list of Database

func (*DatabaseList) DeepCopy

func (in *DatabaseList) DeepCopy() *DatabaseList

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

func (*DatabaseList) DeepCopyInto

func (in *DatabaseList) DeepCopyInto(out *DatabaseList)

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

func (*DatabaseList) DeepCopyObject

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

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

type DatabaseProxyStatus

type DatabaseProxyStatus struct {
	Status      bool   `json:"status"`
	ServiceName string `json:"serviceName"`
	SQLPort     int32  `json:"sqlPort"`
}

DatabaseProxyStatus defines whether proxy for database is enabled or not if so, provide information

func (*DatabaseProxyStatus) DeepCopy

func (in *DatabaseProxyStatus) DeepCopy() *DatabaseProxyStatus

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

func (*DatabaseProxyStatus) DeepCopyInto

func (in *DatabaseProxyStatus) DeepCopyInto(out *DatabaseProxyStatus)

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

type DatabaseSpec

type DatabaseSpec struct {
	SecretName        string            `json:"secretName"`
	Instance          string            `json:"instance"`
	DeletionProtected bool              `json:"deletionProtected"`
	Backup            DatabaseBackup    `json:"backup"`
	SecretsTemplates  map[string]string `json:"secretsTemplates,omitempty"`
	Postgres          Postgres          `json:"postgres,omitempty"`
	Cleanup           bool              `json:"cleanup,omitempty"`
}

DatabaseSpec defines the desired state of Database

func (*DatabaseSpec) DeepCopy

func (in *DatabaseSpec) DeepCopy() *DatabaseSpec

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

func (*DatabaseSpec) DeepCopyInto

func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec)

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

type DatabaseStatus

type DatabaseStatus struct {
	// Important: Run "make generate" to regenerate code after modifying this file
	// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
	Phase                 string              `json:"phase"`
	Status                bool                `json:"status"`
	InstanceRef           *DbInstance         `json:"instanceRef"`
	MonitorUserSecretName string              `json:"monitorUserSecret,omitempty"`
	ProxyStatus           DatabaseProxyStatus `json:"proxyStatus,omitempty"`
	DatabaseName          string              `json:"database"`
	UserName              string              `json:"user"`
}

DatabaseStatus defines the observed state of Database

func (*DatabaseStatus) DeepCopy

func (in *DatabaseStatus) DeepCopy() *DatabaseStatus

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

func (*DatabaseStatus) DeepCopyInto

func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus)

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

type DbInstance

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

	Spec   DbInstanceSpec   `json:"spec,omitempty"`
	Status DbInstanceStatus `json:"status,omitempty"`
}

DbInstance is the Schema for the dbinstances API

func (*DbInstance) DeepCopy

func (in *DbInstance) DeepCopy() *DbInstance

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

func (*DbInstance) DeepCopyInto

func (in *DbInstance) DeepCopyInto(out *DbInstance)

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

func (*DbInstance) DeepCopyObject

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

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

func (*DbInstance) Default

func (r *DbInstance) Default()

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

func (*DbInstance) GetBackendType

func (dbin *DbInstance) GetBackendType() (string, error)

GetBackendType returns type of instance infrastructure. Infrastructure where database is running ex) google cloud sql, generic instance

func (*DbInstance) Hub

func (db *DbInstance) Hub()

func (*DbInstance) IsMonitoringEnabled

func (dbin *DbInstance) IsMonitoringEnabled() bool

IsMonitoringEnabled returns boolean value if monitoring is enabled for the instance

func (*DbInstance) SetupWebhookWithManager

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

func (*DbInstance) ValidateBackend

func (dbin *DbInstance) ValidateBackend() error

ValidateBackend checks if backend type of instance is defined properly returns error when more than one backend types are defined or when no backend type is defined

func (*DbInstance) ValidateCreate

func (r *DbInstance) ValidateCreate() error

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

func (*DbInstance) ValidateDelete

func (r *DbInstance) ValidateDelete() error

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

func (*DbInstance) ValidateEngine

func (dbin *DbInstance) ValidateEngine() error

ValidateEngine checks if defined engine by DbInstance object is supported by db-operator

func (*DbInstance) ValidateUpdate

func (r *DbInstance) ValidateUpdate(old runtime.Object) error

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

type DbInstanceBackup

type DbInstanceBackup struct {
	Bucket string `json:"bucket"`
}

DbInstanceBackup defines name of google bucket to use for storing database dumps for backup when backup is enabled

func (*DbInstanceBackup) DeepCopy

func (in *DbInstanceBackup) DeepCopy() *DbInstanceBackup

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

func (*DbInstanceBackup) DeepCopyInto

func (in *DbInstanceBackup) DeepCopyInto(out *DbInstanceBackup)

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

type DbInstanceList

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

DbInstanceList contains a list of DbInstance

func (*DbInstanceList) DeepCopy

func (in *DbInstanceList) DeepCopy() *DbInstanceList

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

func (*DbInstanceList) DeepCopyInto

func (in *DbInstanceList) DeepCopyInto(out *DbInstanceList)

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

func (*DbInstanceList) DeepCopyObject

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

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

type DbInstanceMonitoring

type DbInstanceMonitoring struct {
	Enabled bool `json:"enabled"`
}

DbInstanceMonitoring defines if exporter

func (*DbInstanceMonitoring) DeepCopy

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

func (*DbInstanceMonitoring) DeepCopyInto

func (in *DbInstanceMonitoring) DeepCopyInto(out *DbInstanceMonitoring)

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

type DbInstanceSSLConnection

type DbInstanceSSLConnection struct {
	Enabled bool `json:"enabled"`
	// SkipVerity use SSL connection, but don't check against a CA
	SkipVerify bool `json:"skip-verify"`
}

DbInstanceSSLConnection defines weather connection from db-operator to instance has to be ssl or not

func (*DbInstanceSSLConnection) DeepCopy

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

func (*DbInstanceSSLConnection) DeepCopyInto

func (in *DbInstanceSSLConnection) DeepCopyInto(out *DbInstanceSSLConnection)

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

type DbInstanceSource

type DbInstanceSource struct {
	Google  *GoogleInstance  `json:"google,omitempty" protobuf:"bytes,1,opt,name=google"`
	Generic *GenericInstance `json:"generic,omitempty" protobuf:"bytes,2,opt,name=generic"`
}

DbInstanceSource represents the source of a instance. Only one of its members may be specified.

func (*DbInstanceSource) DeepCopy

func (in *DbInstanceSource) DeepCopy() *DbInstanceSource

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

func (*DbInstanceSource) DeepCopyInto

func (in *DbInstanceSource) DeepCopyInto(out *DbInstanceSource)

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

type DbInstanceSpec

type DbInstanceSpec struct {
	// Important: Run "make generate" to regenerate code after modifying this file
	Engine           string                  `json:"engine"`
	AdminUserSecret  NamespacedName          `json:"adminSecretRef"`
	Backup           DbInstanceBackup        `json:"backup,omitempty"`
	Monitoring       DbInstanceMonitoring    `json:"monitoring,omitempty"`
	SSLConnection    DbInstanceSSLConnection `json:"sslConnection,omitempty"`
	DbInstanceSource `json:",inline"`
}

DbInstanceSpec defines the desired state of DbInstance

func (*DbInstanceSpec) DeepCopy

func (in *DbInstanceSpec) DeepCopy() *DbInstanceSpec

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

func (*DbInstanceSpec) DeepCopyInto

func (in *DbInstanceSpec) DeepCopyInto(out *DbInstanceSpec)

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

type DbInstanceStatus

type DbInstanceStatus struct {
	// Important: Run "make generate" to regenerate code after modifying this file
	Phase     string            `json:"phase"`
	Status    bool              `json:"status"`
	Info      map[string]string `json:"info,omitempty"`
	Checksums map[string]string `json:"checksums,omitempty"`
}

DbInstanceStatus defines the observed state of DbInstance

func (*DbInstanceStatus) DeepCopy

func (in *DbInstanceStatus) DeepCopy() *DbInstanceStatus

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

func (*DbInstanceStatus) DeepCopyInto

func (in *DbInstanceStatus) DeepCopyInto(out *DbInstanceStatus)

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

type GenericInstance

type GenericInstance struct {
	Host     string `json:"host"`
	Port     uint16 `json:"port"`
	PublicIP string `json:"publicIp,omitempty"`
	// BackupHost address will be used for dumping database for backup
	// Usually secondary address for primary-secondary setup or cluster lb address
	// If it's not defined, above Host will be used as backup host address.
	BackupHost string `json:"backupHost,omitempty"`
}

GenericInstance is used when instance type is generic and describes necessary informations to use instance generic instance can be any backend, it must be reachable by described address and port

func (*GenericInstance) DeepCopy

func (in *GenericInstance) DeepCopy() *GenericInstance

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

func (*GenericInstance) DeepCopyInto

func (in *GenericInstance) DeepCopyInto(out *GenericInstance)

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

type GoogleInstance

type GoogleInstance struct {
	InstanceName  string         `json:"instance"`
	ConfigmapName NamespacedName `json:"configmapRef"`
	APIEndpoint   string         `json:"apiEndpoint,omitempty"`
	ClientSecret  NamespacedName `json:"clientSecretRef,omitempty"`
}

GoogleInstance is used when instance type is Google Cloud SQL and describes necessary informations to use google API to create sql instances

func (*GoogleInstance) DeepCopy

func (in *GoogleInstance) DeepCopy() *GoogleInstance

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

func (*GoogleInstance) DeepCopyInto

func (in *GoogleInstance) DeepCopyInto(out *GoogleInstance)

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

type NamespacedName

type NamespacedName struct {
	Namespace string `json:"Namespace"`
	Name      string `json:"Name"`
}

NamespacedName is a fork of the kubernetes api type of the same name. Sadly this is required because CRD structs must have all fields json tagged and the kubernetes type is not tagged.

func (*NamespacedName) DeepCopy

func (in *NamespacedName) DeepCopy() *NamespacedName

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

func (*NamespacedName) DeepCopyInto

func (in *NamespacedName) DeepCopyInto(out *NamespacedName)

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

func (*NamespacedName) ToKubernetesType

func (nn *NamespacedName) ToKubernetesType() types.NamespacedName

ToKubernetesType converts our local type to the kubernetes API equivalent.

type Postgres

type Postgres struct {
	Extensions []string `json:"extensions,omitempty"`
	// If set to true, the public schema will be dropped after the database creation
	DropPublicSchema bool `json:"dropPublicSchema,omitempty"`
	// Specify schemas to be created. The user created by db-operator will have all access on them.
	Schemas []string `json:"schemas,omitempty"`
}

Postgres struct should be used to provide resource that only applicable to postgres

func (*Postgres) DeepCopy

func (in *Postgres) DeepCopy() *Postgres

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

func (*Postgres) DeepCopyInto

func (in *Postgres) DeepCopyInto(out *Postgres)

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