Documentation ¶
Index ¶
- Constants
- Variables
- func AddDefaultPostgresHaConfigMap(clientset *kubernetes.Clientset, cluster *crv1.Pgcluster, ...) error
- func GetAffinity(nodeLabelKey, nodeLabelValue string, affoperator string) string
- func GetBadgerAddon(clientset *kubernetes.Clientset, namespace string, cluster *crv1.Pgcluster, ...) string
- func GetCollectAddon(clientset *kubernetes.Clientset, namespace string, spec *crv1.PgclusterSpec) string
- func GetCollectVolume(clientset *kubernetes.Clientset, cl *crv1.Pgcluster, namespace string) string
- func GetConfVolume(clientset *kubernetes.Clientset, cl *crv1.Pgcluster, namespace string) string
- func GetContainerResourcesJSON(resources *crv1.PgContainerResources) string
- func GetLabelsFromMap(labels map[string]string) string
- func GetPgbackrestEnvVars(backrestEnabled, clusterName, depName, port, storageType string) string
- func GetPgbackrestS3EnvVars(cluster crv1.Pgcluster, clientset *kubernetes.Clientset, ns string) string
- func GetPgmonitorEnvVars(metricsEnabled string) string
- func GetPodAntiAffinity(podAntiAffinityType string, clusterName string) string
- func GetReplicaAffinity(clusterLabels, replicaLabels map[string]string) string
- func GetRepoType(backrestStorageType string) string
- func GetSyncReplication(specSyncReplication *bool) bool
- func Initialize(clientset *kubernetes.Clientset)
- func IsLocalAndS3Storage(backrestStorageType string) bool
- func UpdatePghaDefaultConfigInitFlag(clientset *kubernetes.Clientset, initVal bool, clusterName, namespace string)
- type DeploymentTemplateFields
- type PgbackrestEnvVarsTemplateFields
- type PgbackrestS3EnvVarsTemplateFields
- type PgmonitorEnvVarsTemplateFields
- type PostgresHaTemplateFields
Constants ¶
const AFFINITY_NOTINOperator = "NotIn"
const AffinityInOperator = "In"
consolidate with cluster.affinityTemplateFields
const DefaultArchiveTimeout = "60"
const DefaultPgHaConfigMapSuffix = "pgha-default-config"
Variables ¶
var CRUNCHY_DEBUG bool
var EventTCPAddress = "localhost:4150"
var InstallationName string
var NAMESPACE string
var Pgo config.PgoConfig
var PgoNamespace string
Functions ¶
func AddDefaultPostgresHaConfigMap ¶
func AddDefaultPostgresHaConfigMap(clientset *kubernetes.Clientset, cluster *crv1.Pgcluster, isInit, createDefaultPghaConf bool, namespace string) error
Creates a configMap containing 'crunchy-postgres-ha' configuration settings. aA default crunchy-postgres-ha configuration file is included if a default config file is not providing using a custom configMap.
func GetAffinity ¶
GetAffinity ...
func GetBadgerAddon ¶
func GetCollectAddon ¶
func GetCollectAddon(clientset *kubernetes.Clientset, namespace string, spec *crv1.PgclusterSpec) string
func GetCollectVolume ¶
sets the proper collect secret in the deployment spec if collect is enabled
func GetConfVolume ¶
consolidate with cluster.GetConfVolume
func GetContainerResourcesJSON ¶
func GetContainerResourcesJSON(resources *crv1.PgContainerResources) string
GetContainerResources ...
func GetLabelsFromMap ¶
needs to be consolidated with cluster.GetLabelsFromMap GetLabelsFromMap ...
func GetPgbackrestEnvVars ¶
consolidate with cluster.GetPgbackrestEnvVars
func GetPgbackrestS3EnvVars ¶
func GetPgbackrestS3EnvVars(cluster crv1.Pgcluster, clientset *kubernetes.Clientset, ns string) string
GetPgbackrestS3EnvVars retrieves the values for the various configuration settings require to configure pgBackRest for AWS S3, inlcuding a bucket, endpoint, region, key and key secret. The bucket, endpoint & region are obtained from the associated parameters in the pgcluster CR, while the key and key secret are obtained from the backrest repository secret. Once these values have been obtained, they are used to populate a template containing the various pgBackRest environment variables required to enable S3 support. After the template has been executed with the proper values, the result is then returned a string for inclusion in the PG and pgBackRest deployments.
func GetPgmonitorEnvVars ¶
func GetPodAntiAffinity ¶
GetPodAntiAffinity returns the populated pod anti-affinity json that should be attached to the various pods comprising the pg cluster
func GetReplicaAffinity ¶
GetReplicaAffinity ... use NotIn as an operator when a node-label is not specified on the replica, use the node labels from the primary in this case use In as an operator when a node-label is specified on the replica use the node labels from the replica in this case
func GetRepoType ¶
GetRepoType returns the proper repo type to set in container based on the backrest storage type provided
func GetSyncReplication ¶
GetSyncReplication returns true if synchronous replication has been enabled using either the pgcluster CR specification or the pgo.yaml configuration file. Otherwise, if synchronous mode has not been enabled, it returns false.
func Initialize ¶
func Initialize(clientset *kubernetes.Clientset)
func IsLocalAndS3Storage ¶
IsLocalAndS3Storage a boolean indicating whether or not local and s3 storage should be enabled for pgBackRest based on the backrestStorageType string provided
func UpdatePghaDefaultConfigInitFlag ¶
func UpdatePghaDefaultConfigInitFlag(clientset *kubernetes.Clientset, initVal bool, clusterName, namespace string)
UpdatePghaDefaultConfigInitFlag sets the init value for the pgha config file to true or false depending on the vlaue provided
Types ¶
type DeploymentTemplateFields ¶
type DeploymentTemplateFields struct { Name string ClusterName string Port string CCPImagePrefix string CCPImageTag string CCPImage string Database string DeploymentLabels string PodLabels string DataPathOverride string ArchiveMode string ArchivePVCName string XLOGDir string BackrestPVCName string PVCName string RootSecretName string UserSecretName string PrimarySecretName string SecurityContext string ContainerResources string NodeSelector string ConfVolume string CollectAddon string CollectVolume string BadgerAddon string PgbackrestEnvVars string PgbackrestS3EnvVars string PgmonitorEnvVars string ScopeLabel string //next 2 are for the replica deployment only Replicas string PrimaryHost string // PgBouncer deployment only PgbouncerPass string IsInit bool EnableCrunchyadm bool ReplicaReinitOnStartFail bool PodAntiAffinity string SyncReplication bool }
needs to be consolidated with cluster.DeploymentTemplateFields DeploymentTemplateFields ...
type PgmonitorEnvVarsTemplateFields ¶
type PgmonitorEnvVarsTemplateFields struct {
PgmonitorPassword string
}
Directories ¶
Path | Synopsis |
---|---|
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
|
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment |