v1alpha1

package
v0.5.0-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// CronAnythingCreatedByLabel is the name of the label used by CronAnything to
	// denote the entity which created the resource.
	CronAnythingCreatedByLabel = "db.anthosapis.com/created-by"

	// CronAnythingScheduleTimeLabel is the name of the label used by CronAnything
	// to denote the schedule time.
	CronAnythingScheduleTimeLabel = "db.anthosapis.com/schedule-time"

	// TriggerHistoryMaxLength defines the maximum number of trigger history to
	// keep track of by CronAnything.
	TriggerHistoryMaxLength = 10
)
View Source
const (
	// Monitoring service provides the ability to collect
	// monitoring data from the database and the cluster.
	Monitoring Service = "Monitoring"

	// BackupAndRestore service provides database backups and restore functionalities.
	BackupAndRestore Service = "Backup"

	// Security service
	Security Service = "Security"

	// Logging service
	Logging Service = "Logging"

	// Patching service provides software and database patching.
	Patching Service = "Patching"

	// ManuallySetUpStandby means that operator will skip DB creation during
	// provisioning, instance will be ready for users to manually set up standby.
	ManuallySetUpStandby InstanceMode = "ManuallySetUpStandby"

	// Pause Mode means the instance will stop processing incoming API calls and
	// terminate any pending LRO operation after a grace period
	Pause InstanceMode = "Pause"

	// AdminPasswordTimeoutMinute is the timeout period for admin password
	AdminPasswordTimeoutMinute time.Duration = 20 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminUserSpec

type AdminUserSpec struct {
	// ForceResetPassword defines the flag needed to reset admin user password
	// +optional
	ForceResetPassword bool `json:"forceResetPassword,omitempty"`

	// RequestTime is a date-time to avoid triggering of a password reset repeatedly.
	// If at least one password reset operation has occurred, any further reset
	// operation that have RequestTime same or earlier than CreateTime will be ignored.
	// +optional
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Format=date-time
	RequestTime metav1.Time `json:"requestTime,omitempty"`
}

AdminUserSpec defines the desired state of admin user

func (*AdminUserSpec) DeepCopy

func (in *AdminUserSpec) DeepCopy() *AdminUserSpec

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

func (*AdminUserSpec) DeepCopyInto

func (in *AdminUserSpec) DeepCopyInto(out *AdminUserSpec)

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

type AdminUserStatus

type AdminUserStatus struct {
	// SecretRef is a reference to the secret that contains admin user password
	// +optional
	SecretRef *corev1.SecretReference `json:"secretRef,omitempty"`

	// CreateTime is the time admin user is created or last updated
	// +optional
	CreateTime metav1.Time `json:"createTime,omitempty"`

	// ExpireTime is the expire time of the secret that contains admin user password
	// +optional
	ExpireTime metav1.Time `json:"expireTime,omitempty"`
}

AdminUserStatus defines the observed state of admin user +kubebuilder:object:generate=true

func (*AdminUserStatus) DeepCopy

func (in *AdminUserStatus) DeepCopy() *AdminUserStatus

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

func (*AdminUserStatus) DeepCopyInto

func (in *AdminUserStatus) DeepCopyInto(out *AdminUserStatus)

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

type Backup

type Backup interface {
	runtime.Object
	metav1.Object
	BackupSpec() *BackupSpec
	BackupStatus() *BackupStatus
}

type BackupHistoryRecord

type BackupHistoryRecord struct {
	// BackupName is the name of the Backup that gets created.
	// +nullable
	BackupName string `json:"backupName"`

	// CreationTime is the time that the Backup gets created.
	// +nullable
	CreationTime metav1.Time `json:"creationTime"`

	// Phase tells the state of the Backup.
	// +optional
	Phase BackupPhase `json:"phase,omitempty"`
}

BackupHistoryRecord is a historical record of a Backup.

func (*BackupHistoryRecord) DeepCopy

func (in *BackupHistoryRecord) DeepCopy() *BackupHistoryRecord

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

func (*BackupHistoryRecord) DeepCopyInto

func (in *BackupHistoryRecord) DeepCopyInto(out *BackupHistoryRecord)

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

type BackupPhase

type BackupPhase string
const (
	BackupPending    BackupPhase = "Pending"
	BackupInProgress BackupPhase = "InProgress"
	BackupFailed     BackupPhase = "Failed"
	BackupSucceeded  BackupPhase = "Succeeded"
)

type BackupRetentionPolicy

type BackupRetentionPolicy struct {
	// BackupRetention is the number of successful backups to keep around.
	// The default is 7.
	// A value of 0 means "do not delete backups based on count". Max of 512
	// allows for ~21 days of hourly backups or ~1.4 years of daily backups.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=512
	// +optional
	BackupRetention *int32 `json:"backupRetention,omitempty"`
}

BackupRetentionPolicy is a policy used to trigger automatic deletion of backups produced by a particular schedule. Deletion will be triggered by count (keeping a maximum number of backups around).

func (*BackupRetentionPolicy) DeepCopy

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

func (*BackupRetentionPolicy) DeepCopyInto

func (in *BackupRetentionPolicy) DeepCopyInto(out *BackupRetentionPolicy)

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

type BackupSchedule

type BackupSchedule interface {
	runtime.Object
	metav1.Object
	BackupScheduleSpec() *BackupScheduleSpec
	BackupScheduleStatus() *BackupScheduleStatus
}

BackupSchedule represent the contract for the Anthos DB Operator compliant database operator providers to abide by.

type BackupScheduleSpec

type BackupScheduleSpec struct {
	// Schedule is a cron-style expression of the schedule on which Backup will
	// be created. For allowed syntax, see en.wikipedia.org/wiki/Cron and
	// godoc.org/github.com/robfig/cron.
	Schedule string `json:"schedule"`

	// Suspend tells the controller to suspend operations - both creation of new
	// Backup and retention actions. This will not have any effect on backups
	// currently in progress. Default is false.
	// +optional
	Suspend *bool `json:"suspend,omitempty"`

	// StartingDeadlineSeconds is an optional deadline in seconds for starting the
	// backup creation if it misses scheduled time for any reason.
	// The default is 30 seconds.
	// +optional
	StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`

	// BackupRetentionPolicy is the policy used to trigger automatic deletion of
	// backups produced from this BackupSchedule.
	// +optional
	BackupRetentionPolicy *BackupRetentionPolicy `json:"backupRetentionPolicy,omitempty"`
}

BackupScheduleSpec defines the desired state of BackupSchedule.

func (*BackupScheduleSpec) DeepCopy

func (in *BackupScheduleSpec) DeepCopy() *BackupScheduleSpec

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

func (*BackupScheduleSpec) DeepCopyInto

func (in *BackupScheduleSpec) DeepCopyInto(out *BackupScheduleSpec)

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

type BackupScheduleStatus

type BackupScheduleStatus struct {
	// LastBackupTime is the time the last Backup was created for this
	// BackupSchedule.
	// +optional
	// +nullable
	LastBackupTime *metav1.Time `json:"lastBackupTime,omitempty"`

	// Conditions of the BackupSchedule.
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// BackupTotal stores the total number of current existing backups created
	// by this backupSchedule.
	BackupTotal *int32 `json:"backupTotal,omitempty"`

	// BackupHistory stores the records for up to 7 of the latest backups.
	// +optional
	BackupHistory []BackupHistoryRecord `json:"backupHistory,omitempty"`
}

BackupScheduleStatus defines the observed state of BackupSchedule.

func (*BackupScheduleStatus) DeepCopy

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

func (*BackupScheduleStatus) DeepCopyInto

func (in *BackupScheduleStatus) DeepCopyInto(out *BackupScheduleStatus)

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

type BackupSpec

type BackupSpec struct {

	// Instance is a name of an instance to take a backup for.
	// +required
	Instance string `json:"instance,omitempty"`

	// Type describes a type of a backup to take. Immutable.
	// Available options are:
	// - Snapshot: storage level disk snapshot.
	// - Physical: database engine specific backup that relies on a redo stream /
	//             continuous archiving (WAL) and may allow a PITR.
	//             Examples include pg_backup, pgBackRest, mysqlbackup.
	//             A Physical backup may be file based or database block based
	//	       (e.g. Oracle RMAN).
	// - Logical: database engine specific backup that relies on running SQL
	//            statements, e.g. mysqldump, pg_dump, expdp.
	// If not specified, the default of Snapshot is assumed.
	// +kubebuilder:validation:Enum=Snapshot;Physical;Logical
	// +optional
	Type BackupType `json:"type,omitempty"`

	// KeepDataOnDeletion defines whether to keep backup data
	// when backup resource is removed. The default value is false.
	// +optional
	KeepDataOnDeletion bool `json:"keepDataOnDeletion,omitempty"`
}

BackupSpec defines the desired state of a backup.

func (*BackupSpec) DeepCopy

func (in *BackupSpec) DeepCopy() *BackupSpec

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

func (*BackupSpec) DeepCopyInto

func (in *BackupSpec) DeepCopyInto(out *BackupSpec)

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

type BackupStatus

type BackupStatus struct {
	// Phase is a summary of current state of the Backup.
	// +optional
	Phase BackupPhase `json:"phase,omitempty"`

	// Conditions represents the latest available observations
	// of the backup's current state.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

BackupStatus defines the observed state of a backup.

func (*BackupStatus) DeepCopy

func (in *BackupStatus) DeepCopy() *BackupStatus

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

func (*BackupStatus) DeepCopyInto

func (in *BackupStatus) DeepCopyInto(out *BackupStatus)

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

type BackupType

type BackupType string

BackupType is presently defined as a free formatted string.

const (
	// See Backup.Spec.Type definition above for explanation
	// on what Snapshot, Physical and Logical backups are.
	BackupTypePhysical BackupType = "Physical"
	BackupTypeLogical  BackupType = "Logical"
	BackupTypeSnapshot BackupType = "Snapshot"
)

type ConcurrencyPolicy

type ConcurrencyPolicy string

ConcurrencyPolicy specifies the policy to use for concurrency control.

const (
	// AllowConcurrent policy specifies allowing creation of new resources
	// regardless of how many other currently active resources exist.
	AllowConcurrent ConcurrencyPolicy = "Allow"

	// ForbidConcurrent policy specifies not allowing creation of a new resource
	// if any existing resources are active.
	ForbidConcurrent ConcurrencyPolicy = "Forbid"

	// ReplaceConcurrent policy specifies deleting any existing, active resources
	// before creating a new one.
	ReplaceConcurrent ConcurrencyPolicy = "Replace"
)

type ConfigSpec

type ConfigSpec struct {
	// Service agent and other data plane agent images.
	// This is an optional map that allows a customer to specify agent images
	// different from those chosen/provided by the operator by default.
	// +optional
	Images map[string]string `json:"images,omitempty"`

	// Deployment platform.
	// Presently supported values are: GCP (default), BareMetal, Minikube and Kind.
	// +optional
	// +kubebuilder:validation:Enum=GCP;BareMetal;Minikube;Kind
	Platform string `json:"platform,omitempty"`

	// Disks slice describes at minimum two disks:
	// data and log (archive log), and optionally a backup disk.
	Disks []DiskSpec `json:"disks,omitempty"`

	// Storage class to use for dynamic provisioning.
	// This value varies depending on a platform.
	// For GCP (the default), it is "standard-rwo".
	// +optional
	StorageClass string `json:"storageClass,omitempty"`

	// Volume Snapshot class to use for storage snapshots.
	// This value varies from platform to platform.
	// For GCP (the default), it is "csi-gce-pd-snapshot-class".
	// +optional
	VolumeSnapshotClass string `json:"volumeSnapshotClass,omitempty"`

	// Log Levels for the various components.
	// This is an optional map for component -> log level
	// +optional
	LogLevel map[string]string `json:"logLevel,omitempty"`

	// HostAntiAffinityNamespaces is an optional list of namespaces that need
	// to be included in anti-affinity by hostname rule. The effect of the rule
	// is forbidding scheduling a database pod in the current namespace on a host
	// that already runs a database pod in any of the listed namespaces.
	// +optional
	HostAntiAffinityNamespaces []string `json:"hostAntiAffinityNamespaces,omitempty"`
}

ConfigSpec defines the desired state of Config.

func (*ConfigSpec) DeepCopy

func (in *ConfigSpec) DeepCopy() *ConfigSpec

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

func (*ConfigSpec) DeepCopyInto

func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec)

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

type CredentialSpec

type CredentialSpec struct {
	// Plaintext password.
	// +optional
	Password string `json:"password,omitempty"`

	// A reference to a k8s secret.
	// +optional
	SecretRef *corev1.SecretReference `json:"secretRef,omitempty"`

	// A reference to a GSM secret.
	// +optional
	GsmSecretRef *GsmSecretReference `json:"gsmSecretRef,omitempty"`
}

CredentialSpec defines the desired state of user credentials. The credential can be expressed in one of the 3 following ways:

  1. A plaintext password;
  2. A reference to a k8s secret;
  3. A reference to a remote GSM secret (note that it only works for GKE).

func (*CredentialSpec) DeepCopy

func (in *CredentialSpec) DeepCopy() *CredentialSpec

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

func (*CredentialSpec) DeepCopyInto

func (in *CredentialSpec) DeepCopyInto(out *CredentialSpec)

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

type CronAnything

type CronAnything interface {
	runtime.Object
	metav1.Object
	CronAnythingSpec() *CronAnythingSpec
	CronAnythingStatus() *CronAnythingStatus
}

CronAnything represent the contract for the Anthos DB Operator compliant database operator providers to abide by.

type CronAnythingSpec

type CronAnythingSpec struct {
	// Schedule defines a time-based schedule, e.g., a standard cron schedule such
	// as “@every 10m”. This field is mandatory and mutable. If it is changed,
	// resources will simply be created at the new interval from then on.
	Schedule string `json:"schedule"`

	// TriggerDeadlineSeconds defines Deadline in seconds for creating the
	// resource if it missed the scheduled time. If no deadline is provided, the
	// resource will be created no matter how far after the scheduled time.
	// If multiple triggers were missed, only the last will be triggered and only
	// one resource will be created. This field is mutable and changing it
	// will affect the creation of new resources from that point in time.
	// +optional
	TriggerDeadlineSeconds *int64 `json:"triggerDeadlineSeconds,omitempty"`

	// ConcurrencyPolicy specifies how to treat concurrent resources if the
	// resource provides a status path that exposes completion.
	// The default policy if not provided is to allow a new resource to be created
	// even if an active resource already exists.
	// If the resource doesn’t have an active/completed status, the only supported
	// concurrency policy is to allow creating new resources.
	// This field is mutable. If the policy is changed to a more stringent policy
	// while multiple resources are active, it will not delete any existing
	// resources. The exception is if a creation of a new resource is triggered
	// and the policy has been changed to Replace. If multiple resources are
	// active, they will all be deleted and replaced by a new resource.
	// +optional
	ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`

	// Suspend tells the controller to suspend creation of additional resources.
	// The default value is false. This field is mutable. It will not affect any
	// existing resources, but only affect creation of additional resources.
	// +optional
	Suspend *bool `json:"suspend,omitempty"`

	// FinishableStrategy defines how the CronAnything controller an decide if a
	// resource has completed.
	// Some resources will do some work after they have been created and at some
	// point be finished. Jobs are the most common example.
	// If no strategy is defined, it is assumed that the resources never finish.
	// +optional
	FinishableStrategy *FinishableStrategy `json:"finishableStrategy,omitempty"`

	// Template is a template of a resource type for which instances are to
	// be created on the given schedule.
	// This field is mandatory and it must contain a valid template for an
	// existing apiVersion and kind in the cluster.
	// It is immutable, so if the template needs to change, the whole CronAnything
	// resource should be replaced.
	// +kubebuilder:validation:EmbeddedResource
	// +kubebuilder:pruning:PreserveUnknownFields
	Template runtime.RawExtension `json:"template"`

	// TotalResourceLimit specifies the total number of children allowed for a
	// particular CronAnything resource. If this limit is reached, no additional
	// resources will be created.
	// This limit is mostly meant to avoid runaway creation of resources that
	// could bring down the cluster. Both finished and unfinished resources count
	// against this limit.
	// This field is mutable. If it is changed to a lower value than the existing
	// number of resources, none of the existing resources will be deleted as a
	// result, but no additional resources will be created until the number of
	// child resources goes below the limit.
	// The field is optional with a default value of 100.
	// +optional
	TotalResourceLimit *int32 `json:"totalResourceLimit,omitempty"`

	// Retention defines the retention policy for resources created by
	// CronAnything. If no retention policy is defined, CronAnything will never
	// delete resources, so cleanup must be handled through some other process.
	// +optional
	Retention *ResourceRetention `json:"retention,omitempty"`

	// CascadeDelete tells CronAnything to set up owner references from the
	// created resources to the CronAnything resource. This means that if the
	// CronAnything resource is deleted, all resources created by it will also be
	// deleted. This is an optional field that defaults to false.
	// +optional
	CascadeDelete *bool `json:"cascadeDelete,omitempty"`

	// ResourceBaseName specifies the base name for the resources created by
	// CronAnything, which will be named using the format
	// <ResourceBaseName>-<Timestamp>. This field is optional, and the default
	// is to use the name of the CronAnything resource as the ResourceBaseName.
	// +optional
	ResourceBaseName *string `json:"resourceBaseName,omitempty"`

	// ResourceTimestampFormat defines the format of the timestamp in the name of
	// Resources created by CronAnything <ResourceBaseName>-<Timestamp>.
	// This field is optional, and the default is to format the timestamp as unix
	// time. If provided, it must be compatible with time.Format in golang.
	// +optional
	ResourceTimestampFormat *string `json:"resourceTimestampFormat,omitempty"`
}

CronAnythingSpec defines the desired state of CronAnything.

func (*CronAnythingSpec) DeepCopy

func (in *CronAnythingSpec) DeepCopy() *CronAnythingSpec

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

func (*CronAnythingSpec) DeepCopyInto

func (in *CronAnythingSpec) DeepCopyInto(out *CronAnythingSpec)

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

type CronAnythingStatus

type CronAnythingStatus struct {

	// LastScheduleTime keeps track of the scheduled time for the last
	// successfully completed creation of a resource.
	// This is used by the controller to determine when the next resource creation
	// should happen. If creation of a resource is delayed for any reason but
	// eventually does happen, this value will still be updated to the time when
	// it was originally scheduled to happen.
	// +optional
	LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`

	// TriggerHistory keeps track of the status for the last 10 triggers. This
	// allows users of CronAnything to see whether any triggers failed. It is
	// important to know that this only keeps track of whether a trigger was
	// successfully executed (as in creating the given resource), not whether the
	// created resource was itself successful. For this information, any users
	// of CronAnything should observe the resources created.
	// +optional
	TriggerHistory []TriggerHistoryRecord `json:"triggerHistory,omitempty"`

	// PendingTrigger keeps track of any triggers that are past their trigger time,
	// but for some reason have not been completed yet. This is typically a result
	// of the create operation failing.
	// +optional
	PendingTrigger *PendingTrigger `json:"pendingTrigger,omitempty"`
}

+kubebuilder:object:generate=true CronAnythingStatus defines the observed state of CronAnything.

func (*CronAnythingStatus) DeepCopy

func (in *CronAnythingStatus) DeepCopy() *CronAnythingStatus

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

func (*CronAnythingStatus) DeepCopyInto

func (in *CronAnythingStatus) DeepCopyInto(out *CronAnythingStatus)

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

type DBLoadBalancerOptions

type DBLoadBalancerOptions struct {
	// GCP contains Google Cloud specific attributes for the Kubernetes LoadBalancer.
	// +optional
	GCP DBLoadBalancerOptionsGCP `json:"gcp,omitempty"`
}

DBLoadBalancerOptions contains customization options for the Kubernetes LoadBalancer exposing database connections.

type DBLoadBalancerOptionsGCP

type DBLoadBalancerOptionsGCP struct {
	// A LoadBalancer can be internal or external.
	// See https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
	// +kubebuilder:validation:Enum="";Internal;External
	// +optional
	LoadBalancerType string `json:"loadBalancerType,omitempty"`

	// LoadBalancerIP is a static IP address, see
	// https://cloud.google.com/compute/docs/ip-addresses/reserve-static-external-ip-address
	// +optional
	LoadBalancerIP string `json:"loadBalancerIP,omitempty"`
}

DBLoadBalancerOptionsGCP contains GCP specific options for the Kubernetes LoadBalancer created for database connections.

type DatabasePhase

type DatabasePhase string
const (
	DatabasePending  DatabasePhase = "Pending"
	DatabaseCreating DatabasePhase = "Creating"
	DatabaseUpdating DatabasePhase = "Updating"
	DatabaseDeleting DatabasePhase = "Deleting"
	DatabaseReady    DatabasePhase = "Ready"
)

type DatabaseSpec

type DatabaseSpec struct {
	// Name of the instance that the database belongs to.
	// +required
	Instance string `json:"instance,omitempty"`

	// Name of the database.
	// +required
	Name string `json:"name,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 {
	// Phase is a summary of the current state of the Database.
	// +optional
	Phase DatabasePhase `json:"phase,omitempty"`

	// Conditions represents the latest available observations of the
	// Database's current state.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

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 DiskSpec

type DiskSpec struct {
	// Name of a disk.
	// Allowed values are: DataDisk,LogDisk,BackupDisk
	// +required
	// +kubebuilder:validation:Enum=DataDisk;LogDisk;BackupDisk
	Name string `json:"name"`

	// Disk size. If not specified, the defaults are: DataDisk:"100Gi", LogDisk:"150Gi",BackupDisk:"100Gi"
	// +optional
	Size resource.Quantity `json:"size,omitempty"`

	// StorageClass points to a particular CSI driver and is used
	// for disk provisioning.
	// +optional
	StorageClass string `json:"storageClass,omitempty"`

	// A map of string keys and values to be stored in the annotations of the PVC.
	// These can be read and write by external tools through Kubernetes.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// VolumeName is the binding reference to the PersistentVolume tied to this disk.
	// +optional
	VolumeName string `json:"volumeName,omitempty"`

	// AccessModes contains the desired access modes the volume should have.
	// +optional
	AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`

	// A label query over volumes to consider for binding.
	// +optional
	Selector *metav1.LabelSelector `json:"selector,omitempty"`
}

DiskSpec defines the desired state of a disk. (the structure is deliberately designed to be flexible, as a slice, so that if we change a disk layout for different hosting platforms, the model can be also adjusted to reflect that).

func (*DiskSpec) DeepCopy

func (in *DiskSpec) DeepCopy() *DiskSpec

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

func (*DiskSpec) DeepCopyInto

func (in *DiskSpec) DeepCopyInto(out *DiskSpec)

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

type DiskType

type DiskType string

DiskType is a type that points to the disk type

type FieldResourceTimestampStrategy

type FieldResourceTimestampStrategy struct {

	// The path to the field on the resource that contains the timestamp.
	FieldPath string `json:"fieldPath"`
}

+kubebuilder:object:generate=true FieldResourceTimestampStrategy defines how the CronAnything controller can find the timestamp for a resource.

func (*FieldResourceTimestampStrategy) DeepCopy

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

func (*FieldResourceTimestampStrategy) DeepCopyInto

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

type FinishableStrategy

type FinishableStrategy struct {

	// Type tells which strategy should be used.
	Type FinishableStrategyType `json:"type"`

	// TimestampField contains the details for how the CronAnything controller
	// can find the timestamp field on the resource in order to decide if the
	// resource has completed.
	// +optional
	TimestampField *TimestampFieldStrategy `json:"timestampField,omitempty"`

	// StringField contains the details for how the CronAnything controller
	// can find the string field on the resource needed to decide if the resource
	// has completed. It also lists the values that mean the resource has completed.
	// +optional
	StringField *StringFieldStrategy `json:"stringField,omitempty"`
}

+kubebuilder:object:generate=true FinishableStrategy specifies how the CronAnything controller can decide whether a created resource has completed. This is needed for any concurrency policies other than AllowConcurrent.

func (*FinishableStrategy) DeepCopy

func (in *FinishableStrategy) DeepCopy() *FinishableStrategy

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

func (*FinishableStrategy) DeepCopyInto

func (in *FinishableStrategy) DeepCopyInto(out *FinishableStrategy)

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

type FinishableStrategyType

type FinishableStrategyType string

FinishableStrategyType specifies the type of the field which tells whether a resource is finished.

const (
	// FinishableStrategyTimestampField specifies deriving whether a resource is
	// finished from a timestamp field.
	FinishableStrategyTimestampField FinishableStrategyType = "TimestampField"

	// FinishableStrategyStringField specifies deriving whether a resource is
	// finished from a string field.
	FinishableStrategyStringField FinishableStrategyType = "StringField"
)

type GsmSecretReference

type GsmSecretReference struct {
	// ProjectId identifies the project where the secret resource is.
	// +required
	ProjectId string `json:"projectId,omitempty"`

	// SecretId identifies the secret.
	// +required
	SecretId string `json:"secretId,omitempty"`

	// Version is the version of the secret.
	// If "latest" is specified, underlying the latest SecretId is used.
	// +required
	Version string `json:"version,omitempty"`
}

GsmSecretReference represents a Google Secret Manager Secret (GSM) Reference. It has enough information to retrieve a secret from Google Secret manager.

func (*GsmSecretReference) DeepCopy

func (in *GsmSecretReference) DeepCopy() *GsmSecretReference

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

func (*GsmSecretReference) DeepCopyInto

func (in *GsmSecretReference) DeepCopyInto(out *GsmSecretReference)

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

type Instance

type Instance interface {
	runtime.Object
	InstanceSpec() InstanceSpec
	InstanceStatus() InstanceStatus
}

Instance represents the contract for the Anthos DB Operator compliant database Operator providers to abide by.

type InstanceMode

type InstanceMode string

InstanceMode describes how an instance will be managed by the operator.

type InstancePhase

type InstancePhase string
const (
	InstanceCreating  InstancePhase = "Creating"
	InstanceUpdating  InstancePhase = "Updating"
	InstanceRestoring InstancePhase = "Restoring"
	InstanceDeleting  InstancePhase = "Deleting"
	InstanceReady     InstancePhase = "Ready"
)

type InstanceSpec

type InstanceSpec struct {
	// Type of a database engine.
	// +required
	// +kubebuilder:validation:Enum=Oracle
	Type string `json:"type,omitempty"`

	// HostingType conveys whether an Instance is meant to be hosted on a cloud
	// (single or multiple), on-prem, on Bare Metal, etc.
	// It is meant to be used as a filter and aggregation dimension.
	// +optional
	// +kubebuilder:validation:Enum="";Cloud;MultiCloud;Hybrid;BareMetal;OnPrem
	HostingType string `json:"hostingType,omitempty"`

	// DeploymentType reflects a fully managed (DBaaS) vs. semi-managed database.
	// +optional
	// +kubebuilder:validation:Enum="";InCluster;CloudSQL;RDS
	DeploymentType string `json:"deploymentType,omitempty"`

	// CloudProvider is only relevant if the hosting type is Cloud,
	// MultiCloud, Hybrid or Bare Metal.
	// +optional
	// +kubebuilder:validation:Enum=GCP;AWS;Azure;OCI
	CloudProvider string `json:"cloudProvider,omitempty"`

	// Version of a database.
	// +required
	Version string `json:"version,omitempty"`

	// Edition of a database.
	// +optional
	Edition string `json:"edition,omitempty"`

	// Disks slice describes at minimum two disks:
	// data and log (archive log), and optionally a backup disk.
	Disks []DiskSpec `json:"disks,omitempty"`

	// RetainDisksAfterInstanceDeletion should be set to true if Persistent Volumes
	// and underlying disks should be retained after the Instance is deleted.
	// The Default value is false, meaning disks are deleted with the instance.
	// +optional
	RetainDisksAfterInstanceDeletion bool `json:"retainDisksAfterInstanceDeletion,omitempty"`

	// Service agent and other data plane GCR images.
	// This is an optional map that allows a customer to specify GCR images
	// different from those chosen/provided.
	// +optional
	Images map[string]string `json:"images,omitempty"`

	// DBNetworkServiceOptions allows to override some details of kubernetes
	// Service created to expose a connection to database.
	// +optional
	DBLoadBalancerOptions *DBLoadBalancerOptions `json:"dbLoadBalancerOptions,omitempty"`

	// Source IP CIDR ranges allowed for a client.
	// +optional
	SourceCidrRanges []string `json:"sourceCidrRanges,omitempty"`

	// Parameters contains the database flags in the map format
	// +optional
	Parameters map[string]string `json:"parameters,omitempty"`

	// Services list the optional semi-managed services that
	// the customers can choose from.
	// +optional
	Services map[Service]bool `json:"services,omitempty"`

	// Resource specification for the database container. If not specified, a
	// default of 4.0Gi memory request will be used to safeguard the db container
	// without crashes due to memory pressure.
	// +optional
	DatabaseResources corev1.ResourceRequirements `json:"databaseResources,omitempty"`

	// MaintenanceWindow specifies the time windows during which database downtimes are allowed for maintenance.
	// +optional
	MaintenanceWindow *MaintenanceWindowSpec `json:"maintenanceWindow,omitempty"`

	// Mode specifies how this instance will be managed by the operator.
	// +optional
	// +kubebuilder:validation:Enum=ManuallySetUpStandby;Pause
	Mode InstanceMode `json:"mode,omitempty"`

	// Max threshold for database patching. This timeout is used independently for sts patching and OPatch/datapatch execution.
	// +optional
	DatabasePatchingTimeout *metav1.Duration `json:"databasePatchingTimeout,omitempty"`

	// AdminUser represents the admin user specification
	// +optional
	AdminUser *AdminUserSpec `json:"adminUser,omitempty"`

	// IsStopped is true if an instance is stopped, false otherwise
	// +optional
	IsStopped *bool `json:"isStopped,omitempty"`
}

InstanceSpec represents the database engine agnostic part of the spec describing the desired state of an Instance.

func (*InstanceSpec) DeepCopy

func (in *InstanceSpec) DeepCopy() *InstanceSpec

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

func (*InstanceSpec) DeepCopyInto

func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec)

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

type InstanceStatus

type InstanceStatus struct {
	// Phase is a summary of current state of the Instance.
	// +optional
	Phase InstancePhase `json:"phase,omitempty"`

	// Conditions represents the latest available observations
	// of the Instance's current state.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// Endpoint is presently expressed in the format of <instanceName>-svc.<ns>.
	Endpoint string `json:"endpoint,omitempty"`

	// URL represents an IP and a port number info needed in order to
	// establish a database connection from outside a cluster.
	URL string `json:"url,omitempty"`

	// Description is for a human consumption.
	// E.g. when an Instance is restored from a backup
	// this field is populated with the human readable
	// restore details.
	Description string `json:"description,omitempty"`

	// ObservedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// IsChangeApplied indicates whether instance changes have been applied
	// +optional
	IsChangeApplied metav1.ConditionStatus `json:"isChangeApplied,omitempty"`

	// AdminUser represents the observed state of the admin user
	// +optional
	AdminUser *AdminUserStatus `json:"adminUser,omitempty"`
}

InstanceStatus defines the observed state of Instance

func (*InstanceStatus) DeepCopy

func (in *InstanceStatus) DeepCopy() *InstanceStatus

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

func (*InstanceStatus) DeepCopyInto

func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus)

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

type MaintenanceWindowSpec

type MaintenanceWindowSpec struct {
	// Maintenance time ranges.
	TimeRanges []TimeRange `json:"timeRanges,omitempty"`
}

MaintenanceWindowSpec defines the time ranges during which maintenance may be started on a database. +kubebuilder:object:generate=true

func (*MaintenanceWindowSpec) DeepCopy

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

func (*MaintenanceWindowSpec) DeepCopyInto

func (in *MaintenanceWindowSpec) DeepCopyInto(out *MaintenanceWindowSpec)

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

type PendingTrigger

type PendingTrigger struct {

	// ScheduleTime is the time when this trigger was scheduled to be executed.
	ScheduleTime metav1.Time `json:"scheduleTime"`

	// Result tells why this trigger is in the pending state, i.e. what prevented
	// it from completing successfully.
	Result TriggerResult `json:"result"`
}

+kubebuilder:object:generate=true PendingTrigger keeps information about triggers that should have been completed, but due to some kind of error, is still pending. They will typically remain in this state until either the issue has been resolved and the resource in question can be created, the triggerDeadlineSeconds is reached and we stop trying, or the next trigger time is reached at which time we consider the previous trigger as failed.

func (*PendingTrigger) DeepCopy

func (in *PendingTrigger) DeepCopy() *PendingTrigger

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

func (*PendingTrigger) DeepCopyInto

func (in *PendingTrigger) DeepCopyInto(out *PendingTrigger)

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

type ResourceRetention

type ResourceRetention struct {
	// The number of completed resources to keep before deleting them. This
	// only affects finishable resources and the default value is 3.
	// This field is mutable and if it is changed to a number lower than
	// the current number of finished resources, the oldest ones will
	// eventually be deleted until the number of finished resources matches
	// the limit.
	// +optional
	HistoryCountLimit *int32 `json:"historyCountLimit,omitempty"`

	// The time since completion that a resource is kept before deletion. This
	// only affects finishable resources. This does not have any default value and
	// if it is not provided, HistoryCountLimit will be used to prune completed
	// resources.
	// If both HistoryCountLimit and  HistoryTimeLimitSeconds are set, it is treated
	// as an OR operation.
	// +optional
	HistoryTimeLimitSeconds *uint64 `json:"historyTimeLimitSeconds,omitempty"`

	// ResourceTimestampStrategy specifies how the CronAnything controller
	// can find the age of a resource. This is needed to support retention.
	ResourceTimestampStrategy ResourceTimestampStrategy `json:"resourceTimestampStrategy"`
}

+kubebuilder:object:generate=true ResourceRetention specifies the retention policy for resources.

func (*ResourceRetention) DeepCopy

func (in *ResourceRetention) DeepCopy() *ResourceRetention

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

func (*ResourceRetention) DeepCopyInto

func (in *ResourceRetention) DeepCopyInto(out *ResourceRetention)

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

type ResourceTimestampStrategy

type ResourceTimestampStrategy struct {

	// Type tells which strategy should be used.
	Type ResourceTimestampStrategyType `json:"type"`

	// FieldResourceTimestampStrategy specifies how the CronAnything controller
	// can find the timestamp for the resource from a field.
	// +optional
	FieldResourceTimestampStrategy *FieldResourceTimestampStrategy `json:"field,omitempty"`
}

+kubebuilder:object:generate=true ResourceTimestampStrategy specifies how the CronAnything controller can find the timestamp on the resource that will again decide the order in which resources are deleted based on the retention policy.

func (*ResourceTimestampStrategy) DeepCopy

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

func (*ResourceTimestampStrategy) DeepCopyInto

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

type ResourceTimestampStrategyType

type ResourceTimestampStrategyType string

ResourceTimestampStrategyType specifies the strategy to use for getting the resource timestamp.

const (
	// ResourceTimestampStrategyField specifies getting the timestamp for the
	// resource from a field on the resource.
	ResourceTimestampStrategyField ResourceTimestampStrategyType = "Field"
)

type RestorePhase

type RestorePhase string
const (
	RestorePending    RestorePhase = "Pending"
	RestoreInProgress RestorePhase = "InProgress"
	RestoreFailed     RestorePhase = "Failed"
	RestoreSucceeded  RestorePhase = "Succeeded"
)

type Service

type Service string

Service is a service provided by the operator.

type StringFieldStrategy

type StringFieldStrategy struct {

	// The path to the field on the resource that contains a string value.
	FieldPath string `json:"fieldPath"`

	// The values of the field that means the resource has completed.
	FinishedValues []string `json:"finishedValues"`
}

+kubebuilder:object:generate=true StringFieldStrategy defines how the CronAnything controller can find and use the value of a field on the resource to decide if it has finished.

func (*StringFieldStrategy) DeepCopy

func (in *StringFieldStrategy) DeepCopy() *StringFieldStrategy

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

func (*StringFieldStrategy) DeepCopyInto

func (in *StringFieldStrategy) DeepCopyInto(out *StringFieldStrategy)

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

type TimeRange

type TimeRange struct {
	// Start time.
	// +required
	Start *metav1.Time `json:"start,omitempty"`

	// Duration of the maintenance window
	// +required
	Duration *metav1.Duration `json:"duration,omitempty"`
}

TimeRange defines a window of time. Both start time and duration are required. +kubebuilder:object:generate=true

func (*TimeRange) DeepCopy

func (in *TimeRange) DeepCopy() *TimeRange

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

func (*TimeRange) DeepCopyInto

func (in *TimeRange) DeepCopyInto(out *TimeRange)

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

type TimestampFieldStrategy

type TimestampFieldStrategy struct {

	// The path to the field on the resource that contains the timestamp.
	FieldPath string `json:"fieldPath"`
}

+kubebuilder:object:generate=true TimestampFieldStrategy defines how the CronAnything controller can find a field on the resource that contains a timestamp. The contract here is that if the field contains a valid timestamp the resource is considered finished.

func (*TimestampFieldStrategy) DeepCopy

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

func (*TimestampFieldStrategy) DeepCopyInto

func (in *TimestampFieldStrategy) DeepCopyInto(out *TimestampFieldStrategy)

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

type TriggerHistoryRecord

type TriggerHistoryRecord struct {

	// ScheduleTime is the time when this trigger was scheduled to be executed.
	ScheduleTime metav1.Time `json:"scheduleTime"`

	// CreationTimestamp is the time when this record was created. This is thus
	// also the time at which the final result of the trigger was decided.
	CreationTimestamp metav1.Time `json:"creationTimestamp"`

	// Result contains the outcome of a trigger. It can either be CreateSucceeded,
	// which means the given resource was created as intended, or it can be one
	// of several error messages.
	Result TriggerResult `json:"result"`
}

+kubebuilder:object:generate=true TriggerHistoryRecord contains information about the result of a trigger. It can either have completed successfully, and if it did not, the record will provide information about what is the cause of the failure.

func (*TriggerHistoryRecord) DeepCopy

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

func (*TriggerHistoryRecord) DeepCopyInto

func (in *TriggerHistoryRecord) DeepCopyInto(out *TriggerHistoryRecord)

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

type TriggerResult

type TriggerResult string

TriggerResult specifies the result of a trigger.

const (
	// TriggerResultMissed means the trigger was not able to complete until the
	// next trigger fired. Thus the trigger missed its window for being executed.
	TriggerResultMissed TriggerResult = "MissedSchedule"

	// TriggerResultCreateFailed means the create operation for a resource failed.
	// This itself doesn't cause the trigger to fail, but this status will be
	// reported if failing create operations are the reason a trigger misses its
	// window for being executed.
	TriggerResultCreateFailed TriggerResult = "CreateFailed"

	// TriggerResultCreateSucceeded means the trigger was successful.
	TriggerResultCreateSucceeded TriggerResult = "CreateSucceeded"

	// TriggerResultResourceLimitReached means the trigger could not be completed
	// as the resource limit was reached and it is not possible to create
	// additional resources.
	TriggerResultResourceLimitReached TriggerResult = "ResourceLimitReached"

	// TriggerResultForbidConcurrent means the trigger could not be completed as
	// there is already an unfinished resource and the concurrency policy forbid
	// any concurrently running resources.
	TriggerResultForbidConcurrent TriggerResult = "ForbidConcurrent"

	// TriggerResultDeadlineExceeded means the trigger could not be completed as
	// the deadline for how delayed a trigger can be was reached.
	TriggerResultDeadlineExceeded TriggerResult = "DeadlineExceeded"
)

type UserPhase

type UserPhase string
const (
	UserPending  UserPhase = "Pending"
	UserCreating UserPhase = "Creating"
	UserUpdating UserPhase = "Updating"
	UserDeleting UserPhase = "Deleting"
	UserReady    UserPhase = "Ready"
)

type UserSpec

type UserSpec struct {
	// Name of the User.
	// +required
	Name string `json:"name,omitempty"`

	// Credential of the User. See definition for 'CredentialSpec'.
	// +required
	CredentialSpec `json:",inline"`
}

UserSpec defines the common desired state of User.

func (*UserSpec) DeepCopy

func (in *UserSpec) DeepCopy() *UserSpec

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

func (*UserSpec) DeepCopyInto

func (in *UserSpec) DeepCopyInto(out *UserSpec)

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