Documentation
¶
Index ¶
- Variables
- type K8s
- type K8sImpl
- func (k *K8sImpl) CheckAllPodsAfterRestore() error
- func (k *K8sImpl) CheckDeployment(labelSelector, namespace string) (bool, error)
- func (k *K8sImpl) CheckPodStatus(podName, namespace, checkFlag string, timeout string, wg *sync.WaitGroup) error
- func (k *K8sImpl) ExecPod(pod *v1.Pod, container string, command []string) (string, string, error)
- func (k *K8sImpl) ExecRetry(pod *v1.Pod, container, timeout string, execCmd []string) error
- func (k *K8sImpl) GetBackup(veleroNamespace, backupName string) (*model.VeleroBackup, error)
- func (k *K8sImpl) GetBackupStorageLocation(veleroNamespace, bslName string) (*model.VeleroBackupStorageLocation, error)
- func (k *K8sImpl) GetObjectStoreCreds(secretName, namespace, secretKey string) (*model.ObjectStoreSecret, error)
- func (k *K8sImpl) IsPodReady(pod *v1.Pod) (bool, error)
- func (k *K8sImpl) PopulateConnData(veleroNamespace, backupName string) (*model.ConnectionData, error)
- func (k *K8sImpl) ScaleDeployment(labelSelector, namespace, deploymentName string, replicaCount int32) error
- func (k *K8sImpl) UpdateKeystore(connData *model.ConnectionData, timeout string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var NewPodExecutor = remotecommand.NewSPDYExecutor
NewPodExecutor is to be overridden during unit tests
Functions ¶
This section is empty.
Types ¶
type K8s ¶
type K8s interface { PopulateConnData(veleroNamespace, backupName string) (*model.ConnectionData, error) GetObjectStoreCreds(secretName, namespace, secretKey string) (*model.ObjectStoreSecret, error) GetBackup(veleroNamespace, backupName string) (*model.VeleroBackup, error) GetBackupStorageLocation(veleroNamespace, bslName string) (*model.VeleroBackupStorageLocation, error) ScaleDeployment(labelSelector, namespace, deploymentName string, replicaCount int32, log *zap.SugaredLogger) error CheckDeployment(labelSelector, namespace string) (bool, error) CheckPodStatus(podName, namespace, checkFlag string, timeout string, wg *sync.WaitGroup) error CheckAllPodsAfterRestore() error IsPodReady(pod *v1.Pod) (bool, error) ExecPod(cfg *rest.Config, pod *v1.Pod, container string, command []string) (string, string, error) UpdateKeystore(connData *model.ConnectionData, timeout string) (bool, error) ExecRetry(pod *v1.Pod, container, timeout string, execCmd []string) error }
type K8sImpl ¶
type K8sImpl struct { DynamicK8sInterface dynamic.Interface K8sClient client.Client K8sInterface kubernetes.Interface K8sConfig *rest.Config CredentialProfile string //default value `default` Log *zap.SugaredLogger }
func (*K8sImpl) CheckAllPodsAfterRestore ¶
CheckAllPodsAfterRestore checks presence of pods part of Opensearch cluster implementation after restore
func (*K8sImpl) CheckDeployment ¶
CheckDeployment checks the existence of a deployment in anamespace
func (*K8sImpl) CheckPodStatus ¶
func (k *K8sImpl) CheckPodStatus(podName, namespace, checkFlag string, timeout string, wg *sync.WaitGroup) error
CheckPodStatus checks the state of the pod depending on checkFlag
func (*K8sImpl) ExecPod ¶
ExecPod runs a remote command a pod, returning the stdout and stderr of the command.
func (*K8sImpl) GetBackup ¶
func (k *K8sImpl) GetBackup(veleroNamespace, backupName string) (*model.VeleroBackup, error)
GetBackup Retrieves Velero backup object from the cluster
func (*K8sImpl) GetBackupStorageLocation ¶
func (k *K8sImpl) GetBackupStorageLocation(veleroNamespace, bslName string) (*model.VeleroBackupStorageLocation, error)
GetBackupStorageLocation retrieves data from the Velero backup storage location
func (*K8sImpl) GetObjectStoreCreds ¶
func (k *K8sImpl) GetObjectStoreCreds(secretName, namespace, secretKey string) (*model.ObjectStoreSecret, error)
GetObjectStoreCreds fetches credentials from Velero Backup object store location. This object will be pre-created before the execution of this hook
func (*K8sImpl) IsPodReady ¶
IsPodReady checks whether pod is Ready
func (*K8sImpl) PopulateConnData ¶
func (k *K8sImpl) PopulateConnData(veleroNamespace, backupName string) (*model.ConnectionData, error)
PopulateConnData creates the connection object that's used to communicate to object store.
func (*K8sImpl) ScaleDeployment ¶
func (k *K8sImpl) ScaleDeployment(labelSelector, namespace, deploymentName string, replicaCount int32) error
ScaleDeployment is used to scale a deployment to specific replica count labelSelectors, namespace, deploymentName are used to identify deployments and specific pods associated with them.
func (*K8sImpl) UpdateKeystore ¶
UpdateKeystore Update Opensearch keystore with object store creds