Documentation ¶
Index ¶
- 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, *appsv1.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, error)
- func GetSecretPassword(clientset *kubernetes.Clientset, db, suffix, Namespace string) (string, error)
- func IsAutofailEnabled(cluster *crv1.Pgcluster) bool
- 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 UpdatePolicyLabels(clientset *kubernetes.Clientset, clusterName string, 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 ¶
This section is empty.
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, *appsv1.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 *appsv1.Deployment, namespace, databasePort string) (uint64, uint64, string, error)
func GetSecretPassword ¶
func GetSecretPassword(clientset *kubernetes.Clientset, db, suffix, Namespace string) (string, error)
GetSecretPassword ...
func IsAutofailEnabled ¶
IsAutofailEnabled - returns true if autofail label is set to true, false if not.
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 UpdatePolicyLabels ¶
func UpdatePolicyLabels(clientset *kubernetes.Clientset, clusterName string, namespace string, newLabels map[string]string) error
UpdatePolicyLabels ...
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)