Documentation ¶
Index ¶
- Constants
- func CopySecrets(clientset *kubernetes.Clientset, namespace string, ...) error
- func CreateBackrestPVCSnippet(backRestPVCName string) string
- func CreateBackupPVCSnippet(backupPVCName string) string
- func CreatePVCSnippet(storageType string, PVCName string) string
- func CreateSecContext(fsGroup string, suppGroup string) string
- func CreateSecret(clientset *kubernetes.Clientset, ...) error
- func CreateUserSecret(clientset *kubernetes.Clientset, ...) error
- func DrainDeployment(clientset *kubernetes.Clientset, name string, namespace string) error
- func ExecPolicy(clientset *kubernetes.Clientset, restclient *rest.RESTClient, namespace string, ...) error
- func GeneratePassword(length int) string
- func GenerateRandString(length int) string
- func GetBestTarget(clientset *kubernetes.Clientset, clusterName, namespace string) (*v1.Pod, *v1beta1.Deployment, error)
- func GetLabels(name, clustername string, replica bool) string
- func GetMD5HashForAuthFile(text string) string
- func GetPasswordFromSecret(clientset *kubernetes.Clientset, namespace string, secretName string) (string, string, error)
- func GetPod(clientset *kubernetes.Clientset, deploymentName, namespace string) (*v1.Pod, error)
- func GetPolicySQL(restclient *rest.RESTClient, namespace, policyName string) (string, error)
- func GetPreferredNodes(clientset *kubernetes.Clientset, selector, namespace string) ([]string, error)
- func GetRepStatus(restclient *rest.RESTClient, clientset *kubernetes.Clientset, ...) (uint64, uint64, string)
- func GetSecretPassword(clientset *kubernetes.Clientset, db, suffix, Namespace string) (string, error)
- func LoadTemplate(path string) *template.Template
- func NewClient(cfg *rest.Config) (*rest.RESTClient, *runtime.Scheme, error)
- func Patch(restclient *rest.RESTClient, path string, value string, resource string, ...) error
- func PatchClusterCRD(restclient *rest.RESTClient, labelMap map[string]string, ...) error
- func RandStringBytesRmndr(n int) string
- func RunPsql(password string, hostip string, sqlstring string) error
- func ScaleDeployment(clientset *kubernetes.Clientset, deploymentName, namespace string, ...) error
- func UpdateUserSecret(clientset *kubernetes.Clientset, ...) error
- func ValidatePolicy(restclient *rest.RESTClient, namespace string, policyName string) error
- func WaitUntilDeploymentIsDeleted(clientset *kubernetes.Clientset, depname string, timeout time.Duration, ...) error
- func WaitUntilPod(clientset *kubernetes.Clientset, lo meta_v1.ListOptions, podPhase v1.PodPhase, ...) error
- func WaitUntilPodIsDeleted(clientset *kubernetes.Clientset, podname string, timeout time.Duration, ...) error
- type ReplicationInfo
- type ThingSpec
Constants ¶
const GLOBAL_CUSTOM_CONFIGMAP = "pgo-custom-pg-config"
const LABEL_ARCHIVE = "archive"
const LABEL_ARCHIVE_TIMEOUT = "archive-timeout"
const LABEL_AUTOFAIL = "autofail"
const LABEL_AUTOFAIL_REPLACE_REPLICA = "autofail-replace-replica"
const LABEL_BACKREST = "pgo-backrest"
const LABEL_BACKREST_BACKUP_OPTS = "backrest-backup-opts"
const LABEL_BACKREST_COMMAND = "backrest-command"
const LABEL_BACKREST_JOB = "pgo-backrest-job"
const LABEL_BACKREST_OPTS = "backrest-opts"
const LABEL_BACKREST_PITR_TARGET = "backrest-pitr-target"
const LABEL_BACKREST_RESTORE = "pgo-backrest-restore"
const LABEL_BACKREST_RESTORE_FROM_CLUSTER = "backrest-restore-from-cluster"
const LABEL_BACKREST_RESTORE_OPTS = "backrest-restore-opts"
const LABEL_BACKREST_RESTORE_TO_PVC = "backrest-restore-to-pvc"
const LABEL_BACKUP_TYPE_BACKREST = "pgbackrest"
const LABEL_BACKUP_TYPE_BASEBACKUP = "pgbasebackup"
const LABEL_BACKUP_TYPE_PGDUMP = "pgdump"
const LABEL_BADGER = "crunchy-pgbadger"
const LABEL_CCP_IMAGE_KEY = "ccp-image"
const LABEL_CCP_IMAGE_TAG_KEY = "ccp-image-tag"
const LABEL_CLAIM_NAME = "claimName"
const LABEL_COLLECT = "crunchy_collect"
const LABEL_CONTAINER_NAME = "containername"
const LABEL_CURRENT_PRIMARY = "current-primary"
const LABEL_CUSTOM_CONFIG = "custom-config"
const LABEL_DATA_ROOT = "data-root"
const LABEL_DELETE_DATA = "delete-data"
const LABEL_DELETE_DATA_STARTED = "delete-data-started"
const LABEL_DEPLOYMENT_NAME = "deployment-name"
const LABEL_FAILOVER = "failover"
const LABEL_FAILOVER_STARTED = "failover-started"
const LABEL_FALSE = "false"
const LABEL_INGEST = "ingest"
const LABEL_JOB_NAME = "job-name"
const LABEL_NAME = "name"
resource labels used by the operator
const LABEL_NAMESPACE = "namespace"
const LABEL_NODE_LABEL = "node-label"
const LABEL_NODE_LABEL_KEY = "NodeLabelKey"
const LABEL_NODE_LABEL_VALUE = "NodeLabelValue"
const LABEL_OPERATOR = "postgres-operator"
const LABEL_PASSWORD = "password"
const LABEL_PGBACKREST_DB_PATH = "pgbackrest-db-path"
const LABEL_PGBACKREST_REPO_HOST = "pgbackrest-repo-host"
const LABEL_PGBACKREST_REPO_PATH = "pgbackrest-repo-path"
const LABEL_PGBACKREST_STANZA = "pgbackrest-stanza"
const LABEL_PGBACKUP = "pgbackup"
const LABEL_PGBOUNCER = "crunchy-pgbouncer"
const LABEL_PGBOUNCER_PASS = "pgbouncer-password"
const LABEL_PGBOUNCER_SECRET = "pgbouncer-secret"
const LABEL_PGBOUNCER_TASK_ADD = "pgbouncer-add"
const LABEL_PGBOUNCER_TASK_CLUSTER = "pgbouncer-cluster"
const LABEL_PGBOUNCER_TASK_DELETE = "pgbouncer-delete"
const LABEL_PGBOUNCER_TASK_RECONFIGURE = "pgbouncer-reconfigure"
const LABEL_PGBOUNCER_USER = "pgbouncer-user"
const LABEL_PGDUMP_ALL = "pgdump-all"
const LABEL_PGDUMP_COMMAND = "pgdump"
const LABEL_PGDUMP_DB = "pgdump-db"
const LABEL_PGDUMP_HOST = "pgdump-host"
const LABEL_PGDUMP_OPTS = "pgdump-opts"
const LABEL_PGDUMP_PORT = "pgdump-port"
const LABEL_PGDUMP_PVC = "pgdump-pvc"
const LABEL_PGDUMP_RESTORE = "pgdump-restore"
const LABEL_PGDUMP_USER = "pgdump-user"
const LABEL_PGO_BACKREST_REPO = "pgo-backrest-repo"
const LABEL_PGO_BENCHMARK = "pgo-benchmark"
const LABEL_PGO_VERSION = "pgo-version"
const LABEL_PGPOLICY = "pgpolicy"
const LABEL_PGPOOL = "crunchy-pgpool"
const LABEL_PGPOOL_SECRET = "pgpool-secret"
const LABEL_PGPOOL_TASK_ADD = "pgpool-add"
const LABEL_PGPOOL_TASK_CLUSTER = "pgpool-cluster"
const LABEL_PGPOOL_TASK_DELETE = "pgpool-delete"
const LABEL_PGPOOL_TASK_RECONFIGURE = "pgpool-reconfigure"
const LABEL_PGREMOVE = "pgremove"
const LABEL_PGRESTORE_COMMAND = "pgrestore"
const LABEL_PGRESTORE_DB = "pgrestore-db"
const LABEL_PGRESTORE_FROM_CLUSTER = "pgrestore-from-cluster"
const LABEL_PGRESTORE_FROM_PVC = "pgrestore-from-pvc"
const LABEL_PGRESTORE_HOST = "pgrestore-host"
const LABEL_PGRESTORE_OPTS = "pgrestore-opts"
const LABEL_PGRESTORE_PITR_TARGET = "pgrestore-pitr-target"
const LABEL_PGRESTORE_PORT = "pgrestore-port"
const LABEL_PGRESTORE_USER = "pgrestore-user"
const LABEL_PGTASK = "pg-task"
const LABEL_PG_CLUSTER = "pg-cluster"
const LABEL_PG_CLUSTER_IDENTIFIER = "pg-cluster-id"
const LABEL_PG_DATABASE = "pg-database"
const LABEL_POD_NAME = "podname"
const LABEL_PRIMARY = "primary"
const LABEL_PVCNAME = "pvcname"
const LABEL_PVC_NAME = "pvc-name"
const LABEL_REPLICA_COUNT = "replica-count"
const LABEL_REPLICA_NAME = "replica-name"
const LABEL_RESOURCES_CONFIG = "resources-config"
const LABEL_RESTORE_TYPE_PGRESTORE = "pgrestore"
const LABEL_RMDATA = "pgrmdata"
const LABEL_SELECTOR = "selector"
const LABEL_SERVICE_NAME = "service-name"
const LABEL_SERVICE_TYPE = "service-type"
const LABEL_SESSION_ID = "sessionid"
const LABEL_STORAGE_CONFIG = "storage-config"
const LABEL_TARGET = "target"
const LABEL_TRUE = "true"
const LABEL_UPGRADE_DATE = "operator-upgrade-date"
const LABEL_USERNAME = "username"
const LABEL_VERSION = "version"
const LABEL_VOLUME_NAME = "volume-name"
Variables ¶
This section is empty.
Functions ¶
func CopySecrets ¶
func CopySecrets(clientset *kubernetes.Clientset, namespace string, fromCluster, toCluster string) error
CopySecrets will copy a secret to another secret
func CreateBackrestPVCSnippet ¶
CreateBackrestPVCSnippet
func CreateBackupPVCSnippet ¶
CreateBackupPVCSnippet generates the PVC definition fragment
func CreatePVCSnippet ¶
CreatePVCSnippet generates the PVC json snippet
func CreateSecContext ¶
CreateSecContext will generate the JSON security context fragment for a storage type
func CreateSecret ¶
func CreateSecret(clientset *kubernetes.Clientset, db, secretName, username, password, namespace string) error
CreateSecret create the secret, user, and primary secrets
func CreateUserSecret ¶
func CreateUserSecret(clientset *kubernetes.Clientset, clustername, username, password, namespace string, passwordLength int) error
CreateUserSecret will create a new secret holding a user credential
func DrainDeployment ¶
func DrainDeployment(clientset *kubernetes.Clientset, name string, namespace string) error
DrainDeployment will drain a deployment to 0 pods
func ExecPolicy ¶
func ExecPolicy(clientset *kubernetes.Clientset, restclient *rest.RESTClient, namespace string, policyName string, clusterName string) error
ExecPolicy execute a sql policy against a cluster
func GeneratePassword ¶
GeneratePassword generate a password of a given length
func GenerateRandString ¶
GenerateRandString generate a rand lowercase string of a given length
func GetBestTarget ¶
func GetBestTarget(clientset *kubernetes.Clientset, clusterName, namespace string) (*v1.Pod, *v1beta1.Deployment, error)
GetBestTarget
func GetPasswordFromSecret ¶
func GetPasswordFromSecret(clientset *kubernetes.Clientset, namespace string, secretName string) (string, string, error)
GetPasswordFromSecret will fetch the username, password from a user secret
func GetPolicySQL ¶
func GetPolicySQL(restclient *rest.RESTClient, namespace, policyName string) (string, error)
GetPolicySQL returns the SQL string from a policy
func GetPreferredNodes ¶
func GetPreferredNodes(clientset *kubernetes.Clientset, selector, namespace string) ([]string, error)
func GetRepStatus ¶
func GetRepStatus(restclient *rest.RESTClient, clientset *kubernetes.Clientset, dep *v1beta1.Deployment, namespace, databasePort string) (uint64, uint64, string)
func GetSecretPassword ¶
func GetSecretPassword(clientset *kubernetes.Clientset, db, suffix, Namespace string) (string, error)
GetSecretPassword ...
func LoadTemplate ¶
LoadTemplate will load a JSON template from a path
func Patch ¶
func Patch(restclient *rest.RESTClient, path string, value string, resource string, name string, namespace string) error
Patch will patch a particular resource
func PatchClusterCRD ¶
func PatchClusterCRD(restclient *rest.RESTClient, labelMap map[string]string, oldCrd *crv1.Pgcluster, namespace string) error
PatchClusterCRD patches the pgcluster CRD
func ScaleDeployment ¶
func ScaleDeployment(clientset *kubernetes.Clientset, deploymentName, namespace string, replicaCount int) error
ScaleDeployment will increase the number of pods in a deployment
func UpdateUserSecret ¶
func UpdateUserSecret(clientset *kubernetes.Clientset, clustername, username, password, namespace string, passwordLength int) error
UpdateUserSecret updates a user secret with a new password
func ValidatePolicy ¶
func ValidatePolicy(restclient *rest.RESTClient, namespace string, policyName string) error
ValidatePolicy tests to see if a policy exists
func WaitUntilDeploymentIsDeleted ¶
func WaitUntilDeploymentIsDeleted(clientset *kubernetes.Clientset, depname string, timeout time.Duration, namespace string) error
WaitUntilDeploymentIsDeleted timeout := time.Minute
func WaitUntilPod ¶
func WaitUntilPod(clientset *kubernetes.Clientset, lo meta_v1.ListOptions, podPhase v1.PodPhase, timeout time.Duration, namespace string) error
WaitUntilPod ... podPhase is v1.PodRunning timeout := time.Minute
func WaitUntilPodIsDeleted ¶
func WaitUntilPodIsDeleted(clientset *kubernetes.Clientset, podname string, timeout time.Duration, namespace string) error
WaitUntilPodIsDeleted timeout := time.Minute
Types ¶
type ReplicationInfo ¶
type ReplicationInfo struct { ReceiveLocation uint64 ReplayLocation uint64 Node string DeploymentName string }
func GetReplicationInfo ¶
func GetReplicationInfo(target string) (*ReplicationInfo, error)