Documentation
¶
Overview ¶
Package v1 contains API Schema definitions for the database v1 API group +kubebuilder:object:generate=true +groupName=database.fits.cloud
Index ¶
- Constants
- Variables
- type AccessList
- type BackupConfig
- type Postgres
- func (p *Postgres) AddFinalizer(finalizerName string)
- func (in *Postgres) DeepCopy() *Postgres
- func (in *Postgres) DeepCopyInto(out *Postgres)
- func (in *Postgres) DeepCopyObject() runtime.Object
- func (p *Postgres) HasFinalizer(finalizerName string) bool
- func (p *Postgres) HasSourceRanges() bool
- func (p *Postgres) IsBeingDeleted() bool
- func (p *Postgres) RemoveFinalizer(finalizerName string)
- func (p *Postgres) ToBackupSecretName() string
- func (p *Postgres) ToCWNP(port int) (*firewall.ClusterwideNetworkPolicy, error)
- func (p *Postgres) ToKey() *types.NamespacedName
- func (p *Postgres) ToPeripheralResourceLookupKey() types.NamespacedName
- func (p *Postgres) ToPeripheralResourceName() string
- func (p *Postgres) ToPeripheralResourceNamespace() string
- func (p *Postgres) ToSvcLB(lbIP string, lbPort int32) *corev1.Service
- func (p *Postgres) ToSvcLBName() string
- func (p *Postgres) ToSvcLBNamespacedName() *types.NamespacedName
- func (p *Postgres) ToUnstructuredZalandoPostgresql(z *zalando.Postgresql, c *corev1.ConfigMap, sc string) (*unstructured.Unstructured, error)
- func (p *Postgres) ToUserPasswordSecretMatchingLabels() map[string]string
- func (p *Postgres) ToUserPasswordsSecret(src *corev1.SecretList, scheme *runtime.Scheme) (*corev1.Secret, error)
- func (p *Postgres) ToUserPasswordsSecretListOption() []client.ListOption
- func (p *Postgres) ToUserPasswordsSecretName() string
- func (p *Postgres) ToZalandoPostgresqlMatchingLabels() client.MatchingLabels
- type PostgresList
- type PostgresSpec
- type PostgresStatus
- type Size
- type Socket
Constants ¶
const ( // UIDLabelName Name of the label referencing the owning Postgres resource uid in the control cluster UIDLabelName string = "postgres.database.fits.cloud/uid" // NameLabelName Name of the label referencing the owning Postgres resource name in the control cluster (which might not be unique) NameLabelName string = "postgres.database.fits.cloud/name" // TenantLabelName Name of the tenant label TenantLabelName string = "postgres.database.fits.cloud/tenant" // ProjectIDLabelName Name of the ProjectID label ProjectIDLabelName string = "postgres.database.fits.cloud/project-id" // ManagedByLabelName Name of the managed-by label ManagedByLabelName string = "postgres.database.fits.cloud/managed-by" // ManagedByLabelValue Value of the managed-by label ManagedByLabelValue string = "postgreslet" // PostgresFinalizerName Name of the finalizer to use PostgresFinalizerName string = "postgres.finalizers.database.fits.cloud" // CreatedByAnnotationKey is used to store who in person created this database CreatedByAnnotationKey string = "postgres.database.fits.cloud/created-by" // BackupConfigLabelName if set to true, this secret stores the backupConfig BackupConfigLabelName string = "postgres.database.fits.cloud/is-backup" // BackupConfigKey defines the key under which the BackupConfig is stored in the data map. BackupConfigKey = "config" )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "database.fits.cloud", 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 )
var SvcLoadBalancerLabel = map[string]string{ ManagedByLabelName: ManagedByLabelValue, }
var (
ZalandoPostgresqlTypeMeta = metav1.TypeMeta{
APIVersion: "acid.zalan.do/v1",
Kind: "postgresql",
}
)
Functions ¶
This section is empty.
Types ¶
type AccessList ¶
type AccessList struct {
// SourceRanges defines a list of prefixes in CIDR Notation e.g. 1.2.3.0/24 or fdaa::/104
SourceRanges []string `json:"sourceRanges,omitempty"`
}
AccessList defines the type of restrictions to access the database
func (*AccessList) DeepCopy ¶
func (in *AccessList) DeepCopy() *AccessList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessList.
func (*AccessList) DeepCopyInto ¶
func (in *AccessList) DeepCopyInto(out *AccessList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BackupConfig ¶
type BackupConfig struct {
// ID of this backupConfig
ID string `json:"id"`
// Name is a user defined description
Name string `json:"name"`
// ProjectID the project this backup is mapped to
ProjectID string `json:"project"`
// Tenant the tenant of the backup
Tenant string `json:"tenant"`
// CreatedBy is the name of the person or technical account which created this backupConfig
CreatedBy string `json:"createdBy"`
// Retention defines how many versions should be held in s3
Retention string `json:"retention"`
// Schedule in cron syntax when to run the backup periodically
Schedule string `json:"schedule"`
// S3Endpoint the url of the s3 endpoint
S3Endpoint string `json:"s3endpoint"`
// S3BucketName is the name of the bucket where the backup should be stored.
S3BucketName string `json:"s3bucketname"`
// S3Region the region of the aws s3
S3Region string `json:"s3region"`
// S3AccessKey is the accesskey which must have write access
S3AccessKey string `json:"s3accesskey"`
// S3SecretKey is the secretkey which must match to the accesskey
S3SecretKey string `json:"s3secretkey"`
// S3EncryptionKey if set, server side s3 encryption is used.
S3EncryptionKey *string `json:"s3encryptionkey,omitempty"`
}
BackupConfig defines all properties to configure backup of a database. This config is stored in the data section under the key BackupConfigKey as json payload.
func (*BackupConfig) DeepCopy ¶
func (in *BackupConfig) DeepCopy() *BackupConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfig.
func (*BackupConfig) DeepCopyInto ¶
func (in *BackupConfig) DeepCopyInto(out *BackupConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Postgres ¶
type Postgres struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PostgresSpec `json:"spec,omitempty"`
Status PostgresStatus `json:"status,omitempty"`
}
Postgres is the Schema for the postgres API
func (*Postgres) AddFinalizer ¶
func (*Postgres) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Postgres.
func (*Postgres) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Postgres) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Postgres) HasFinalizer ¶
func (*Postgres) HasSourceRanges ¶
HasSourceRanges returns true if SourceRanges are set
func (*Postgres) IsBeingDeleted ¶
IsBeingDeleted returns true if the deletion-timestamp is set
func (*Postgres) RemoveFinalizer ¶
func (*Postgres) ToBackupSecretName ¶
ToBackupSecretName returns the name of the secret containing backup credentials
func (*Postgres) ToCWNP ¶
func (p *Postgres) ToCWNP(port int) (*firewall.ClusterwideNetworkPolicy, error)
ToCWNP returns CRD ClusterwideNetworkPolicy derived from CRD Postgres
func (*Postgres) ToKey ¶
func (p *Postgres) ToKey() *types.NamespacedName
func (*Postgres) ToPeripheralResourceLookupKey ¶
func (p *Postgres) ToPeripheralResourceLookupKey() types.NamespacedName
func (*Postgres) ToPeripheralResourceName ¶
func (*Postgres) ToPeripheralResourceNamespace ¶
func (*Postgres) ToSvcLBName ¶
ToSvcLBName returns the name of the peripheral resource Service LoadBalancer. It's different from all other peripheral resources because the operator already generates one service with that name.
func (*Postgres) ToSvcLBNamespacedName ¶
func (p *Postgres) ToSvcLBNamespacedName() *types.NamespacedName
func (*Postgres) ToUnstructuredZalandoPostgresql ¶
func (p *Postgres) ToUnstructuredZalandoPostgresql(z *zalando.Postgresql, c *corev1.ConfigMap, sc string) (*unstructured.Unstructured, error)
func (*Postgres) ToUserPasswordSecretMatchingLabels ¶
func (*Postgres) ToUserPasswordsSecret ¶
func (p *Postgres) ToUserPasswordsSecret(src *corev1.SecretList, scheme *runtime.Scheme) (*corev1.Secret, error)
ToUserPasswordsSecret returns the secret containing user password pairs
func (*Postgres) ToUserPasswordsSecretListOption ¶
func (p *Postgres) ToUserPasswordsSecretListOption() []client.ListOption
ToUserPasswordsSecretListOption returns the argument for listing secrets
func (*Postgres) ToUserPasswordsSecretName ¶
ToUserPasswordsSecretName returns the name of the secret containing user password pairs
func (*Postgres) ToZalandoPostgresqlMatchingLabels ¶
func (p *Postgres) ToZalandoPostgresqlMatchingLabels() client.MatchingLabels
type PostgresList ¶
type PostgresList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Postgres `json:"items"`
}
PostgresList contains a list of Postgres
func (*PostgresList) DeepCopy ¶
func (in *PostgresList) DeepCopy() *PostgresList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresList.
func (*PostgresList) DeepCopyInto ¶
func (in *PostgresList) DeepCopyInto(out *PostgresList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PostgresList) DeepCopyObject ¶
func (in *PostgresList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PostgresSpec ¶
type PostgresSpec struct {
// Description
Description string `json:"description,omitempty"`
// ProjectID metal project ID
ProjectID string `json:"projectID,omitempty"`
// Tenant metal tenant
Tenant string `json:"tenant,omitempty"`
// PartitionID the partition where the database is created
PartitionID string `json:"partitionID,omitempty"`
// NumberOfInstances number of replicas
// +kubebuilder:validation:Minimum=1
// +kubebuilder:default=1
NumberOfInstances int32 `json:"numberOfInstances,omitempty"`
// Version is the version of Postgre-as-a-Service
// +kubebuilder:validation:Enum="12";
// +kubebuilder:default="12"
Version string `json:"version,omitempty"`
// Size of the database
Size *Size `json:"size,omitempty"`
// todo: add default
// Maintenance defines automatic maintenance of the database
Maintenance []string `json:"maintenance,omitempty"`
// AccessList defines access restrictions
AccessList *AccessList `json:"accessList,omitempty"`
// BackupSecretRef reference to the secret where the backup credentials are stored
BackupSecretRef string `json:"backupSecretRef,omitempty"`
}
PostgresSpec defines the desired state of Postgres
func (*PostgresSpec) DeepCopy ¶
func (in *PostgresSpec) DeepCopy() *PostgresSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresSpec.
func (*PostgresSpec) DeepCopyInto ¶
func (in *PostgresSpec) DeepCopyInto(out *PostgresSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostgresStatus ¶
type PostgresStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Description string `json:"description,omitempty"`
Socket Socket `json:"socket,omitempty"`
ChildName string `json:"childName,omitempty"`
}
PostgresStatus defines the observed state of Postgres
func (*PostgresStatus) DeepCopy ¶
func (in *PostgresStatus) DeepCopy() *PostgresStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresStatus.
func (*PostgresStatus) DeepCopyInto ¶
func (in *PostgresStatus) DeepCopyInto(out *PostgresStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Size ¶
type Size struct {
// CPU is in the format as pod.spec.resource.request.cpu
CPU string `json:"cpu,omitempty"`
// Memory is in the format as pod.spec.resource.request.memory
Memory string `json:"memory,omitempty"`
SharedBuffer string `json:"sharedBuffer,omitempty"`
// StorageSize the amount of Storage this database will get
// +kubebuilder:default="1Gi"
// +kubebuilder:validation:Pattern=^[1-9][0-9]*Gi
StorageSize string `json:"storageSize,omitempty"`
}
Todo: Add defaults Size defines the size aspects of the database
func (*Size) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Size.
func (*Size) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Socket ¶
Socket represents load-balancer socket of Postgres
func (*Socket) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Socket.
func (*Socket) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.