config

package
v4.1.1-rc2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CONFIG_PATH = "pgo.yaml"
View Source
const CustomConfigMapName = "pgo-config"
View Source
const CustomConfigsPath = "/pgo-config/"
View Source
const DEFAULT_AUTOFAIL_SLEEP_SECONDS = "30"
View Source
const DEFAULT_BACKREST_PORT = 2022
View Source
const DEFAULT_BACKREST_SSH_KEY_BITS = 2048
View Source
const DEFAULT_EXPORTER_PORT = "9187"
View Source
const DEFAULT_LOG_MIN_DURATION_STATEMENT = "60000"
View Source
const DEFAULT_LOG_STATEMENT = "none"
View Source
const DEFAULT_PGBADGER_PORT = "10000"
View Source
const DEFAULT_POSTGRES_PORT = "5432"
View Source
const DEFAULT_SERVICE_TYPE = "ClusterIP"
View Source
const DefaultConfigsPath = "/default-pgo-config/"
View Source
const GLOBAL_CUSTOM_CONFIGMAP = "pgo-custom-pg-config"
View Source
const LABEL_ARCHIVE = "archive"
View Source
const LABEL_ARCHIVE_TIMEOUT = "archive-timeout"
View Source
const LABEL_AUTOFAIL = "autofail"
View Source
const LABEL_AUTOFAIL_REPLACE_REPLICA = "autofail-replace-replica"
View Source
const LABEL_BACKREST = "pgo-backrest"
View Source
const LABEL_BACKREST_BACKUP_OPTS = "backrest-backup-opts"
View Source
const LABEL_BACKREST_COMMAND = "backrest-command"
View Source
const LABEL_BACKREST_JOB = "pgo-backrest-job"
View Source
const LABEL_BACKREST_OPTS = "backrest-opts"
View Source
const LABEL_BACKREST_PITR_TARGET = "backrest-pitr-target"
View Source
const LABEL_BACKREST_REPO_SECRET = "backrest-repo-config"
View Source
const LABEL_BACKREST_RESTORE = "pgo-backrest-restore"
View Source
const LABEL_BACKREST_RESTORE_FROM_CLUSTER = "backrest-restore-from-cluster"
View Source
const LABEL_BACKREST_RESTORE_OPTS = "backrest-restore-opts"
View Source
const LABEL_BACKREST_RESTORE_TO_PVC = "backrest-restore-to-pvc"
View Source
const LABEL_BACKREST_STORAGE_TYPE = "backrest-storage-type"
View Source
const LABEL_BACKUP_TYPE_BACKREST = "pgbackrest"
View Source
const LABEL_BACKUP_TYPE_BASEBACKUP = "pgbasebackup"
View Source
const LABEL_BACKUP_TYPE_PGDUMP = "pgdump"
View Source
const LABEL_BADGER = "crunchy-pgbadger"
View Source
const LABEL_BADGER_CCPIMAGE = "crunchy-pgbadger"
View Source
const LABEL_CCP_IMAGE_KEY = "ccp-image"
View Source
const LABEL_CCP_IMAGE_TAG_KEY = "ccp-image-tag"
View Source
const LABEL_CLAIM_NAME = "claimName"
View Source
const LABEL_COLLECT = "crunchy_collect"
View Source
const LABEL_COLLECT_CCPIMAGE = "crunchy-collect"
View Source
const LABEL_COLLECT_PG_USER = "ccp_monitoring"
View Source
const LABEL_CONTAINER_NAME = "containername"
View Source
const LABEL_CRUNCHY = "crunchydata"
View Source
const LABEL_CURRENT_PRIMARY = "current-primary"
View Source
const LABEL_CUSTOM_CONFIG = "custom-config"
View Source
const LABEL_DATA_ROOT = "data-root"
View Source
const LABEL_DELETE_BACKUPS = "delete-backups"
View Source
const LABEL_DELETE_DATA = "delete-data"
View Source
const LABEL_DELETE_DATA_STARTED = "delete-data-started"
View Source
const LABEL_DEPLOYMENT_NAME = "deployment-name"
View Source
const LABEL_FAILOVER = "failover"
View Source
const LABEL_FAILOVER_STARTED = "failover-started"
View Source
const LABEL_FALSE = "false"
View Source
const LABEL_INGEST = "ingest"
View Source
const LABEL_IS_BACKUP = "is-backup"
View Source
const LABEL_IS_REPLICA = "is-replica"
View Source
const LABEL_JOB_NAME = "job-name"
View Source
const LABEL_MINOR_UPGRADE = "minor-upgrade"
View Source
const LABEL_NAME = "name"

resource labels used by the operator

View Source
const LABEL_NAMESPACE = "namespace"
View Source
const LABEL_NODE_LABEL = "node-label"
View Source
const LABEL_NODE_LABEL_KEY = "NodeLabelKey"
View Source
const LABEL_NODE_LABEL_VALUE = "NodeLabelValue"
View Source
const LABEL_OPERATOR = "postgres-operator"
View Source
const LABEL_PASSWORD = "password"
View Source
const LABEL_PGBACKREST_DB_PATH = "pgbackrest-db-path"
View Source
const LABEL_PGBACKREST_REPO_HOST = "pgbackrest-repo-host"
View Source
const LABEL_PGBACKREST_REPO_PATH = "pgbackrest-repo-path"
View Source
const LABEL_PGBACKREST_STANZA = "pgbackrest-stanza"
View Source
const LABEL_PGBACKUP = "pgbackup"
View Source
const LABEL_PGBASEBACKUP_RESTORE = "pgo-pgbasebackup-restore"
View Source
const LABEL_PGBASEBACKUP_RESTORE_BACKUP_PATH = "pgbasebackup-restore-backup-path"
View Source
const LABEL_PGBASEBACKUP_RESTORE_FROM_CLUSTER = "pgbasebackup-restore-from-cluster"
View Source
const LABEL_PGBASEBACKUP_RESTORE_FROM_PVC = "pgbasebackup-restore-from-pvc"
View Source
const LABEL_PGBASEBACKUP_RESTORE_TO_PVC = "pgbasebackup-restore-to-pvc"
View Source
const LABEL_PGBOUNCER = "crunchy-pgbouncer"
View Source
const LABEL_PGBOUNCER_PASS = "pgbouncer-password"
View Source
const LABEL_PGBOUNCER_SECRET = "pgbouncer-secret"
View Source
const LABEL_PGBOUNCER_TASK_ADD = "pgbouncer-add"
View Source
const LABEL_PGBOUNCER_TASK_CLUSTER = "pgbouncer-cluster"
View Source
const LABEL_PGBOUNCER_TASK_DELETE = "pgbouncer-delete"
View Source
const LABEL_PGBOUNCER_TASK_RECONFIGURE = "pgbouncer-reconfigure"
View Source
const LABEL_PGBOUNCER_USER = "pgbouncer-user"
View Source
const LABEL_PGDUMP_ALL = "pgdump-all"
View Source
const LABEL_PGDUMP_COMMAND = "pgdump"
View Source
const LABEL_PGDUMP_DB = "pgdump-db"
View Source
const LABEL_PGDUMP_HOST = "pgdump-host"
View Source
const LABEL_PGDUMP_OPTS = "pgdump-opts"
View Source
const LABEL_PGDUMP_PORT = "pgdump-port"
View Source
const LABEL_PGDUMP_PVC = "pgdump-pvc"
View Source
const LABEL_PGDUMP_RESTORE = "pgdump-restore"
View Source
const LABEL_PGDUMP_USER = "pgdump-user"
View Source
const LABEL_PGOUSER = "pgouser"
View Source
const LABEL_PGO_BACKREST_REPO = "pgo-backrest-repo"
View Source
const LABEL_PGO_BENCHMARK = "pgo-benchmark"
View Source
const LABEL_PGO_CREATED_BY = "pgo-created-by"
View Source
const LABEL_PGO_DEFAULT_SC = "pgo-default-sc"
View Source
const LABEL_PGO_INSTALLATION_NAME = "pgo-installation-name"
View Source
const LABEL_PGO_LOAD = "pgo-load"
View Source
const LABEL_PGO_PGOROLE = "pgo-pgorole"
View Source
const LABEL_PGO_PGOUSER = "pgo-pgouser"
View Source
const LABEL_PGO_UPDATED_BY = "pgo-updated-by"
View Source
const LABEL_PGO_VERSION = "pgo-version"
View Source
const LABEL_PGPOLICY = "pgpolicy"
View Source
const LABEL_PGPOOL = "crunchy-pgpool"
View Source
const LABEL_PGPOOL_POD = "crunchy-pgpool-pod"
View Source
const LABEL_PGPOOL_SECRET = "pgpool-secret"
View Source
const LABEL_PGPOOL_TASK_ADD = "pgpool-add"
View Source
const LABEL_PGPOOL_TASK_CLUSTER = "pgpool-cluster"
View Source
const LABEL_PGPOOL_TASK_DELETE = "pgpool-delete"
View Source
const LABEL_PGPOOL_TASK_RECONFIGURE = "pgpool-reconfigure"
View Source
const LABEL_PGREMOVE = "pgremove"
View Source
const LABEL_PGRESTORE_COMMAND = "pgrestore"
View Source
const LABEL_PGRESTORE_DB = "pgrestore-db"
View Source
const LABEL_PGRESTORE_FROM_CLUSTER = "pgrestore-from-cluster"
View Source
const LABEL_PGRESTORE_FROM_PVC = "pgrestore-from-pvc"
View Source
const LABEL_PGRESTORE_HOST = "pgrestore-host"
View Source
const LABEL_PGRESTORE_OPTS = "pgrestore-opts"
View Source
const LABEL_PGRESTORE_PITR_TARGET = "pgrestore-pitr-target"
View Source
const LABEL_PGRESTORE_PORT = "pgrestore-port"
View Source
const LABEL_PGRESTORE_USER = "pgrestore-user"
View Source
const LABEL_PGTASK = "pg-task"
View Source
const LABEL_PG_CLUSTER = "pg-cluster"
View Source
const LABEL_PG_CLUSTER_IDENTIFIER = "pg-cluster-id"
View Source
const LABEL_POD_NAME = "podname"
View Source
const LABEL_PVCNAME = "pvcname"
View Source
const LABEL_PVC_NAME = "pvc-name"
View Source
const LABEL_REPLICA_COUNT = "replica-count"
View Source
const LABEL_REPLICA_NAME = "replica-name"
View Source
const LABEL_RESOURCES_CONFIG = "resources-config"
View Source
const LABEL_RESTORE_TYPE_PGRESTORE = "pgrestore"
View Source
const LABEL_RMDATA = "pgrmdata"
View Source
const LABEL_ROLENAME = "rolename"
View Source
const LABEL_SELECTOR = "selector"
View Source
const LABEL_SERVICE_NAME = "service-name"
View Source
const LABEL_SERVICE_TYPE = "service-type"
View Source
const LABEL_SESSION_ID = "sessionid"
View Source
const LABEL_STORAGE_CONFIG = "storage-config"
View Source
const LABEL_TARGET = "target"
View Source
const LABEL_TRUE = "true"
View Source
const LABEL_UPGRADE_BACKREST = "upgrade-backrest"
View Source
const LABEL_UPGRADE_COMPLETED = "upgrade-complete"
View Source
const LABEL_UPGRADE_DATE = "operator-upgrade-date"
View Source
const LABEL_UPGRADE_IN_PROGRESS = "upgrade-in-progress"
View Source
const LABEL_UPGRADE_PRIMARY = "upgrade-primary"
View Source
const LABEL_UPGRADE_REPLICA = "upgrade-replicas"
View Source
const LABEL_USERNAME = "username"
View Source
const LABEL_VENDOR = "vendor"
View Source
const LABEL_VERSION = "version"
View Source
const LABEL_VOLUME_NAME = "volume-name"
View Source
const LABEL_WORKFLOW_ID = "workflow-id"
View Source
const LOAD_BALANCER_SERVICE_TYPE = "LoadBalancer"
View Source
const NODEPORT_SERVICE_TYPE = "NodePort"
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 PGOTargetRoleBindingPath = "pgo-target-role-binding.json"
View Source
const PGOTargetRolePath = "pgo-target-role.json"
View Source
const PGOTargetServiceAccountPath = "pgo-target-sa.json"

Variables

View Source
var AffinityTemplate *template.Template
View Source
var BackrestRestorejobTemplate *template.Template
View Source
var BackrestjobTemplate *template.Template
View Source
var BadgerTemplate *template.Template
View Source
var BenchmarkJobTemplate *template.Template
View Source
var CollectTemplate *template.Template
View Source
var ContainerResourcesTemplate *template.Template
View Source
var DeploymentTemplate *template.Template
View Source
var JobTemplate *template.Template
View Source
var LoadTemplate *template.Template
View Source
var LspvcTemplate *template.Template
View Source
var PVCMatchLabelsTemplate *template.Template
View Source
var PVCStorageClassTemplate *template.Template
View Source
var PVCTemplate *template.Template
View Source
var PgBasebackupRestoreJobTemplate *template.Template
View Source
var PgDumpBackupJobTemplate *template.Template
View Source
var PgRestoreJobTemplate *template.Template
View Source
var PgbackrestEnvVarsTemplate *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 PgoTargetRoleBindingTemplate *template.Template
View Source
var PgoTargetRoleTemplate *template.Template
View Source
var PgoTargetServiceAccountTemplate *template.Template
View Source
var PgpoolConfTemplate *template.Template
View Source
var PgpoolHBATemplate *template.Template
View Source
var PgpoolPasswdTemplate *template.Template
View Source
var PgpoolTemplate *template.Template
View Source
var PolicyJobTemplate *template.Template
View Source
var RmdatajobTemplate *template.Template
View Source
var ServiceTemplate *template.Template

Functions

This section is empty.

Types

type ClusterStruct

type ClusterStruct struct {
	CCPImagePrefix          string `yaml:"CCPImagePrefix"`
	CCPImageTag             string `yaml:"CCPImageTag"`
	PrimaryNodeLabel        string `yaml:"PrimaryNodeLabel"`
	ReplicaNodeLabel        string `yaml:"ReplicaNodeLabel"`
	Policies                string `yaml:"Policies"`
	LogStatement            string `yaml:"LogStatement"`
	LogMinDurationStatement string `yaml:"LogMinDurationStatement"`
	Metrics                 bool   `yaml:"Metrics"`
	Badger                  bool   `yaml:"Badger"`
	Port                    string `yaml:"Port"`
	PGBadgerPort            string `yaml:"PGBadgerPort"`
	ExporterPort            string `yaml:"ExporterPort"`
	User                    string `yaml:"User"`
	ArchiveTimeout          string `yaml:"ArchiveTimeout"`
	Database                string `yaml:"Database"`
	PasswordAgeDays         string `yaml:"PasswordAgeDays"`
	PasswordLength          string `yaml:"PasswordLength"`
	Strategy                string `yaml:"Strategy"`
	Replicas                string `yaml:"Replicas"`
	ServiceType             string `yaml:"ServiceType"`
	BackrestPort            int    `yaml:"BackrestPort"`
	Backrest                bool   `yaml:"Backrest"`
	BackrestS3Bucket        string `yaml:"BackrestS3Bucket"`
	BackrestS3Endpoint      string `yaml:"BackrestS3Endpoint"`
	BackrestS3Region        string `yaml:"BackrestS3Region"`
	Autofail                bool   `yaml:"Autofail"`
	AutofailReplaceReplica  bool   `yaml:"AutofailReplaceReplica"`
	PgmonitorPassword       string `yaml:"PgmonitorPassword"`
}

type ContainerResourcesStruct

type ContainerResourcesStruct struct {
	RequestsMemory string `yaml:"RequestsMemory"`
	RequestsCPU    string `yaml:"RequestsCPU"`
	LimitsMemory   string `yaml:"LimitsMemory"`
	LimitsCPU      string `yaml:"LimitsCPU"`
}

type PgoConfig

type PgoConfig struct {
	BasicAuth                 string                              `yaml:"BasicAuth"`
	Cluster                   ClusterStruct                       `yaml:"Cluster"`
	Pgo                       PgoStruct                           `yaml:"Pgo"`
	ContainerResources        map[string]ContainerResourcesStruct `yaml:"ContainerResources"`
	PrimaryStorage            string                              `yaml:"PrimaryStorage"`
	BackupStorage             string                              `yaml:"BackupStorage"`
	ReplicaStorage            string                              `yaml:"ReplicaStorage"`
	BackrestStorage           string                              `yaml:"BackrestStorage"`
	Storage                   map[string]StorageStruct            `yaml:"Storage"`
	DefaultContainerResources string                              `yaml:"DefaultContainerResources"`
	DefaultLoadResources      string                              `yaml:"DefaultLoadResources"`
	DefaultLspvcResources     string                              `yaml:"DefaultLspvcResources"`
	DefaultRmdataResources    string                              `yaml:"DefaultRmdataResources"`
	DefaultBackupResources    string                              `yaml:"DefaultBackupResources"`
	DefaultBadgerResources    string                              `yaml:"DefaultBadgerResources"`
	DefaultPgpoolResources    string                              `yaml:"DefaultPgpoolResources"`
	DefaultPgbouncerResources string                              `yaml:"DefaultPgbouncerResources"`
}

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) GetConf

func (c *PgoConfig) GetConf() *PgoConfig

func (*PgoConfig) GetConfig

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

func (*PgoConfig) GetContainerResource

func (c *PgoConfig) GetContainerResource(name string) (crv1.PgContainerResources, error)

func (*PgoConfig) GetStorageSpec

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

func (*PgoConfig) LoadTemplate

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

LoadTemplate will load a JSON template from a path

func (*PgoConfig) SetDefaultStorageClass

func (c *PgoConfig) SetDefaultStorageClass(clientset *kubernetes.Clientset) error

func (*PgoConfig) Validate

func (c *PgoConfig) Validate() error

type PgoStruct

type PgoStruct struct {
	PreferredFailoverNode     string `yaml:"PreferredFailoverNode"`
	AutofailSleepSeconds      string `yaml:"AutofailSleepSeconds"`
	AutofailSleepSecondsValue int
	Audit                     bool   `yaml:"Audit"`
	PGOImagePrefix            string `yaml:"PGOImagePrefix"`
	PGOImageTag               string `yaml:"PGOImageTag"`
}

type StorageStruct

type StorageStruct struct {
	AccessMode         string `yaml:"AccessMode"`
	Size               string `yaml:"Size"`
	StorageType        string `yaml:"StorageType"`
	StorageClass       string `yaml:"StorageClass"`
	Fsgroup            string `yaml:"Fsgroup"`
	SupplementalGroups string `yaml:"SupplementalGroups"`
	MatchLabels        string `yaml:"MatchLabels"`
}

Jump to

Keyboard shortcuts

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