config

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ANNOTATION_BACKREST_RESTORE is used to annotate pgclusters that are restoring
	ANNOTATION_BACKREST_RESTORE       = "pgo-backrest-restore"
	ANNOTATION_PGHA_BOOTSTRAP_REPLICA = "pgo-pgha-bootstrap-replica"
	ANNOTATION_PRIMARY_DEPLOYMENT     = "primary-deployment"
	// ANNOTATION_CLUSTER_DO_NOT_RESIZE indicates on a custom resource update that
	// a specific instance should not be resized
	ANNOTATION_CLUSTER_DO_NOT_RESIZE = "do-not-resize"
	// ANNOTATION_CLUSTER_KEEP_BACKUPS indicates that if a custom resource is
	// deleted, ensure the backups are kept
	ANNOTATION_CLUSTER_KEEP_BACKUPS = "keep-backups"
	// ANNOTATION_CLUSTER_KEEP_DATA indicates that if a custom resource is
	// deleted, ensure the data directory is kept
	ANNOTATION_CLUSTER_KEEP_DATA = "keep-data"
	// annotation to track the cluster's current primary
	ANNOTATION_CURRENT_PRIMARY = "current-primary"
	// annotation to indicate whether a cluster has been upgraded
	ANNOTATION_IS_UPGRADED = "is-upgraded"
	// annotation to indicate an upgrade is in progress. this has the effect
	// of causeing the rmdata job in pgcluster to not run
	ANNOTATION_UPGRADE_IN_PROGRESS = "upgrade-in-progress"
	// annotation to store the Operator versions upgraded from and to
	ANNOTATION_UPGRADE_INFO = "upgrade-info"
	// annotation to store the string boolean, used when checking upgrade status
	ANNOTATIONS_FALSE = "false"
	// ANNOTATION_REPO_PATH is for storing the repository path for the pgBackRest repo in a cluster
	ANNOTATION_REPO_PATH = "repo-path"
	// ANNOTATION_PG_PORT is for storing the PostgreSQL port for a cluster
	ANNOTATION_PG_PORT = "pg-port"
	// ANNOTATION_GCS_BUCKET is for storing the name of the GCS bucket used by
	// pgBackRest in a cluster
	ANNOTATION_GCS_BUCKET = "gcs-bucket"
	// ANNOTATION_GCS_ENDPOINT is for storing the name of the GCS endpoint used by
	// pgBackRest in a cluster
	ANNOTATION_GCS_ENDPOINT = "gcs-endpoint"
	// ANNOTATION_GCS_KEY_TYPE is for storing the GCS key type used by pgBackRest
	// in a cluster
	ANNOTATION_GCS_KEY_TYPE = "gcs-key-type"
	// ANNOTATION_S3_BUCKET is for storing the name of the S3 bucket used by pgBackRest in
	// a cluster
	ANNOTATION_S3_BUCKET = "s3-bucket"
	// ANNOTATION_S3_ENDPOINT is for storing the name of the S3 endpoint used by pgBackRest in
	// a cluster
	ANNOTATION_S3_ENDPOINT = "s3-endpoint"
	// ANNOTATION_S3_REGION is for storing the name of the S3 region used by pgBackRest in
	// a cluster
	ANNOTATION_S3_REGION = "s3-region"
	// ANNOTATION_S3_URI_STYLE is for storing the the URI style that should be used to access a
	// pgBackRest repository
	ANNOTATION_S3_URI_STYLE = "s3-uri-style"
	// ANNOTATION_S3_VERIFY_TLS is for storing the setting that determines whether or not TLS should
	// be used to access a pgBackRest repository
	ANNOTATION_S3_VERIFY_TLS = "s3-verify-tls"
	// ANNOTATION_SSHD_PORT is for storing the SSHD port used by the pgBackRest repository
	// service in a cluster
	ANNOTATION_SSHD_PORT = "sshd-port"
	// ANNOTATION_SUPPLEMENTAL_GROUPS is for storing the supplemental groups used with a cluster
	ANNOTATION_SUPPLEMENTAL_GROUPS = "supplemental-groups"
)

annotations used by the operator

View Source
const (
	// ControllerGroupRefreshInterval is the default informer refresh interval in seconds
	// for the controllers created by the Controller Manager that require a refresh interval
	DefaultControllerGroupRefreshInterval = 60
	// NamespaceRefreshInterval is the default informer refresh interval in seconds
	// for the Operator's namespace controller
	DefaultNamespaceRefreshInterval = 60
)

The following constants define the default refresh intervals for any informers created by that require a refresh interval

View Source
const (
	// DefaultConfigMapWorkerCount defines the default number or workers for the worker queue
	// in the ConfigMap controller
	DefaultConfigMapWorkerCount = 2
	// DefaultNamespaceWorkerCount defines the default number or workers for the worker queue
	// in the Namespace controller
	DefaultNamespaceWorkerCount = 3
	// DefaultPGClusterWorkerCount defines the default number or workers for the worker queue
	// in the PGCluster controller
	DefaultPGClusterWorkerCount = 1
	// DefaultPGReplicaWorkerCount defines the default number or workers for the worker queue
	// in the PGReplica controller
	DefaultPGReplicaWorkerCount = 1
	// DefaultPGTaskWorkerCount defines the default number or workers for the worker queue
	// in the PGTask controller
	DefaultPGTaskWorkerCount = 1
)

The following constants define the default number of workers created for the worker queues created within the various controller created by the Operator

View Source
const (
	CONTAINER_IMAGE_PGO_BACKREST              = "crunchy-pgbackrest"
	CONTAINER_IMAGE_PGO_BACKREST_REPO         = "crunchy-pgbackrest-repo"
	CONTAINER_IMAGE_PGO_CLIENT                = "pgo-client"
	CONTAINER_IMAGE_PGO_RMDATA                = "pgo-rmdata"
	CONTAINER_IMAGE_CRUNCHY_POSTGRES_EXPORTER = "crunchy-postgres-exporter"
	CONTAINER_IMAGE_CRUNCHY_GRAFANA           = "crunchy-grafana"
	CONTAINER_IMAGE_CRUNCHY_PGADMIN           = "crunchy-pgadmin4"
	CONTAINER_IMAGE_CRUNCHY_PGBADGER          = "crunchy-pgbadger"
	CONTAINER_IMAGE_CRUNCHY_PGBOUNCER         = "crunchy-pgbouncer"
	CONTAINER_IMAGE_CRUNCHY_POSTGRES_HA       = "crunchy-postgres-ha"
	CONTAINER_IMAGE_CRUNCHY_POSTGRES_GIS_HA   = "crunchy-postgres-gis-ha"
	CONTAINER_IMAGE_CRUNCHY_PROMETHEUS        = "crunchy-prometheus"
)

a list of container images that are available

View Source
const (
	LABEL_NAME        = "name"
	LABEL_SELECTOR    = "selector"
	LABEL_OPERATOR    = "postgres-operator"
	LABEL_PG_CLUSTER  = "pg-cluster"
	LABEL_PG_DATABASE = "pgo-pg-database"
)

resource labels used by the operator

View Source
const (
	LABEL_PGPOLICY           = "pgpolicy"
	LABEL_PVCNAME            = "pvcname"
	LABEL_EXPORTER           = "crunchy-postgres-exporter"
	LABEL_ARCHIVE            = "archive"
	LABEL_ARCHIVE_TIMEOUT    = "archive-timeout"
	LABEL_NODE_AFFINITY_TYPE = "node-affinity-type"
	LABEL_NODE_LABEL_KEY     = "NodeLabelKey"
	LABEL_NODE_LABEL_VALUE   = "NodeLabelValue"
	LABEL_REPLICA_NAME       = "replica-name"
	LABEL_CCP_IMAGE_TAG_KEY  = "ccp-image-tag"
	LABEL_CCP_IMAGE_KEY      = "ccp-image"
	LABEL_IMAGE_PREFIX       = "image-prefix"
	LABEL_POD_ANTI_AFFINITY  = "pg-pod-anti-affinity"
	LABEL_AFFINITY_JSON      = "affinity-json"
)
View Source
const (
	LABEL_REPLICA_COUNT       = "replica-count"
	LABEL_STORAGE_CONFIG      = "storage-config"
	LABEL_NODE_LABEL          = "node-label"
	LABEL_VERSION             = "version"
	LABEL_PGO_VERSION         = "pgo-version"
	LABEL_DELETE_DATA         = "delete-data"
	LABEL_DELETE_DATA_STARTED = "delete-data-started"
	LABEL_DELETE_BACKUPS      = "delete-backups"
	LABEL_IS_REPLICA          = "is-replica"
	LABEL_IS_BACKUP           = "is-backup"
	LABEL_RM_TOLERATIONS      = "rmdata-tolerations"
	LABEL_STARTUP             = "startup"
	LABEL_SHUTDOWN            = "shutdown"
)
View Source
const (
	LABEL_BACKREST         = "pgo-backrest"
	LABEL_BACKREST_JOB     = "pgo-backrest-job"
	LABEL_BACKREST_RESTORE = "pgo-backrest-restore"
	LABEL_CONTAINER_NAME   = "containername"
	LABEL_POD_NAME         = "podname"
	// #nosec: G101
	LABEL_BACKREST_REPO_SECRET          = "backrest-repo-config"
	LABEL_BACKREST_COMMAND              = "backrest-command"
	LABEL_BACKREST_RESTORE_FROM_CLUSTER = "backrest-restore-from-cluster"
	LABEL_BACKREST_RESTORE_CLUSTER      = "backrest-restore-cluster"
	LABEL_BACKREST_RESTORE_OPTS         = "backrest-restore-opts"
	LABEL_BACKREST_BACKUP_OPTS          = "backrest-backup-opts"
	LABEL_BACKREST_OPTS                 = "backrest-opts"
	LABEL_BACKREST_PITR_TARGET          = "backrest-pitr-target"
	LABEL_BACKREST_STORAGE_TYPE         = "backrest-storage-type"
	LABEL_BACKREST_S3_VERIFY_TLS        = "backrest-s3-verify-tls"
	LABEL_BACKUP_TYPE_BACKREST          = "pgbackrest"
	LABEL_BACKUP_TYPE_PGDUMP            = "pgdump"
)
View Source
const (
	LABEL_PGDUMP_COMMAND = "pgdump"
	LABEL_PGDUMP_RESTORE = "pgdump-restore"
	LABEL_PGDUMP_OPTS    = "pgdump-opts"
	LABEL_PGDUMP_HOST    = "pgdump-host"
	LABEL_PGDUMP_DB      = "pgdump-db"
	LABEL_PGDUMP_USER    = "pgdump-user"
	LABEL_PGDUMP_PORT    = "pgdump-port"
	LABEL_PGDUMP_ALL     = "pgdump-all"
	LABEL_PGDUMP_PVC     = "pgdump-pvc"
)
View Source
const (
	LABEL_RESTORE_TYPE_PGRESTORE = "pgrestore"
	LABEL_PGRESTORE_COMMAND      = "pgrestore"
	LABEL_PGRESTORE_HOST         = "pgrestore-host"
	LABEL_PGRESTORE_DB           = "pgrestore-db"
	LABEL_PGRESTORE_USER         = "pgrestore-user"
	LABEL_PGRESTORE_PORT         = "pgrestore-port"
	LABEL_PGRESTORE_FROM_CLUSTER = "pgrestore-from-cluster"
	LABEL_PGRESTORE_FROM_PVC     = "pgrestore-from-pvc"
	LABEL_PGRESTORE_OPTS         = "pgrestore-opts"
	LABEL_PGRESTORE_PITR_TARGET  = "pgrestore-pitr-target"
)
View Source
const (
	LABEL_DATA_ROOT   = "data-root"
	LABEL_PVC_NAME    = "pvc-name"
	LABEL_VOLUME_NAME = "volume-name"
)
View Source
const (
	LABEL_SESSION_ID = "sessionid"
	LABEL_USERNAME   = "username"
	LABEL_ROLENAME   = "rolename"
	LABEL_PASSWORD   = "password"
)
View Source
const (
	LABEL_PGADMIN              = "crunchy-pgadmin"
	LABEL_PGADMIN_TASK_ADD     = "pgadmin-add"
	LABEL_PGADMIN_TASK_CLUSTER = "pgadmin-cluster"
	LABEL_PGADMIN_TASK_DELETE  = "pgadmin-delete"
)
View Source
const (
	LABEL_JOB_NAME             = "job-name"
	LABEL_PGBACKREST_STANZA    = "pgbackrest-stanza"
	LABEL_PGBACKREST_DB_PATH   = "pgbackrest-db-path"
	LABEL_PGBACKREST_REPO_PATH = "pgbackrest-repo-path"
	LABEL_PGBACKREST_REPO_HOST = "pgbackrest-repo-host"
)
View Source
const (
	LABEL_DEPLOYMENT_NAME = "deployment-name"
	LABEL_SERVICE_NAME    = "service-name"
	LABEL_CURRENT_PRIMARY = "current-primary"
)
View Source
const (
	LABEL_PGO_PGOUSER = "pgo-pgouser"
	LABEL_PGO_PGOROLE = "pgo-pgorole"
	LABEL_PGOUSER     = "pgouser"
	LABEL_WORKFLOW_ID = "workflowid" // NOTE: this now matches crv1.PgtaskWorkflowID
)
View Source
const (
	LABEL_TRUE  = "true"
	LABEL_FALSE = "false"
)
View Source
const (
	LABEL_NAMESPACE             = "namespace"
	LABEL_PGO_INSTALLATION_NAME = "pgo-installation-name"
	LABEL_VENDOR                = "vendor"
	LABEL_CRUNCHY               = "crunchydata"
	LABEL_PGO_CREATED_BY        = "pgo-created-by"
	LABEL_PGO_UPDATED_BY        = "pgo-updated-by"
)
View Source
const (
	LABEL_PGHA_SCOPE               = "crunchy-pgha-scope"
	LABEL_PGHA_CONFIGMAP           = "pgha-config"
	LABEL_PGHA_BACKUP_TYPE         = "pgha-backup-type"
	LABEL_PGHA_ROLE                = "role"
	LABEL_PGHA_ROLE_PRIMARY        = "master"
	LABEL_PGHA_ROLE_REPLICA        = "replica"
	LABEL_PGHA_BOOTSTRAP           = "pgha-bootstrap"
	LABEL_PGHA_BOOTSTRAP_NAMESPACE = "pgha-bootstrap-namespace"
)
View Source
const (
	DefaultServiceType = v1.ServiceTypeClusterIP
	CONFIG_PATH        = "pgo.yaml"
)
View Source
const (
	DEFAULT_BACKREST_PORT = 2022
	DEFAULT_PGADMIN_PORT  = "5050"
	DEFAULT_PGBADGER_PORT = "10000"
	DEFAULT_EXPORTER_PORT = "9187"
	DEFAULT_POSTGRES_PORT = "5432"
	DEFAULT_PATRONI_PORT  = "8009"
)
View Source
const (
	VOLUME_POSTGRESQL_DATA            = "pgdata"
	VOLUME_POSTGRESQL_DATA_MOUNT_PATH = "/pgdata"
)

volume configuration settings used by the PostgreSQL data directory and mount

View Source
const (
	VOLUME_PGBACKREST_REPO_NAME       = "backrestrepo"
	VOLUME_PGBACKREST_REPO_MOUNT_PATH = "/backrestrepo"
)

volume configuration settings used by the pgBackRest repo mount

View Source
const (
	VOLUME_SSHD_NAME       = "sshd"
	VOLUME_SSHD_MOUNT_PATH = "/sshd"
)

volume configuration settings used by the SSHD secret

View Source
const (
	CustomConfigMapName = "pgo-config"
)
View Source
const DefaultPgBouncerReplicas = 1

DefaultPgBouncerReplicas is the total number of Pods to place in a pgBouncer Deployment

View Source
const GLOBAL_CUSTOM_CONFIGMAP = "pgo-custom-pg-config"
View Source
const LABEL_CLAIM_NAME = "claimName"
View Source
const LABEL_PGBOUNCER = "crunchy-pgbouncer"
View Source
const LABEL_PGO_BACKREST_REPO = "pgo-backrest-repo"
View Source
const LABEL_PGTASK = "pg-task"
View Source
const LABEL_RESTART = "restart"
View Source
const (
	LABEL_RMDATA = "pgrmdata"
)
View Source
const LABEL_UPGRADE = "upgrade"

label for the pgcluster upgrade

View Source
const PGOBackrestRoleBindingPath = "pgo-backrest-role-binding.json"
View Source
const PGOBackrestRolePath = "pgo-backrest-role.json"
View Source
const PGOBackrestServiceAccountPath = "pgo-backrest-sa.json"
View Source
const PGODefaultServiceAccountPath = "pgo-default-sa.json"
View Source
const PGOPgRoleBindingPath = "pgo-pg-role-binding.json"
View Source
const PGOPgRolePath = "pgo-pg-role.json"
View Source
const PGOPgServiceAccountPath = "pgo-pg-sa.json"
View Source
const PGOTargetRoleBindingPath = "pgo-target-role-binding.json"
View Source
const PGOTargetRolePath = "pgo-target-role.json"
View Source
const PGOTargetServiceAccountPath = "pgo-target-sa.json"
View Source
const SecretOperatorBackrestRepoConfig = "pgo-backrest-repo-config"

#nosec: G101

View Source
const VOLUME_TABLESPACE_NAME_PREFIX = "tablespace-"

the pattern for the volume name used on a tablespace, which follows "tablespace-<tablespaceName>"

View Source
const VOLUME_TABLESPACE_PATH_PREFIX = "/tablespaces/"

the pattern for the path used to mount the volume of a tablespace, which follows "/tablespace/<pvcName>"

View Source
const VOLUME_TABLESPACE_PVC_NAME_FORMAT = "%s-tablespace-%s"

the pattern for the name of a tablespace PVC, which is off the form: "<clusterName>-tablespace-<tablespaceName>"

Variables

View Source
var (
	// DefaultBackrestRepoResourceMemory is the default value of the resource
	// request for memory for a pgBackRest repository
	DefaultBackrestResourceMemory = resource.MustParse("48Mi")
	// DefaultInstanceResourceMemory is the default value of the resource request
	// for memory for a PostgreSQL instance in a cluster
	DefaultInstanceResourceMemory = resource.MustParse("512Mi")
	// DefaultPgBouncerResourceMemory is the default value of the resource request
	// for memory of a pgBouncer instance
	DefaultPgBouncerResourceMemory = resource.MustParse("24Mi")
	// DefaultExporterResourceMemory is the default value of the resource request
	// for memory of a Crunchy Postgres Exporter instance
	DefaultExporterResourceMemory = resource.MustParse("24Mi")
)

Default resource values for deploying a PostgreSQL cluster. These values are utilized if the user has not provided these values either through configuration or from one-off API/CLI calls.

These values were determined by either program defaults (e.g. the PostgreSQL one) and/or loose to vigorous experimentation and profiling

View Source
var BackrestjobTemplate *template.Template
View Source
var BadgerTemplate *template.Template
View Source
var BootstrapTemplate *template.Template
View Source
var ContainerResourcesTemplate *template.Template
View Source
var DeploymentTemplate *template.Template
View Source
var ExporterTemplate *template.Template
View Source
var PVCMatchLabelsTemplate *template.Template
View Source
var PVCStorageClassTemplate *template.Template
View Source
var PVCTemplate *template.Template
View Source
var PgAdminServiceTemplate *template.Template
View Source
var PgAdminTemplate *template.Template
View Source
var PgDumpBackupJobTemplate *template.Template
View Source
var PgRestoreJobTemplate *template.Template
View Source
var PgbackrestEnvVarsTemplate *template.Template
View Source
var PgbackrestGCSEnvVarsTemplate *template.Template
View Source
var PgbackrestS3EnvVarsTemplate *template.Template
View Source
var PgbouncerConfTemplate *template.Template
View Source
var PgbouncerHBATemplate *template.Template
View Source
var PgbouncerTemplate *template.Template
View Source
var PgbouncerUsersTemplate *template.Template
View Source
var PgmonitorEnvVarsTemplate *template.Template
View Source
var PgoBackrestRepoServiceTemplate *template.Template
View Source
var PgoBackrestRepoTemplate *template.Template
View Source
var PgoBackrestRoleBindingTemplate *template.Template
View Source
var PgoBackrestRoleTemplate *template.Template
View Source
var PgoBackrestServiceAccountTemplate *template.Template
View Source
var PgoDefaultServiceAccountTemplate *template.Template
View Source
var PgoPgRoleBindingTemplate *template.Template
View Source
var PgoPgRoleTemplate *template.Template
View Source
var PgoPgServiceAccountTemplate *template.Template
View Source
var PgoTargetRoleBindingTemplate *template.Template
View Source
var PgoTargetRoleTemplate *template.Template
View Source
var PgoTargetServiceAccountTemplate *template.Template
View Source
var PodAntiAffinityTemplate *template.Template
View Source
var PolicyJobTemplate *template.Template
View Source
var RelatedImageMap = map[string]string{
	"RELATED_IMAGE_PGO_BACKREST":              CONTAINER_IMAGE_PGO_BACKREST,
	"RELATED_IMAGE_PGO_BACKREST_REPO":         CONTAINER_IMAGE_PGO_BACKREST_REPO,
	"RELATED_IMAGE_PGO_CLIENT":                CONTAINER_IMAGE_PGO_CLIENT,
	"RELATED_IMAGE_PGO_RMDATA":                CONTAINER_IMAGE_PGO_RMDATA,
	"RELATED_IMAGE_CRUNCHY_POSTGRES_EXPORTER": CONTAINER_IMAGE_CRUNCHY_POSTGRES_EXPORTER,
	"RELATED_IMAGE_CRUNCHY_PGADMIN":           CONTAINER_IMAGE_CRUNCHY_PGADMIN,
	"RELATED_IMAGE_CRUNCHY_PGBADGER":          CONTAINER_IMAGE_CRUNCHY_PGBADGER,
	"RELATED_IMAGE_CRUNCHY_PGBOUNCER":         CONTAINER_IMAGE_CRUNCHY_PGBOUNCER,
	"RELATED_IMAGE_CRUNCHY_POSTGRES_HA":       CONTAINER_IMAGE_CRUNCHY_POSTGRES_HA,
	"RELATED_IMAGE_CRUNCHY_POSTGRES_GIS_HA":   CONTAINER_IMAGE_CRUNCHY_POSTGRES_GIS_HA,
}

a map of the "RELATED_IMAGE_*" environmental variables to their defined container image names, which allows certain packagers to inject the full definition for where to pull a container image from

See: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/contributors/design-proposals/related-images.md

View Source
var RmdatajobTemplate *template.Template
View Source
var ServiceTemplate *template.Template

Functions

func PostgreSQLWALPath

func PostgreSQLWALPath(cluster string) string

PostgreSQLWALPath returns the absolute path to a mounted WAL directory.

func PostgreSQLWALVolumeMount

func PostgreSQLWALVolumeMount() core_v1.VolumeMount

PostgreSQLWALVolumeMount returns the VolumeMount for the PostgreSQL WAL directory.

Types

type ClusterStruct

type ClusterStruct struct {
	CCPImagePrefix                 string
	CCPImageTag                    string
	Policies                       string
	Metrics                        bool
	Badger                         bool
	Port                           string
	PGBadgerPort                   string
	ExporterPort                   string
	User                           string
	Database                       string
	PasswordAgeDays                string
	PasswordLength                 string
	Replicas                       string
	ServiceType                    v1.ServiceType
	BackrestPort                   int
	BackrestGCSBucket              string
	BackrestGCSEndpoint            string
	BackrestGCSKeyType             string
	BackrestS3Bucket               string
	BackrestS3Endpoint             string
	BackrestS3Region               string
	BackrestS3URIStyle             string
	BackrestS3VerifyTLS            string
	DisableAutofail                bool
	DisableReplicaStartFailReinit  bool
	PodAntiAffinity                string
	PodAntiAffinityPgBackRest      string
	PodAntiAffinityPgBouncer       string
	SyncReplication                bool
	DefaultInstanceResourceMemory  resource.Quantity `json:"DefaultInstanceMemory"`
	DefaultBackrestResourceMemory  resource.Quantity `json:"DefaultBackrestMemory"`
	DefaultPgBouncerResourceMemory resource.Quantity `json:"DefaultPgBouncerMemory"`
	DefaultExporterResourceMemory  resource.Quantity `json:"DefaultExporterMemory"`
	DisableFSGroup                 *bool
}

type PgoConfig

type PgoConfig struct {
	BasicAuth       string
	Cluster         ClusterStruct
	Pgo             PgoStruct
	PrimaryStorage  string
	WALStorage      string
	BackupStorage   string
	ReplicaStorage  string
	BackrestStorage string
	PGAdminStorage  string
	Storage         map[string]StorageStruct
	OpenShift       bool
}

func (*PgoConfig) CheckEnv

func (c *PgoConfig) CheckEnv()

CheckEnv is mostly used for the OLM deployment use case when someone wants to deploy with OLM, use the baked-in configuration, but use a different set of images, by setting these env vars in the OLM CSV, users can override the baked in images

func (*PgoConfig) DefaultTemplate

func (c *PgoConfig) DefaultTemplate(path string) (string, error)

DefaultTemplate attempts to load a default configuration template file

func (*PgoConfig) DisableFSGroup

func (c *PgoConfig) DisableFSGroup() bool

HasDisableFSGroup returns either the value of DisableFSGroup if it is explicitly set; otherwise it will determine the value from the environment

func (*PgoConfig) GetConfig

func (c *PgoConfig) GetConfig(clientset kubernetes.Interface, namespace string) error

func (*PgoConfig) GetPodAntiAffinitySpec

func (c *PgoConfig) GetPodAntiAffinitySpec(cluster, pgBackRest, pgBouncer crv1.PodAntiAffinityType) (crv1.PodAntiAffinitySpec, error)

GetPodAntiAffinitySpec accepts possible user-defined values for what the pod anti-affinity spec should be, which include rules for: - PostgreSQL instances - pgBackRest - pgBouncer

func (*PgoConfig) GetStorageSpec

func (c *PgoConfig) GetStorageSpec(name string) (crv1.PgStorageSpec, error)

func (*PgoConfig) LoadTemplate

func (c *PgoConfig) LoadTemplate(cMap *v1.ConfigMap, path string) (*template.Template, error)

LoadTemplate will load a JSON template from a path

func (*PgoConfig) Validate

func (c *PgoConfig) Validate() error

type PgoStruct

type PgoStruct struct {
	Audit                          bool
	ConfigMapWorkerCount           *int
	ControllerGroupRefreshInterval *int
	DisableReconcileRBAC           bool
	NamespaceRefreshInterval       *int
	NamespaceWorkerCount           *int
	PGClusterWorkerCount           *int
	PerconaPGClusterWorkerCount    *int
	PGOImagePrefix                 string
	PGOImageTag                    string
	PGReplicaWorkerCount           *int
	PGTaskWorkerCount              *int
}

PgoStruct defines various configuration settings for the PostgreSQL Operator

type StorageStruct

type StorageStruct struct {
	AccessMode         string
	Size               string
	StorageType        string
	StorageClass       string
	SupplementalGroups string
	MatchLabels        string
}

Jump to

Keyboard shortcuts

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