v1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Crunchy PostgreSQL Operator API

The Crunchy PostgreSQL Operator API defines HTTP(S) interactions with the Crunchy PostgreSQL Operator.

## Direct API Calls

The API can also be accessed by interacting directly with the API server. This can be done by making HTTP requests with curl to get information from the server. In order to make these calls you will need to provide certificates along with your request using the `--cacert`, `--key`, and `--cert` flags. Next you will need to provide the username and password for the RBAC along with a header that includes the content type and the `--insecure` flag. These flags will be the same for all of your interactions with the API server and can be seen in the following examples.

###### Get API Server Version

The most basic example of this interaction is getting the version of the API server. You can send a GET request to `$PGO_APISERVER_URL/version` and this will send back a json response including the API server version. You must specify the client version that matches the API server version as part of the request.

The API server is setup to work with the pgo command line interface so the parameters that are passed to the server can be found by looking at the related flags. ``` curl --cacert $PGO_CA_CERT --key $PGO_CLIENT_KEY --cert $PGO_CA_CERT -u \ admin:examplepassword -H "Content-Type:application/json" --insecure -X \ GET $PGO_APISERVER_URL/version ```

#### Body examples In the following examples data is being passed to the apiserver using a json structure. These json structures are defined in the following documentation.

``` curl --cacert $PGO_CA_CERT --key $PGO_CLIENT_KEY --cert $PGO_CA_CERT -u \ admin:examplepassword -H "Content-Type:application/json" --insecure -X GET \ "$PGO_APISERVER_URL/workflow/<id>?version=<client-version>&namespace=<namespace>" ```

###### Create Cluster You can create a cluster by sending a POST request to `$PGO_APISERVER_URL/clusters`. In this example `--data` is being sent to the API URL that includes the client version that was returned from the version call, the namespace where the cluster should be created, and the name of the new cluster.

``` curl --cacert $PGO_CA_CERT --key $PGO_CLIENT_KEY --cert $PGO_CA_CERT -u \ admin:examplepassword -H "Content-Type:application/json" --insecure -X \

POST --data \
    '{"ClientVersion":"4.7.1",
    "Namespace":"pgouser1",
    "Name":"mycluster",

$PGO_APISERVER_URL/clusters ```

###### Show and Delete Cluster The last two examples show you how to `show` and `delete` a cluster. Notice how instead of passing `"Name":"mycluster"` you pass `"Clustername":"mycluster" to reference a cluster that has already been created. For the show cluster example you can replace `"Clustername":"mycluster"` with `"AllFlag":true` to show all of the clusters that are in the given namespace.

``` curl --cacert $PGO_CA_CERT --key $PGO_CLIENT_KEY --cert $PGO_CA_CERT -u \ admin:examplepassword -H "Content-Type:application/json" --insecure -X \

POST --data \
  '{"ClientVersion":"4.7.1",
  "Namespace":"pgouser1",
  "Clustername":"mycluster"}' \

$PGO_APISERVER_URL/showclusters ```

``` curl --cacert $PGO_CA_CERT --key $PGO_CLIENT_KEY --cert $PGO_CA_CERT -u \ admin:examplepassword -H "Content-Type:application/json" --insecure -X \

POST --data \
  '{"ClientVersion":"4.7.1",

$PGO_APISERVER_URL/clustersdelete

  Schemes: http, https
  BasePath: /
  Version: 4.7.1
  License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0
  Contact: Crunchy Data<info@crunchydata.com> https://www.crunchydata.com/

	Consumes:
	- application/json

	Produces:
	- application/json

swagger:meta

Index

Constants

View Source
const (
	// PgclusterStateCreated ...
	PgclusterStateCreated PgclusterState = "pgcluster Created"
	// PgclusterStateProcessed ...
	PgclusterStateProcessed PgclusterState = "pgcluster Processed"
	// PgclusterStateInitialized ...
	PgclusterStateInitialized PgclusterState = "pgcluster Initialized"
	// PgclusterStateBootstrapping defines the state of a cluster when it is being bootstrapped
	// from an existing data source
	PgclusterStateBootstrapping PgclusterState = "pgcluster Bootstrapping"
	// PgclusterStateBootstrapped defines the state of a cluster when it has been bootstrapped
	// successfully from an existing data source
	PgclusterStateBootstrapped PgclusterState = "pgcluster Bootstrapped"
	// PgclusterStateRestore ...
	PgclusterStateRestore PgclusterState = "pgcluster Restoring"
	// PgclusterStateShutdown indicates that the cluster has been shut down (i.e. the primary)
	// deployment has been scaled to 0
	PgclusterStateShutdown PgclusterState = "pgcluster Shutdown"

	// PodAntiAffinityRequired results in requiredDuringSchedulingIgnoredDuringExecution for any
	// default pod anti-affinity rules applied to pg custers
	PodAntiAffinityRequired PodAntiAffinityType = "required"

	// PodAntiAffinityPreffered results in preferredDuringSchedulingIgnoredDuringExecution for any
	// default pod anti-affinity rules applied to pg custers
	PodAntiAffinityPreffered PodAntiAffinityType = "preferred"

	// PodAntiAffinityDisabled disables any default pod anti-affinity rules applied to pg custers
	PodAntiAffinityDisabled PodAntiAffinityType = "disabled"
)
View Source
const (
	// PGUserAdmin is a DEPRECATED user and is only included to filter this out
	// as a system user in older systems
	PGUserAdmin = "crunchyadm"
	// PGUserMonitor is the monitoring user that can access metric data
	PGUserMonitor = "ccp_monitoring"
	// PGUserPgBouncer is the user that's used for managing pgBouncer, which a
	// user can use to access pgBouncer stats, etc.
	PGUserPgBouncer = "pgbouncer"
	// PGUserReplication is the user that's used for replication, which has
	// elevated privileges
	PGUserReplication = "primaryuser"
	// PGUserSuperuser is the superuser account that can do anything
	PGUserSuperuser = "postgres"
)

the following are standard PostgreSQL user service accounts that are created as part of managed the PostgreSQL cluster environment via the Operator

View Source
const (
	PgtaskDeleteData    = "delete-data"
	PgtaskAddPolicies   = "addpolicies"
	PgtaskRollingUpdate = "rolling update"
)
View Source
const (
	PgtaskUpgrade           = "clusterupgrade"
	PgtaskUpgradeCreated    = "cluster upgrade - task created"
	PgtaskUpgradeInProgress = "cluster upgrade - in progress"
)
View Source
const (
	PgtaskPgAdminAdd    = "add-pgadmin"
	PgtaskPgAdminDelete = "delete-pgadmin"
)
View Source
const (
	PgtaskWorkflow                    = "workflow"
	PgtaskWorkflowCreateClusterType   = "createcluster"
	PgtaskWorkflowBackrestRestoreType = "pgbackrestrestore"
	PgtaskWorkflowBackupType          = "backupworkflow"
	PgtaskWorkflowSubmittedStatus     = "task submitted"
	PgtaskWorkflowCompletedStatus     = "task completed"
	PgtaskWorkflowID                  = "workflowid"
)
View Source
const (
	PgtaskWorkflowBackrestRestorePVCCreatedStatus     = "restored PVC created"
	PgtaskWorkflowBackrestRestorePrimaryCreatedStatus = "restored Primary created"
	PgtaskWorkflowBackrestRestoreJobCreatedStatus     = "restore job created"
)
View Source
const (
	PgtaskBackrest             = "backrest"
	PgtaskBackrestBackup       = "backup"
	PgtaskBackrestInfo         = "info"
	PgtaskBackrestRestore      = "restore"
	PgtaskBackrestStanzaCreate = "stanza-create"
)
View Source
const (
	PgtaskpgDump       = "pgdump"
	PgtaskpgDumpBackup = "pgdumpbackup"
	PgtaskpgDumpInfo   = "pgdumpinfo"
	PgtaskpgRestore    = "pgrestore"
)
View Source
const (
	// this type of backup is taken following a failover event
	BackupTypeFailover string = "failover"
	// this type of backup is taken when a new cluster is being bootstrapped
	BackupTypeBootstrap string = "bootstrap"
)

Defines the types of pgBackRest backups that are taken throughout a clusters lifecycle

View Source
const CompletedStatus = "completed"

CompletedStatus -

View Source
const GroupName = "pg.percona.com"

GroupName is the group name used in this package. const GroupName = "cr.client-go.k8s.io"

View Source
const InProgressStatus = "in progress"

InProgressStatus -

View Source
const JobCompletedStatus = "job completed"

JobCompletedStatus ....

View Source
const JobErrorStatus = "job error"

JobErrorStatus ....

View Source
const JobSubmittedStatus = "job submitted"

JobSubmittedStatus ....

View Source
const NodeAffinityDefaultWeight int32 = 10

NodeAffinityDefaultWeight is the default weighting for the preferred node affinity. This was taken from our legacy template for handling this, so there may be some logic to this, or this could be an arbitrary weight. Either way, the number needs to be somewhere between [1, 100].

View Source
const PgBackupJobSubmitted = "Backup Job Submitted"

this is ported over from legacy backup code

View Source
const PgclusterResourcePlural = "pgclusters"

PgclusterResourcePlural ..

View Source
const PgpolicyResourcePlural = "pgpolicies"

PgpolicyResourcePlural ...

View Source
const PgreplicaResourcePlural = "pgreplicas"

PgreplicaResourcePlural ..

View Source
const PgtaskResourcePlural = "pgtasks"

PgtaskResourcePlural ...

View Source
const StorageCreate = "create"

StorageCreate ...

View Source
const StorageDynamic = "dynamic"

StorageDynamic ...

View Source
const StorageEmptydir = "emptydir"

StorageEmptydir ...

View Source
const StorageExisting = "existing"

StorageExisting ...

View Source
const SubmittedStatus = "submitted"

SubmittedStatus -

Variables

View Source
var (
	ErrStorageTypesEmpty  = errors.New("no storage types detected")
	ErrInvalidStorageType = errors.New("invalid storage type")
)
View Source
var (
	// SchemeBuilder ...
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme ...
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var PGFSGroup int64 = 26

PGFSGroup stores the UID of the PostgreSQL user that runs the PostgreSQL process, which is 26. This also sets up for future work, as the PodSecurityContext structure takes a *int64 for its FSGroup

This has to be a "var" as Kubernetes requires for this to be a pointer

View Source
var PGUserSystemAccounts = map[string]struct{}{
	PGUserAdmin:       {},
	PGUserMonitor:     {},
	PGUserPgBouncer:   {},
	PGUserReplication: {},
	PGUserSuperuser:   {},
}

PGUserSystemAccounts maintains an easy-to-access list of what the systems accounts are, which may affect how information is returned, etc.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

SchemeGroupVersion is the group version used to register these objects.

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group-qualified GroupResource.

func UserSecretName

func UserSecretName(cluster *Pgcluster, username string) string

UserSecretName returns the name of a Kubernetes Secret representing the user. Delegates to UserSecretNameFromClusterName. This is the preferred method given there is less thinking for the caller to do, but there are some (one?) cases where UserSecretNameFromClusterName needs to be called as that cluster object is unavailable

func UserSecretNameFromClusterName

func UserSecretNameFromClusterName(clusterName, username string) string

UserSecretNameFromClusterName returns the name of a Kubernetes Secret representing a user.

Types

type BackrestStorageType

type BackrestStorageType string

BackrestStorageType refers to the types of storage accept by pgBackRest

const (
	// BackrestStorageTypeLocal is DEPRECATED. It is the equivalent to "posix"
	// storage and is the default storage available (well posix is the default).
	// Available for legacy purposes -- this really  maps to "posix"
	BackrestStorageTypeLocal BackrestStorageType = "local"
	// BackrestStorageTypePosix is the "posix" storage type and in the fullness
	// of time should supercede local
	BackrestStorageTypePosix BackrestStorageType = "posix"
	// BackrestStorageTypeGCS is the GCS storage type for using GCS
	// storage
	BackrestStorageTypeGCS BackrestStorageType = "gcs"
	// BackrestStorageTypeS3 if the S3 storage type for using S3 or S3-equivalent
	// storage
	BackrestStorageTypeS3 BackrestStorageType = "s3"
)

func ParseBackrestStorageTypes

func ParseBackrestStorageTypes(storageTypeStr string) ([]BackrestStorageType, error)

ParseBackrestStorageTypes takes a comma-delimited string of potential pgBackRest storage types and attempts to parse it into a recognizable array. if an invalid type is passed in, then an error is returned

type Backup added in v0.2.0

type Backup struct {
	Image             string                `json:"image"`
	BackrestRepoImage string                `json:"backrestRepoImage"`
	ServiceAccount    string                `json:"serviceAccount"`
	Resources         Resources             `json:"resources"`
	VolumeSpec        *PgStorageSpec        `json:"volumeSpec"`
	Storages          map[string]Storage    `json:"storages"`
	Schedule          []CronJob             `json:"schedule"`
	StorageTypes      []BackrestStorageType `json:"storageTypes"`
	AntiAffinityType  PodAntiAffinityType   `json:"antiAffinityType"`
	RepoPath          string                `json:"repoPath"`
}

type Badger added in v0.2.0

type Badger struct {
	Enabled bool   `json:"enabled"`
	Image   string `json:"image"`
	Port    int    `json:"port"`
}

type ClusterAnnotationType

type ClusterAnnotationType int

ClusterAnnotationType just helps with the various cluster annotation types available

const (
	// ClusterAnnotationGlobal indicates to apply the annotation regardless of
	// deployment type
	ClusterAnnotationGlobal ClusterAnnotationType = iota
	// ClusterAnnotationPostgres indicates to apply the annotation to the
	// PostgreSQL deployments
	ClusterAnnotationPostgres
	// ClusterAnnotationBackrest indicates to apply the annotation to the
	// pgBackRest deployments
	ClusterAnnotationBackrest
	// ClusterAnnotationPgBouncer indicates to apply the annotation to the
	// pgBouncer deployments
	ClusterAnnotationPgBouncer
)

the following constants help with selecting which annotations we may want to apply to a particular Deployment

type ClusterAnnotations

type ClusterAnnotations struct {
	// Backrest annotations will be propagated **only** to the pgBackRest managed
	// Deployments
	Backrest map[string]string `json:"backrest"`

	// Global annotations will be propagated to **all** managed Deployments
	Global map[string]string `json:"global"`

	// PgBouncer annotations will be propagated **only** to the PgBouncer managed
	// Deployments
	PgBouncer map[string]string `json:"pgBouncer"`

	// Postgres annotations will be propagated **only** to the PostgreSQL managed
	// deployments
	Postgres map[string]string `json:"postgres"`
}

ClusterAnnotations provides a set of annotations that can be propagated to the managed deployments. These are subdivided into four categories, which are explained further below:

- Global - Postgres - Backrest - PgBouncer

func (*ClusterAnnotations) DeepCopy

func (in *ClusterAnnotations) DeepCopy() *ClusterAnnotations

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

func (*ClusterAnnotations) DeepCopyInto

func (in *ClusterAnnotations) DeepCopyInto(out *ClusterAnnotations)

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

type CronJob added in v0.2.0

type CronJob struct {
	Name     string `json:"name"`
	Schedule string `json:"schedule"`
	Keep     int64  `json:"keep"`
	Type     string `json:"type"`
	Storage  string `json:"storage"`
}

type Expose added in v0.2.0

type Expose struct {
	ServiceType              v1.ServiceType    `json:"serviceType"`
	LoadBalancerSourceRanges []string          `json:"loadBalancerSourceRanges"`
	Annotations              map[string]string `json:"annotations"`
	Labels                   map[string]string `json:"labels"`
}

type HotStandby added in v0.2.0

type HotStandby struct {
	Size              int               `json:"size"`
	Resources         *Resources        `json:"resources"`
	VolumeSpec        *PgStorageSpec    `json:"volumeSpec"`
	Labels            map[string]string `json:"labels"`
	Annotations       map[string]string `json:"annotations"`
	Affinity          *v1.Affinity      `json:"affinity"`
	EnableSyncStandby bool              `json:"enableSyncStandby"`
	Expose            Expose            `json:"expose"`
}

type NodeAffinitySpec

type NodeAffinitySpec struct {
	Default *v1.NodeAffinity `json:"default"`
}

NodeAffinitySpec contains optional NodeAffinity rules for the different deployment types managed by the Operator. While similar to how the Operator handles pod anti-affinity, makes reference to the supported Kubernetes objects to maintain more familiarity and consistency.

All of these are optional, so one must ensure they check for nils.

func (*NodeAffinitySpec) DeepCopy

func (in *NodeAffinitySpec) DeepCopy() *NodeAffinitySpec

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

func (*NodeAffinitySpec) DeepCopyInto

func (in *NodeAffinitySpec) DeepCopyInto(out *NodeAffinitySpec)

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

type NodeAffinityType

type NodeAffinityType int

NodeAffinityType indicates the type of node affinity that the request seeks to use. Given the custom resource uses the native Kubernetes types to set node affinity, this is just for convenience for the API

const (
	NodeAffinityTypePreferred NodeAffinityType = iota
	NodeAffinityTypeRequired
)

type PGDataSource added in v0.2.0

type PGDataSource struct {
	Namespace   string `json:"namespace"`
	RestoreFrom string `json:"restoreFrom"`
	RestoreOpts string `json:"restoreOpts"`
}

type PGDataSourceSpec

type PGDataSourceSpec struct {
	Namespace   string `json:"namespace"`
	RestoreFrom string `json:"restoreFrom"`
	RestoreOpts string `json:"restoreOpts"`
}

PGDataSourceSpec defines the data source that should be used to populate the initial PGDATA directory when bootstrapping a new PostgreSQL cluster swagger:ignore

func (*PGDataSourceSpec) DeepCopy

func (in *PGDataSourceSpec) DeepCopy() *PGDataSourceSpec

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

func (*PGDataSourceSpec) DeepCopyInto

func (in *PGDataSourceSpec) DeepCopyInto(out *PGDataSourceSpec)

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

type PGPrimary added in v0.2.0

type PGPrimary struct {
	Image              string              `json:"image"`
	Customconfig       string              `json:"customconfig"`
	Resources          Resources           `json:"resources"`
	VolumeSpec         *PgStorageSpec      `json:"volumeSpec"`
	Labels             map[string]string   `json:"labels"`
	Annotations        map[string]string   `json:"annotations"`
	Affinity           v1.Affinity         `json:"affinity"`
	AntiAffinityType   PodAntiAffinityType `json:"antiAffinityType"`
	ImagePullPolicy    string              `json:"imagePullPolicy"`
	Tolerations        []v1.Toleration     `json:"tolerations"`
	NodeSelector       string              `json:"nodeSelector"`
	RuntimeClassName   string              `json:"runtimeClassName"`
	PodSecurityContext string              `json:"podSecurityContext"`
	Expose             Expose              `json:"expose"`
}

type PGReplicas added in v0.2.0

type PGReplicas struct {
	HotStandby HotStandby `json:"hotStandby"`
}

type PMMSpec

type PMMSpec struct {
	Enabled    bool      `json:"enabled"`
	Image      string    `json:"image"`
	ServerHost string    `json:"serverHost,omitempty"`
	ServerUser string    `json:"serverUser,omitempty"`
	PMMSecret  string    `json:"pmmSecret,omitempty"`
	Resources  Resources `json:"resources"`
}

PMMSpec contains settings for PMM

type PVCStorage added in v0.2.0

type PVCStorage struct {
	VolumeSpec PgStorageSpec `json:"volumeSpec"`
}

type PerconaPGCluster added in v0.2.0

type PerconaPGCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`
	Spec              PerconaPGClusterSpec   `json:"spec"`
	Status            PerconaPGClusterStatus `json:"status,omitempty"`
}

PerconaPGCluster is the CRD that defines a Percona PG Cluster

swagger:ignore Pgcluster +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PerconaPGCluster) DeepCopy added in v0.2.0

func (in *PerconaPGCluster) DeepCopy() *PerconaPGCluster

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

func (*PerconaPGCluster) DeepCopyInto added in v0.2.0

func (in *PerconaPGCluster) DeepCopyInto(out *PerconaPGCluster)

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

func (*PerconaPGCluster) DeepCopyObject added in v0.2.0

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

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

type PerconaPGClusterList added in v0.2.0

type PerconaPGClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []PerconaPGCluster `json:"items"`
}

PerconaPGClusterList is the CRD that defines a Percona PG Cluster List swagger:ignore +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PerconaPGClusterList) DeepCopy added in v0.2.0

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

func (*PerconaPGClusterList) DeepCopyInto added in v0.2.0

func (in *PerconaPGClusterList) DeepCopyInto(out *PerconaPGClusterList)

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

func (*PerconaPGClusterList) DeepCopyObject added in v0.2.0

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

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

type PerconaPGClusterSpec added in v0.2.0

type PerconaPGClusterSpec struct {
	Namespace                string                 `json:"namespace"`
	Database                 string                 `json:"database"`
	User                     string                 `json:"user"`
	Port                     string                 `json:"port"`
	UserLabels               map[string]string      `json:"userLabels"`
	WalStorage               PVCStorage             `json:"walStorage"`
	TablespaceStorages       map[string]PVCStorage  `json:"tablespaceStorages"`
	Pause                    bool                   `json:"pause"`
	Standby                  bool                   `json:"standby"`
	TlSOnly                  bool                   `json:"tlsOnly"`
	DisableAutofail          bool                   `json:"disableAutofail"`
	KeepData                 bool                   `json:"keepData"`
	KeepBackups              bool                   `json:"keepBackups"`
	PGPrimary                PGPrimary              `json:"pgPrimary"`
	PGReplicas               *PGReplicas            `json:"pgReplicas"`
	PGBadger                 Badger                 `json:"pgBadger"`
	PGBouncer                PgBouncer              `json:"pgBouncer"`
	PGDataSource             PGDataSourceSpec       `json:"pgDataSource"`
	PMM                      PMMSpec                `json:"pmm"`
	Backup                   Backup                 `json:"backup"`
	SecurityContext          *v1.PodSecurityContext `json:"securityContext"`
	SSLCA                    string                 `json:"sslCA"`
	SSLSecretName            string                 `json:"sslSecretName"`
	SSLReplicationSecretName string                 `json:"sslReplicationSecretName"`
}

PerconaPGClusterSpec is the CRD that defines a Percona PG Cluster Spec swagger:ignore

func (*PerconaPGClusterSpec) DeepCopyInto added in v0.2.0

func (in *PerconaPGClusterSpec) DeepCopyInto(out *PerconaPGClusterSpec)

type PerconaPGClusterStatus added in v0.2.0

type PerconaPGClusterStatus struct {
	PGCluster  PgclusterStatus
	PGReplicas map[string]PgreplicaStatus
}

type PgBouncer added in v0.2.0

type PgBouncer struct {
	Image            string              `json:"image"`
	Size             int32               `json:"size"`
	Resources        Resources           `json:"resources"`
	TLSSecret        string              `json:"tlsSecret"`
	Expose           Expose              `json:"expose"`
	AntiAffinityType PodAntiAffinityType `json:"antiAffinityType"`
}

type PgBouncerSpec

type PgBouncerSpec struct {
	// Replicas represents the total number of Pods to deploy with pgBouncer,
	// which effectively enables/disables the pgBouncer.
	//
	// if it is set to 0 or less, it is disabled.
	//
	// if it is set to 1 or more, it is enabled
	Replicas int32 `json:"replicas"`
	// Resources, if specified, contains the container request resources
	// for any pgBouncer Deployments that are part of a PostgreSQL cluster
	Resources v1.ResourceList `json:"resources"`
	// Limits, if specified, contains the container resource limits
	// for any pgBouncer Deployments that are part of a PostgreSQL cluster
	Limits v1.ResourceList `json:"limits"`
	// ServiceType references the type of Service that should be used when
	// deploying the pgBouncer instances. If unset, it defaults to the value of
	// the PostgreSQL cluster.
	ServiceType v1.ServiceType `json:"serviceType"`
	// TLSSecret contains the name of the secret to use that contains the TLS
	// keypair for pgBouncer
	// This follows the Kubernetes secret format ("kubernetes.io/tls") which has
	// two keys: tls.crt and tls.key
	TLSSecret string `json:"tlsSecret"`
	Image     string `json:"image"`
}

PgBouncerSpec is a struct that is used within the Cluster specification that provides the attributes for managing a PgBouncer implementation, including: - is it enabled? - what resources it should consume - the total number of replicas

func (*PgBouncerSpec) DeepCopy

func (in *PgBouncerSpec) DeepCopy() *PgBouncerSpec

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

func (*PgBouncerSpec) DeepCopyInto

func (in *PgBouncerSpec) DeepCopyInto(out *PgBouncerSpec)

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

func (*PgBouncerSpec) Enabled

func (s *PgBouncerSpec) Enabled() bool

Enabled returns true if the pgBouncer is enabled for the cluster, i.e. there is at least one replica set

type PgStorageSpec

type PgStorageSpec struct {
	Name               string `json:"name"`
	StorageClass       string `json:"storageclass"`
	AccessMode         string `json:"accessmode"`
	Size               string `json:"size"`
	StorageType        string `json:"storagetype"`
	SupplementalGroups string `json:"supplementalgroups"`
	MatchLabels        string `json:"matchLabels"`
}

PgStorageSpec ... swagger:ignore

func (*PgStorageSpec) DeepCopy

func (in *PgStorageSpec) DeepCopy() *PgStorageSpec

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

func (*PgStorageSpec) DeepCopyInto

func (in *PgStorageSpec) DeepCopyInto(out *PgStorageSpec)

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

func (PgStorageSpec) GetSupplementalGroups

func (s PgStorageSpec) GetSupplementalGroups() []int64

GetSupplementalGroups converts the comma-separated list of SupplementalGroups into a slice of int64 IDs. If it errors, it returns an empty slice and logs a warning

type Pgcluster

type Pgcluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`
	Spec              PgclusterSpec   `json:"spec"`
	Status            PgclusterStatus `json:"status,omitempty"`
}

Pgcluster is the CRD that defines a Crunchy PG Cluster

swagger:ignore Pgcluster +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Pgcluster) DeepCopy

func (in *Pgcluster) DeepCopy() *Pgcluster

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

func (*Pgcluster) DeepCopyInto

func (in *Pgcluster) DeepCopyInto(out *Pgcluster)

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

func (*Pgcluster) DeepCopyObject

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

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

type PgclusterList

type PgclusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Pgcluster `json:"items"`
}

PgclusterList is the CRD that defines a Crunchy PG Cluster List swagger:ignore +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PgclusterList) DeepCopy

func (in *PgclusterList) DeepCopy() *PgclusterList

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

func (*PgclusterList) DeepCopyInto

func (in *PgclusterList) DeepCopyInto(out *PgclusterList)

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

func (*PgclusterList) DeepCopyObject

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

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

type PgclusterSpec

type PgclusterSpec struct {
	Name           string `json:"name"`
	ClusterName    string `json:"clustername"`
	Policies       string `json:"policies"`
	CCPImage       string `json:"ccpimage"`
	CCPImageTag    string `json:"ccpimagetag"`
	CCPImagePrefix string `json:"ccpimageprefix"`
	PGOImagePrefix string `json:"pgoimageprefix"`
	PGImage        string `json:"pgImage"`
	Port           string `json:"port"`
	// DisableAutofail, if set to true, disables the autofail/HA capabilities
	// We choose this, instead of the affirmative, so that way we default to
	// autofail being on, given we're doing some legacy CRD stuff here
	DisableAutofail bool `json:"disableAutofail"`
	// PGBadger, if set to true, enables the pgBadger sidecar
	PGBadger      bool   `json:"pgBadger"`
	PGBadgerPort  string `json:"pgbadgerport"`
	PGBadgerImage string `json:"pgBadgerImage"`
	// Exporter, if set to true, enables the exporter sidecar
	Exporter     bool   `json:"exporter"`
	ExporterPort string `json:"exporterport"`

	PrimaryStorage  PgStorageSpec
	WALStorage      PgStorageSpec
	ReplicaStorage  PgStorageSpec
	BackrestStorage PgStorageSpec
	PGAdminStorage  PgStorageSpec

	// Resources behaves just like the "Requests" section of a Kubernetes
	// container definition. You can set individual items such as "cpu" and
	// "memory", e.g. "{ cpu: "0.5", memory: "2Gi" }"
	Resources v1.ResourceList `json:"resources"`
	// Limits stores the CPU/memory limits to use with PostgreSQL instances
	//
	// A long note on memory limits.
	//
	//  We want to avoid the OOM killer coming for the PostgreSQL process or any
	// of their backends per lots of guidance from the PostgreSQL documentation.
	// Based on Kubernetes' behavior with limits, the best thing is to not set
	// them. However, if they ever do set, we suggest that you have
	// Request == Limit to get the Guaranteed QoS
	//
	// Guaranteed QoS prevents a backend from being first in line to be killed if
	// the *Node* has memory pressure, but if there is, say
	// a runaway client backend that causes the *Pod* to exceed its memory
	// limit, a backend can still be killed by the OOM killer, which is not
	// great.
	//
	// As such, given the choice, the preference is for the Pod to be evicted
	// and have a failover event, vs. having an individual client backend killed
	// and causing potential "bad things."
	//
	// For more info on PostgreSQL and Kubernetes memory management, see:
	//
	// https://www.postgresql.org/docs/current/kernel-resources.html#LINUX-MEMORY-OVERCOMMIT
	// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#how-pods-with-resource-limits-are-run
	Limits v1.ResourceList `json:"limits"`
	// BackrestResources, if specified, contains the container request resources
	// for the pgBackRest Deployment for this PostgreSQL cluster
	BackrestResources v1.ResourceList `json:"backrestResources"`
	// BackrestLimits, if specified, contains the container resource limits
	// for the pgBackRest Deployment for this PostgreSQL cluster
	BackrestLimits v1.ResourceList `json:"backrestLimits"`
	// ExporterResources, if specified, contains the container request resources
	// for the Crunchy Postgres Exporter Deployment for this PostgreSQL cluster
	ExporterResources v1.ResourceList `json:"exporterResources"`
	// ExporterLimits, if specified, contains the container resource limits
	// for the Crunchy Postgres Exporter Deployment for this PostgreSQL cluster
	ExporterLimits v1.ResourceList `json:"exporterLimits"`

	// PgBouncer contains all of the settings to properly maintain a pgBouncer
	// implementation
	PgBouncer           PgBouncerSpec         `json:"pgBouncer"`
	PgAdminImage        string                `json:"pgAdminImage"`
	User                string                `json:"user"`
	PasswordType        string                `json:"passwordType"`
	Database            string                `json:"database"`
	Replicas            string                `json:"replicas"`
	Status              string                `json:"status"`
	CustomConfig        string                `json:"customconfig"`
	UserLabels          map[string]string     `json:"userlabels"`
	NodeAffinity        NodeAffinitySpec      `json:"nodeAffinity"`
	PodAntiAffinity     PodAntiAffinitySpec   `json:"podAntiAffinity"`
	SyncReplication     *bool                 `json:"syncReplication"`
	BackrestConfig      []v1.VolumeProjection `json:"backrestConfig"`
	BackrestGCSBucket   string                `json:"backrestGCSBucket"`
	BackrestGCSEndpoint string                `json:"backrestGCSEndpoint"`
	BackrestGCSKeyType  string                `json:"backrestGCSKeyType"`
	BackrestS3Bucket    string                `json:"backrestS3Bucket"`
	BackrestS3Region    string                `json:"backrestS3Region"`
	BackrestS3Endpoint  string                `json:"backrestS3Endpoint"`
	BackrestS3URIStyle  string                `json:"backrestS3URIStyle"`
	BackrestS3VerifyTLS string                `json:"backrestS3VerifyTLS"`
	BackrestRepoPath    string                `json:"backrestRepoPath"`
	BackrestImage       string                `json:"backrestImage"`
	BackrestRepoImage   string                `json:"backrestRepoImage"`
	// BackrestStorageTypes is a list of the different pgBackRest storage types
	// to be used for this cluster. Presently, it can only accept the following:
	// - local
	// - s3
	// - gcs
	// - local,s3
	// - local,gcs
	// if the array is empty, "local" ("posix") is presumed.
	BackrestStorageTypes []BackrestStorageType    `json:"backrestStorageTypes"`
	TablespaceMounts     map[string]PgStorageSpec `json:"tablespaceMounts"`
	TLS                  TLSSpec                  `json:"tls"`
	TLSOnly              bool                     `json:"tlsOnly"`
	Standby              bool                     `json:"standby"`
	Shutdown             bool                     `json:"shutdown"`
	PGDataSource         PGDataSourceSpec         `json:"pgDataSource"`

	// Annotations contains a set of Deployment (and by association, Pod)
	// annotations that are propagated to all managed Deployments
	Annotations ClusterAnnotations `json:"annotations"`

	// ServiceType references the type of Service that should be used when
	// deploying PostgreSQL instances
	ServiceType v1.ServiceType `json:"serviceType"`

	// Tolerations are an optional list of Pod toleration rules that are applied
	// to the PostgreSQL instance.
	Tolerations []v1.Toleration `json:"tolerations"`
}

PgclusterSpec is the CRD that defines a Crunchy PG Cluster Spec swagger:ignore

func (*PgclusterSpec) DeepCopy

func (in *PgclusterSpec) DeepCopy() *PgclusterSpec

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

func (*PgclusterSpec) DeepCopyInto

func (in *PgclusterSpec) DeepCopyInto(out *PgclusterSpec)

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

type PgclusterState

type PgclusterState string

PgclusterState is the crd that defines PG Cluster Stage swagger:ignore

type PgclusterStatus

type PgclusterStatus struct {
	State   PgclusterState `json:"state,omitempty"`
	Message string         `json:"message,omitempty"`
}

PgclusterStatus is the CRD that defines PG Cluster Status swagger:ignore

func (*PgclusterStatus) DeepCopy

func (in *PgclusterStatus) DeepCopy() *PgclusterStatus

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

func (*PgclusterStatus) DeepCopyInto

func (in *PgclusterStatus) DeepCopyInto(out *PgclusterStatus)

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

type Pgpolicy

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

	Spec   PgpolicySpec   `json:"spec"`
	Status PgpolicyStatus `json:"status,omitempty"`
}

Pgpolicy ... swagger:ignore +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Pgpolicy) DeepCopy

func (in *Pgpolicy) DeepCopy() *Pgpolicy

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

func (*Pgpolicy) DeepCopyInto

func (in *Pgpolicy) DeepCopyInto(out *Pgpolicy)

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

func (*Pgpolicy) DeepCopyObject

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

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

type PgpolicyList

type PgpolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Pgpolicy `json:"items"`
}

PgpolicyList ... swagger:ignore +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PgpolicyList) DeepCopy

func (in *PgpolicyList) DeepCopy() *PgpolicyList

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

func (*PgpolicyList) DeepCopyInto

func (in *PgpolicyList) DeepCopyInto(out *PgpolicyList)

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

func (*PgpolicyList) DeepCopyObject

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

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

type PgpolicySpec

type PgpolicySpec struct {
	Name   string `json:"name"`
	SQL    string `json:"sql"`
	Status string `json:"status"`
}

PgpolicySpec ... swagger:ignore

func (*PgpolicySpec) DeepCopy

func (in *PgpolicySpec) DeepCopy() *PgpolicySpec

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

func (*PgpolicySpec) DeepCopyInto

func (in *PgpolicySpec) DeepCopyInto(out *PgpolicySpec)

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

type PgpolicyState

type PgpolicyState string

PgpolicyState ... swagger:ignore

const (
	// PgpolicyStateCreated ...
	PgpolicyStateCreated PgpolicyState = "pgpolicy Created"
	// PgpolicyStateProcessed ...
	PgpolicyStateProcessed PgpolicyState = "pgpolicy Processed"
)

type PgpolicyStatus

type PgpolicyStatus struct {
	State   PgpolicyState `json:"state,omitempty"`
	Message string        `json:"message,omitempty"`
}

PgpolicyStatus ... swagger:ignore

func (*PgpolicyStatus) DeepCopy

func (in *PgpolicyStatus) DeepCopy() *PgpolicyStatus

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

func (*PgpolicyStatus) DeepCopyInto

func (in *PgpolicyStatus) DeepCopyInto(out *PgpolicyStatus)

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

type Pgreplica

type Pgreplica struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`
	Spec              PgreplicaSpec   `json:"spec"`
	Status            PgreplicaStatus `json:"status,omitempty"`
}

Pgreplica .. swagger:ignore +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Pgreplica) DeepCopy

func (in *Pgreplica) DeepCopy() *Pgreplica

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

func (*Pgreplica) DeepCopyInto

func (in *Pgreplica) DeepCopyInto(out *Pgreplica)

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

func (*Pgreplica) DeepCopyObject

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

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

type PgreplicaList

type PgreplicaList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Pgreplica `json:"items"`
}

PgreplicaList ... swagger:ignore +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PgreplicaList) DeepCopy

func (in *PgreplicaList) DeepCopy() *PgreplicaList

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

func (*PgreplicaList) DeepCopyInto

func (in *PgreplicaList) DeepCopyInto(out *PgreplicaList)

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

func (*PgreplicaList) DeepCopyObject

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

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

type PgreplicaSpec

type PgreplicaSpec struct {
	Name           string        `json:"name"`
	ClusterName    string        `json:"clustername"`
	ReplicaStorage PgStorageSpec `json:"replicastorage"`
	// ServiceType references the type of Service that should be used when
	// deploying PostgreSQL instances
	ServiceType v1.ServiceType    `json:"serviceType"`
	Status      string            `json:"status"`
	UserLabels  map[string]string `json:"userlabels"`
	// NodeAffinity is an optional structure that dictates how an instance should
	// be deployed in an environment
	NodeAffinity *v1.NodeAffinity `json:"nodeAffinity"`
	// Tolerations are an optional list of Pod toleration rules that are applied
	// to the PostgreSQL instance.
	Tolerations []v1.Toleration `json:"tolerations"`
}

PgreplicaSpec ... swagger:ignore

func (*PgreplicaSpec) DeepCopy

func (in *PgreplicaSpec) DeepCopy() *PgreplicaSpec

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

func (*PgreplicaSpec) DeepCopyInto

func (in *PgreplicaSpec) DeepCopyInto(out *PgreplicaSpec)

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

type PgreplicaState

type PgreplicaState string

PgreplicaState ... swagger:ignore

const (
	// PgreplicaStateCreated ...
	PgreplicaStateCreated PgreplicaState = "pgreplica Created"
	// PgreplicaStatePending ...
	PgreplicaStatePendingInit PgreplicaState = "pgreplica Pending init"
	// PgreplicaStatePendingRestore ...
	PgreplicaStatePendingRestore PgreplicaState = "pgreplica Pending restore"
	// PgreplicaStateProcessed ...
	PgreplicaStateProcessed PgreplicaState = "pgreplica Processed"
)

type PgreplicaStatus

type PgreplicaStatus struct {
	State   PgreplicaState `json:"state,omitempty"`
	Message string         `json:"message,omitempty"`
}

PgreplicaStatus ... swagger:ignore

func (*PgreplicaStatus) DeepCopy

func (in *PgreplicaStatus) DeepCopy() *PgreplicaStatus

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

func (*PgreplicaStatus) DeepCopyInto

func (in *PgreplicaStatus) DeepCopyInto(out *PgreplicaStatus)

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

type Pgtask

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

	Spec   PgtaskSpec   `json:"spec"`
	Status PgtaskStatus `json:"status,omitempty"`
}

Pgtask ... swagger:ignore +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Pgtask) DeepCopy

func (in *Pgtask) DeepCopy() *Pgtask

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

func (*Pgtask) DeepCopyInto

func (in *Pgtask) DeepCopyInto(out *Pgtask)

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

func (*Pgtask) DeepCopyObject

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

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

type PgtaskList

type PgtaskList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Pgtask `json:"items"`
}

PgtaskList ... swagger:ignore +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*PgtaskList) DeepCopy

func (in *PgtaskList) DeepCopy() *PgtaskList

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

func (*PgtaskList) DeepCopyInto

func (in *PgtaskList) DeepCopyInto(out *PgtaskList)

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

func (*PgtaskList) DeepCopyObject

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

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

type PgtaskSpec

type PgtaskSpec struct {
	Name        string            `json:"name"`
	StorageSpec PgStorageSpec     `json:"storagespec"`
	TaskType    string            `json:"tasktype"`
	Status      string            `json:"status"`
	Parameters  map[string]string `json:"parameters"`
}

PgtaskSpec ... swagger:ignore

func (*PgtaskSpec) DeepCopy

func (in *PgtaskSpec) DeepCopy() *PgtaskSpec

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

func (*PgtaskSpec) DeepCopyInto

func (in *PgtaskSpec) DeepCopyInto(out *PgtaskSpec)

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

type PgtaskState

type PgtaskState string

PgtaskState ... swagger:ignore

const (
	// PgtaskStateCreated ...
	PgtaskStateCreated PgtaskState = "pgtask Created"
	// PgtaskStateProcessed ...
	PgtaskStateProcessed PgtaskState = "pgtask Processed"
)

type PgtaskStatus

type PgtaskStatus struct {
	State   PgtaskState `json:"state,omitempty"`
	Message string      `json:"message,omitempty"`
}

PgtaskStatus ... swagger:ignore

func (*PgtaskStatus) DeepCopy

func (in *PgtaskStatus) DeepCopy() *PgtaskStatus

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

func (*PgtaskStatus) DeepCopyInto

func (in *PgtaskStatus) DeepCopyInto(out *PgtaskStatus)

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

type PodAntiAffinityDeployment

type PodAntiAffinityDeployment int

PodAntiAffinityDeployment distinguishes between the different types of Deployments that can leverage PodAntiAffinity

const (
	PodAntiAffinityDeploymentDefault PodAntiAffinityDeployment = iota
	PodAntiAffinityDeploymentPgBackRest
	PodAntiAffinityDeploymentPgBouncer
)

The list of different types of PodAntiAffinityDeployments

type PodAntiAffinitySpec

type PodAntiAffinitySpec struct {
	Default    PodAntiAffinityType `json:"default"`
	PgBackRest PodAntiAffinityType `json:"pgBackRest"`
	PgBouncer  PodAntiAffinityType `json:"pgBouncer"`
}

PodAntiAffinitySpec provides multiple configurations for how pod anti-affinity can be set.

  • "Default" is the default rule that applies to all Pods that are a part of the PostgreSQL cluster
  • "PgBackrest" applies just to the pgBackRest repository Pods in said Deployment
  • "PgBouncer" applies to just pgBouncer Pods in said Deployment

swaggier:ignore

func (*PodAntiAffinitySpec) DeepCopy

func (in *PodAntiAffinitySpec) DeepCopy() *PodAntiAffinitySpec

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

func (*PodAntiAffinitySpec) DeepCopyInto

func (in *PodAntiAffinitySpec) DeepCopyInto(out *PodAntiAffinitySpec)

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

type PodAntiAffinityType

type PodAntiAffinityType string

PodAntiAffinityType defines the different types of type of anti-affinity rules applied to pg clusters when utilizing the default pod anti-affinity rules provided by the PostgreSQL Operator, which are enabled for a new pg cluster by default. Valid Values include "required" for requiredDuringSchedulingIgnoredDuringExecution anti-affinity, "preferred" for preferredDuringSchedulingIgnoredDuringExecution anti-affinity, and "disabled" to disable the default pod anti-affinity rules for the pg cluster all together.

func (PodAntiAffinityType) Validate

func (p PodAntiAffinityType) Validate() error

ValidatePodAntiAffinityType is responsible for validating whether or not the type of pod anti-affinity specified is valid

type Resources added in v0.2.0

type Resources struct {
	Requests v1.ResourceList `json:"requests"`
	Limits   v1.ResourceList `json:"limits"`
}

type Storage added in v0.2.0

type Storage struct {
	Type        StorageType `json:"type"`
	Bucket      string      `json:"bucket"`
	Region      string      `json:"region"`
	EndpointURL string      `json:"endpointUrl"`
	KeyType     string      `json:"keyType"`
	URIStyle    string      `json:"uriStyle"`
	VerifyTLS   bool        `json:"verifyTLS"`
}

type StorageType added in v0.2.0

type StorageType string

type TLSSpec

type TLSSpec struct {
	// CASecret contains the name of the secret to use as the trusted CA for the
	// TLSSecret
	// This is our own format and should contain at least one key: "ca.crt"
	// It can also contain a key "ca.crl" which is the certificate revocation list
	CASecret string `json:"caSecret"`
	// ReplicationTLSSecret contains the name of the secret that specifies a TLS
	// keypair that can be used by the replication user (e.g. "primaryuser") to
	// perform certificate based authentication between replicas.
	// The keypair must be considered valid by the CA specified in the CASecret
	ReplicationTLSSecret string `json:"replicationTLSSecret"`
	// TLSSecret contains the name of the secret to use that contains the TLS
	// keypair for the PostgreSQL server
	// This follows the Kubernetes secret format ("kubernetes.io/tls") which has
	// two keys: tls.crt and tls.key
	TLSSecret string `json:"tlsSecret"`
}

TLSSpec contains the information to set up a TLS-enabled PostgreSQL cluster

func (*TLSSpec) DeepCopy

func (in *TLSSpec) DeepCopy() *TLSSpec

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

func (*TLSSpec) DeepCopyInto

func (in *TLSSpec) DeepCopyInto(out *TLSSpec)

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

func (TLSSpec) IsTLSEnabled

func (t TLSSpec) IsTLSEnabled() bool

IsTLSEnabled returns true if the cluster is TLS enabled, i.e. both the TLS secret name and the CA secret name are available

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL