k8sutil

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8SOps added in v0.0.2

type K8SOps struct {
	// contains filtered or unexported fields
}

K8SOps is a kubernetes operations type which can be used to query and perform actions on a kubernetes cluster.

func NewK8SOps added in v0.0.2

func NewK8SOps(client kubernetes.Interface, logger logr.Logger) *K8SOps

NewK8SOps creates and returns a new k8sOps object.

func (K8SOps) EventRecorder added in v0.0.2

func (k K8SOps) EventRecorder() record.EventRecorder

EventRecorder creates and returns an EventRecorder which could be used to broadcast events for k8s objects.

func (K8SOps) GetDaemonSetPods added in v0.0.2

func (k K8SOps) GetDaemonSetPods(ds *appsv1.DaemonSet) (*corev1.PodList, error)

GetDaemonSetPods return PodList of all the pods that belong to a given DaemonSet.

func (K8SOps) GetDaemonSetsByLabel added in v0.0.2

func (k K8SOps) GetDaemonSetsByLabel(label string) (*appsv1.DaemonSetList, error)

GetDaemonSetsByLabel returns DaemonSets selected by the given label.

func (K8SOps) GetDeploymentsUsingStorageClassProvisioner added in v0.0.2

func (k K8SOps) GetDeploymentsUsingStorageClassProvisioner(provisionerName string) (*appsv1.DeploymentList, error)

GetDeploymentsUsingStorageClassProvisioner returns a DeploymentList that use a given StorageClass name in the PVC.

func (K8SOps) GetK8SVersion added in v0.0.2

func (k K8SOps) GetK8SVersion() (string, error)

GetK8SVersion queries and returns kubernetes server version in tri-dot format.

func (K8SOps) GetPodsByOwner added in v0.0.2

func (k K8SOps) GetPodsByOwner(ownerUID types.UID, namespace string) (*corev1.PodList, error)

GetPodsByOwner returns PodList of all the pods that are owned by the given ownerUID in the given namespace.

func (K8SOps) GetStatefulSetsUsingStorageClassProvisioner added in v0.0.2

func (k K8SOps) GetStatefulSetsUsingStorageClassProvisioner(provisionerName string) (*appsv1.StatefulSetList, error)

GetStatefulSetsUsingStorageClassProvisioner returns StatefulSets using PVC with a given provisioner.

func (K8SOps) GetStorageClassForPVC added in v0.0.2

func (k K8SOps) GetStorageClassForPVC(pvc *corev1.PersistentVolumeClaim) (*storagev1.StorageClass, error)

GetStorageClassForPVC returns storage class for a given PVC.

func (K8SOps) GetStorageOSApps added in v0.0.2

func (k K8SOps) GetStorageOSApps() (*appsv1.DeploymentList, *appsv1.StatefulSetList, error)

GetStorageOSApps returns a DeploymentList and a StatefulSetList of the apps using StorageOS PVC.

func (K8SOps) GetStorageOSDaemonSet added in v0.0.2

func (k K8SOps) GetStorageOSDaemonSet() (*appsv1.DaemonSet, error)

GetStorageOSDaemonSet returns a DaemonSet that runs storageos.

func (K8SOps) ScaleDownApps added in v0.0.2

func (k K8SOps) ScaleDownApps() error

ScaleDownApps fetches all the applications running storageos and scales down their replica count to zero.

func (K8SOps) ScaleUpApps added in v0.0.2

func (k K8SOps) ScaleUpApps() error

ScaleUpApps fetches all the applications running storageos and scales up their replica count to their previous values.

func (K8SOps) UpgradeDaemonSet added in v0.0.2

func (k K8SOps) UpgradeDaemonSet(newImage string) error

UpgradeDaemonSet upgrades the storageos daemonsets with a new container image. It blocks and waits checking the status of pods before exiting. Once all the pods are ready, it exits.

func (K8SOps) WaitForDaemonSetToBeReady added in v0.0.2

func (k K8SOps) WaitForDaemonSetToBeReady(name, namespace string) error

WaitForDaemonSetToBeReady checks a given DaemonSet to be available and ready.

Jump to

Keyboard shortcuts

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