v1

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package v1 contains API Schema definitions for the persistance v1 API group +kubebuilder:object:generate=true +groupName=persistance.atlas.infoblox.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "persistance.atlas.infoblox.com", Version: "v1"}

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

type Database struct {
	// DSN is the connection string used to reach the postgres database
	// must have protocol specifier at beginning (example: mysql://  postgres:// )
	DSN string `json:"dsn"`

	// SecretRef specifies a secret to use for connecting to the postgresdb (should be master/root)
	// TODO: document/validate the secret format required
	// +optional
	SecretRef *SecretRef `json:"secretRef,omitempty"`
}

Database defines the details of an existing database to use as a backup restoration source

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.

type DatabaseClaim

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

	Spec   DatabaseClaimSpec   `json:"spec,omitempty"`
	Status DatabaseClaimStatus `json:"status,omitempty"`
}

DatabaseClaim is the Schema for the databaseclaims API

func (*DatabaseClaim) DeepCopy

func (in *DatabaseClaim) DeepCopy() *DatabaseClaim

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

func (*DatabaseClaim) DeepCopyInto

func (in *DatabaseClaim) DeepCopyInto(out *DatabaseClaim)

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

func (*DatabaseClaim) DeepCopyObject

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

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

type DatabaseClaimConnectionInfo

type DatabaseClaimConnectionInfo struct {
	Host         string `json:"hostName,omitempty"`
	Port         string `json:"port,omitempty"`
	DatabaseName string `json:"databaseName,omitempty"`
	Username     string `json:"userName,omitempty"`
	Password     string `json:"password,omitempty"`
	SSLMode      string `json:"sslMode,omitempty"`
}

func ParseUri

func ParseUri(dsn string) (*DatabaseClaimConnectionInfo, error)

func (*DatabaseClaimConnectionInfo) DeepCopy

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

func (*DatabaseClaimConnectionInfo) DeepCopyInto

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

func (*DatabaseClaimConnectionInfo) Uri

type DatabaseClaimList

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

DatabaseClaimList contains a list of DatabaseClaim

func (*DatabaseClaimList) DeepCopy

func (in *DatabaseClaimList) DeepCopy() *DatabaseClaimList

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

func (*DatabaseClaimList) DeepCopyInto

func (in *DatabaseClaimList) DeepCopyInto(out *DatabaseClaimList)

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

func (*DatabaseClaimList) DeepCopyObject

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

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

type DatabaseClaimSpec

type DatabaseClaimSpec struct {

	// Class is used to run multiple instances of dbcontroller.
	// +optional
	// +kubebuilder:default:="default"
	Class *string `json:"class"`

	// SourceDataFrom specifies an existing database or backup to use when initially provisioning the database.
	// if the dbclaim has already provisioned a database, this field is ignored
	// +optional
	SourceDataFrom *SourceDataFrom `json:"sourceDataFrom,omitempty"`

	// UseExistingSource instructs the controller to perform user management on the database currently defined in the SourceDataFrom field.
	// If sourceDataFrom is empty, this is ignored
	// If this is set, .sourceDataFrom.Type and .type must match to use an existing source (since they must be the same)
	// If this field was set and becomes unset, migration of data will commence
	// +optional
	// +kubebuilder:default:=false
	UseExistingSource *bool `json:"useExistingSource"`

	// Specifies an indentifier for the application using the database.
	AppID string `json:"appId"`

	// Specifies the type of database to provision. Only postgres is supported.
	// +required
	Type DatabaseType `json:"type"`

	// In most cases the AppID will match the database name. In some cases, however, we will need to provide an optional override.
	DBNameOverride string `json:"dbNameOverride,omitempty"`

	// If provided, marks auto storage scalling to true for postgres DBinstance. The value represents the maximum allowed storage to scale upto.
	// For auroraDB instance, this value is ignored.
	MaxStorageGB int64 `json:"maxStorageGB,omitempty"`

	// The name of the secret to use for storing the ConnectionInfo.  Must follow a naming convention that ensures it is unique.
	SecretName string `json:"secretName,omitempty"`

	// The matching fragment key name of the database instance that will host the database.
	InstanceLabel string `json:"instanceLabel,omitempty"`

	// The username that the application will use for accessing the database.
	Username string `json:"userName"`

	// The optional host name where the database instance is located.
	// If the value is omitted, then the host value from the matching InstanceLabel will be used.
	// +optional
	Host string `json:"host,omitempty"`

	// The optional port to use for connecting to the host.
	// If the value is omitted, then the host value from the matching InstanceLabel will be used.
	// +optional
	Port string `json:"port,omitempty"`

	// The name of the database within InstanceLabel.
	// +required
	DatabaseName string `json:"databaseName"`

	// The version of the database.
	// +optional
	DBVersion string `json:"dbVersion"`

	// DSN key name.
	DSNName string `json:"dsnName"`

	// The optional Shape values are arbitrary and help drive instance selection
	// +optional
	Shape string `json:"shape"`

	// The optional MinStorageGB value requests the minimum database host storage capacity in GBytes
	// +optional
	MinStorageGB int `json:"minStorageGB"`

	// BackupPolicy specifies the duration at which db backups are taken
	// +optional
	// +kubebuilder:validation:Enum=Bronze;Silver;Gold;Platinum
	BackupPolicy string `json:"backupPolicy,omitempty"`

	// RestoreFrom indicates the snapshot to restore the Database from
	// +optional
	RestoreFrom string `json:"restoreFrom,omitempty"`

	// EnableReplicationRole will grant rds replication role to Username
	// This value is ignored if EnableSuperUser is set to true
	// +optional
	// +kubebuilder:default:=false
	EnableReplicationRole *bool `json:"enableReplicationRole"`

	// EnableSuperUser will grant rds_superuser and createrole role to Username
	// This value is ignored if {{ .Values.controllerConfig.supportSuperUserElevation }} is set to false
	// +optional
	// +kubebuilder:default:=false
	EnableSuperUser *bool `json:"enableSuperUser"`

	// Tags
	// +optional
	// +nullable
	Tags []Tag `json:"tags,omitempty"`
}

DatabaseClaimSpec defines the desired state of DatabaseClaim

func (*DatabaseClaimSpec) DeepCopy

func (in *DatabaseClaimSpec) DeepCopy() *DatabaseClaimSpec

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

func (*DatabaseClaimSpec) DeepCopyInto

func (in *DatabaseClaimSpec) DeepCopyInto(out *DatabaseClaimSpec)

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

type DatabaseClaimStatus

type DatabaseClaimStatus struct {
	// Any errors related to provisioning this claim.
	Error string `json:"error,omitempty"`
	//track the status of new db in the process of being created
	NewDB Status `json:"newDB,omitempty"`
	//track the status of the active db being used by the application
	ActiveDB Status `json:"activeDB,omitempty"`
	//tracks status of DB migration. if empty, not started.
	//non empty denotes migration in progress, unless it is S_Completed
	MigrationState string `json:"migrationState,omitempty"`
	// tracks the DB which is migrated and not more operational
	OldDB StatusForOldDB `json:"oldDB,omitempty"`
}

DatabaseClaimStatus defines the observed state of DatabaseClaim

func (*DatabaseClaimStatus) DeepCopy

func (in *DatabaseClaimStatus) DeepCopy() *DatabaseClaimStatus

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

func (*DatabaseClaimStatus) DeepCopyInto

func (in *DatabaseClaimStatus) DeepCopyInto(out *DatabaseClaimStatus)

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

type DatabaseType

type DatabaseType string
const (
	Postgres DatabaseType = "postgres"
	MySQL    DatabaseType = "mysql"
	Aurora   DatabaseType = "aurora"
)

type DbRoleClaim

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

	Spec   DbRoleClaimSpec   `json:"spec,omitempty"`
	Status DbRoleClaimStatus `json:"status,omitempty"`
}

DbRoleClaim is the Schema for the dbroleclaims API

func (*DbRoleClaim) DeepCopy

func (in *DbRoleClaim) DeepCopy() *DbRoleClaim

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

func (*DbRoleClaim) DeepCopyInto

func (in *DbRoleClaim) DeepCopyInto(out *DbRoleClaim)

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

func (*DbRoleClaim) DeepCopyObject

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

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

type DbRoleClaimList

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

DbRoleClaimList contains a list of DbRoleClaim

func (*DbRoleClaimList) DeepCopy

func (in *DbRoleClaimList) DeepCopy() *DbRoleClaimList

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

func (*DbRoleClaimList) DeepCopyInto

func (in *DbRoleClaimList) DeepCopyInto(out *DbRoleClaimList)

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

func (*DbRoleClaimList) DeepCopyObject

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

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

type DbRoleClaimSpec

type DbRoleClaimSpec struct {

	// Class is used to run multiple instances of dbcontroller.
	// +optional
	// +kubebuilder:default:="default"
	Class *string `json:"class"`

	SourceDatabaseClaim *SourceDatabaseClaim `json:"sourceDatabaseClaim"`

	// The name of the secret to use for storing the ConnectionInfo.  Must follow a naming convention that ensures it is unique.
	SecretName string `json:"secretName,omitempty"`
}

DbRoleClaimSpec defines the desired state of DbRoleClaim

func (*DbRoleClaimSpec) DeepCopy

func (in *DbRoleClaimSpec) DeepCopy() *DbRoleClaimSpec

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

func (*DbRoleClaimSpec) DeepCopyInto

func (in *DbRoleClaimSpec) DeepCopyInto(out *DbRoleClaimSpec)

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

type DbRoleClaimStatus

type DbRoleClaimStatus struct {

	// Any errors related to provisioning this claim.
	Error string `json:"error,omitempty"`

	// Identifies the databaseclaim this CR is associated with
	MatchedSourceClaim string `json:"matchedSourceClaim,omitempty"`

	// Identifies the source secret this claim in inheriting from
	SourceSecret string `json:"sourceSecret,omitempty"`

	// Tracks the resourceVersion of the source secret. Used to identify changes to the secret and to trigger a sync
	SourceSecretResourceVersion string `json:"sourceSecretResourceVersion,omitempty"`

	// Time the secret attached to this claim was created
	SecretCreatedAt *metav1.Time `json:"secretCreatedAt,omitempty"`

	// Time the secret attached to this claim was updated
	SecretUpdatedAt *metav1.Time `json:"secretUpdatedAt,omitempty"`
}

DbRoleClaimStatus defines the observed state of DbRoleClaim

func (*DbRoleClaimStatus) DeepCopy

func (in *DbRoleClaimStatus) DeepCopy() *DbRoleClaimStatus

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

func (*DbRoleClaimStatus) DeepCopyInto

func (in *DbRoleClaimStatus) DeepCopyInto(out *DbRoleClaimStatus)

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

type DbState

type DbState string

DbState keeps track of state of the DB.

const (
	Ready                   DbState = "ready"
	InProgress              DbState = "in-progress"
	UsingExistingDB         DbState = "using-existing-db"
	UsingSharedHost         DbState = "using-shared-host"
	PostMigrationInProgress DbState = "post-migration-in-progress"
)

type S3BackupConfiguration

type S3BackupConfiguration struct {
	// +required
	Region string `json:"region"`

	// +required
	Bucket string `json:"bucket"`

	// Prefix is the path prefix of the S3 bucket within which the backup to restore is located.
	// +optional
	Prefix *string `json:"prefix,omitempty"`

	// SourceEngine is the engine used to create the backup.
	SourceEngine *SQLEngine `json:"sourceEngine"`

	// SourceEngineVersion is the version of the engine used to create the backup.
	// Example: "5.7.30"
	SourceEngineVersion *string `json:"sourceEngineVersion"`

	// SecretRef specifies a secret to use for connecting to the s3 bucket via AWS client
	// TODO: document/validate the secret format required
	// +optional
	SecretRef *SecretRef `json:"secretRef,omitempty"`
}

S3BackupConfiguration defines the details of the S3 backup to restore from.

func (*S3BackupConfiguration) DeepCopy

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

func (*S3BackupConfiguration) DeepCopyInto

func (in *S3BackupConfiguration) DeepCopyInto(out *S3BackupConfiguration)

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

type SQLEngine

type SQLEngine string
const (
	MysqlEngine      SQLEngine = "mysql"
	PostgresqlEngine SQLEngine = "postgres"
)

SQL database engines.

type SecretRef

type SecretRef struct {
	Namespace string `json:"namespace,omitempty"`
	Name      string `json:"name"`
}

SecretRef provides the information necessary to reference a Kubernetes Secret

func (*SecretRef) DeepCopy

func (in *SecretRef) DeepCopy() *SecretRef

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

func (*SecretRef) DeepCopyInto

func (in *SecretRef) DeepCopyInto(out *SecretRef)

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

type SourceDataFrom

type SourceDataFrom struct {
	// Type specifies the type of source
	// +required
	Type SourceDataType `json:"type"`

	// Database defines the connection information to an existing db
	// +optional
	Database *Database `json:"database,omitempty"`

	// S3 defines the location of a DB backup in an S3 bucket
	// +optional
	S3 *S3BackupConfiguration `json:"s3,omitempty"`
}

SourceDataFrom is a union object for specifying the initial state of a DB that should be used when provisioning a DatabaseClaim

func (*SourceDataFrom) DeepCopy

func (in *SourceDataFrom) DeepCopy() *SourceDataFrom

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

func (*SourceDataFrom) DeepCopyInto

func (in *SourceDataFrom) DeepCopyInto(out *SourceDataFrom)

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

type SourceDataType

type SourceDataType string
const (
	DatabaseSource SourceDataType = "database"
	S3Source       SourceDataType = "s3"
)

type SourceDatabaseClaim

type SourceDatabaseClaim struct {
	// Namespace of the source databaseclaim
	// +kubebuilder:default:="default"
	Namespace string `json:"namespace"`

	// Name  of the source databaseclaim
	Name string `json:"name"`
}

SourceDatabaseClaim defines the DatabaseClaim which owns the actual database

func (*SourceDatabaseClaim) DeepCopy

func (in *SourceDatabaseClaim) DeepCopy() *SourceDatabaseClaim

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

func (*SourceDatabaseClaim) DeepCopyInto

func (in *SourceDatabaseClaim) DeepCopyInto(out *SourceDatabaseClaim)

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

type Status

type Status struct {
	// Time the database was created
	DbCreatedAt *metav1.Time `json:"dbCreateAt,omitempty"`

	// The name of the label that was successfully matched against the fragment key names in the db-controller configMap
	MatchedLabel string `json:"matchLabel,omitempty"`

	ConnectionInfo *DatabaseClaimConnectionInfo `json:"connectionInfo"`

	// Version of the provisioned Database
	DBVersion string `json:"dbversion,omitempty"`

	// The optional Shape values are arbitrary and help drive instance selection
	Shape string `json:"shape,omitempty"`

	// The optional MinStorageGB value requests the minimum database host storage capacity in GBytes
	MinStorageGB int `json:"minStorageGB,omitempty"`

	// If provided, marks auto storage scalling to true for postgres DBinstance. The value represents the maximum allowed storage to scale upto.
	// For auroraDB instance, this value is ignored.
	MaxStorageGB int64 `json:"maxStorageGB,omitempty"`

	// Specifies the type of database to provision. Only postgres is supported.
	Type DatabaseType `json:"type,omitempty"`

	// Time the connection info was updated/created.
	ConnectionInfoUpdatedAt *metav1.Time `json:"connectionUpdatedAt,omitempty"`

	// Time the user/password was updated/created
	UserUpdatedAt *metav1.Time `json:"userUpdatedAt,omitempty"`

	// DbState of the DB. inprogress, "", ready
	DbState DbState `json:"DbState,omitempty"`

	// SourceDataFrom specifies an existing database or backup to use when initially provisioning the database.
	// if the dbclaim has already provisioned a database, this field is ignored
	// This field used when claim is use-existing-db and attempting to migrate to newdb
	// +optional
	SourceDataFrom *SourceDataFrom `json:"sourceDataFrom,omitempty"`
}

func (*Status) DeepCopy

func (in *Status) DeepCopy() *Status

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

func (*Status) DeepCopyInto

func (in *Status) DeepCopyInto(out *Status)

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

type StatusForOldDB added in v1.0.1

type StatusForOldDB struct {
	// Time the connection info was updated/created.
	ConnectionInfo *DatabaseClaimConnectionInfo `json:"connectionInfo,omitempty"`

	// Version of the provisioned Database
	DBVersion string `json:"dbversion,omitempty"`

	// The optional Shape values are arbitrary and help drive instance selection
	Shape string `json:"shape,omitempty"`

	// Specifies the type of database to provision. Only postgres is supported.
	Type DatabaseType `json:"type,omitempty"`

	// Time at the process of post migration actions initiated
	PostMigrationActionStartedAt *metav1.Time `json:"postMigrationActionStartedAt,omitempty"`

	// DbState of the DB. inprogress, "", ready
	DbState DbState `json:"DbState,omitempty"`

	// The optional MinStorageGB value requests the minimum database host storage capacity in GBytes
	MinStorageGB int `json:"minStorageGB,omitempty"`
}

func (*StatusForOldDB) DeepCopy added in v1.0.1

func (in *StatusForOldDB) DeepCopy() *StatusForOldDB

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

func (*StatusForOldDB) DeepCopyInto added in v1.0.1

func (in *StatusForOldDB) DeepCopyInto(out *StatusForOldDB)

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

type Tag

type Tag struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Tag

func (*Tag) DeepCopy

func (in *Tag) DeepCopy() *Tag

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

func (*Tag) DeepCopyInto

func (in *Tag) DeepCopyInto(out *Tag)

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