Documentation ¶
Index ¶
- func SetInstance(i Ops)
- type Client
- func (c *Client) CreateDaemonSet(ds *appsv1.DaemonSet) (*appsv1.DaemonSet, error)
- func (c *Client) CreateDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error)
- func (c *Client) CreateReplicaSet(rs *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error)
- func (c *Client) CreateStatefulSet(statefulset *appsv1.StatefulSet) (*appsv1.StatefulSet, error)
- func (c *Client) DeleteDaemonSet(name, namespace string) error
- func (c *Client) DeleteDeployment(name, namespace string) error
- func (c *Client) DeleteReplicaSet(name, namespace string) error
- func (c *Client) DeleteStatefulSet(name, namespace string) error
- func (c *Client) DescribeDeployment(depName, depNamespace string) (*appsv1.DeploymentStatus, error)
- func (c *Client) DescribeStatefulSet(ssetName string, ssetNamespace string) (*appsv1.StatefulSetStatus, error)
- func (c *Client) GetDaemonSet(name, namespace string) (*appsv1.DaemonSet, error)
- func (c *Client) GetDaemonSetPods(ds *appsv1.DaemonSet) ([]corev1.Pod, error)
- func (c *Client) GetDeployment(name, namespace string) (*appsv1.Deployment, error)
- func (c *Client) GetDeploymentPods(deployment *appsv1.Deployment) ([]corev1.Pod, error)
- func (c *Client) GetDeploymentsUsingStorageClass(scName string) ([]appsv1.Deployment, error)
- func (c *Client) GetPVCsForStatefulSet(ss *appsv1.StatefulSet) (*corev1.PersistentVolumeClaimList, error)
- func (c *Client) GetReplicaSet(name, namespace string) (*appsv1.ReplicaSet, error)
- func (c *Client) GetReplicaSetByDeployment(deployment *appsv1.Deployment) (*appsv1.ReplicaSet, error)
- func (c *Client) GetReplicaSetPods(rs *appsv1.ReplicaSet) ([]corev1.Pod, error)
- func (c *Client) GetStatefulSet(name, namespace string) (*appsv1.StatefulSet, error)
- func (c *Client) GetStatefulSetPods(statefulset *appsv1.StatefulSet) ([]corev1.Pod, error)
- func (c *Client) GetStatefulSetsUsingStorageClass(scName string) ([]appsv1.StatefulSet, error)
- func (c *Client) ListDaemonSets(namespace string, listOpts metav1.ListOptions) ([]appsv1.DaemonSet, error)
- func (c *Client) ListDeployments(namespace string, options metav1.ListOptions) (*appsv1.DeploymentList, error)
- func (c *Client) ListReplicaSets(namespace string, listOpts metav1.ListOptions) ([]appsv1.ReplicaSet, error)
- func (c *Client) ListStatefulSets(namespace string) (*appsv1.StatefulSetList, error)
- func (c *Client) SetConfig(cfg *rest.Config)
- func (c *Client) UpdateDaemonSet(ds *appsv1.DaemonSet) (*appsv1.DaemonSet, error)
- func (c *Client) UpdateDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error)
- func (c *Client) UpdateReplicaSet(rs *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error)
- func (c *Client) UpdateStatefulSet(statefulset *appsv1.StatefulSet) (*appsv1.StatefulSet, error)
- func (c *Client) ValidateDaemonSet(name, namespace string, timeout time.Duration) error
- func (c *Client) ValidateDeployment(deployment *appsv1.Deployment, timeout, retryInterval time.Duration) error
- func (c *Client) ValidatePVCsForStatefulSet(ss *appsv1.StatefulSet, timeout, retryTimeout time.Duration) error
- func (c *Client) ValidateReplicaSet(name, namespace string, timeout time.Duration) error
- func (c *Client) ValidateStatefulSet(statefulset *appsv1.StatefulSet, timeout time.Duration) error
- func (c *Client) ValidateTerminatedDeployment(deployment *appsv1.Deployment, timeout, timeBeforeRetry time.Duration) error
- func (c *Client) ValidateTerminatedStatefulSet(statefulset *appsv1.StatefulSet, timeout, timeBeforeRetry time.Duration) error
- type DaemonSetOps
- type DeploymentOps
- type Ops
- type ReplicaSetOps
- type StatefulSetOps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInstance ¶
func SetInstance(i Ops)
SetInstance replaces the instance with the provided one. Should be used only for testing purposes.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a wrapper for the kubernetes apps client.
func New ¶
func New(apps appsv1client.AppsV1Interface, core corev1client.CoreV1Interface) *Client
New builds a new apps client.
func NewForConfig ¶
NewForConfig builds a new apps client for the given config.
func (*Client) CreateDaemonSet ¶
CreateDaemonSet creates the given daemonset
func (*Client) CreateDeployment ¶
func (c *Client) CreateDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error)
CreateDeployment creates the given deployment
func (*Client) CreateReplicaSet ¶
func (c *Client) CreateReplicaSet(rs *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error)
CreateReplicaSet creates the given ReplicaSet
func (*Client) CreateStatefulSet ¶
func (c *Client) CreateStatefulSet(statefulset *appsv1.StatefulSet) (*appsv1.StatefulSet, error)
CreateStatefulSet creates the given statefulset
func (*Client) DeleteDaemonSet ¶
DeleteDaemonSet deletes the given daemonset
func (*Client) DeleteDeployment ¶
DeleteDeployment deletes the given deployment
func (*Client) DeleteReplicaSet ¶
DeleteReplicaSet deletes the given ReplicaSet
func (*Client) DeleteStatefulSet ¶
DeleteStatefulSet deletes the given statefulset
func (*Client) DescribeDeployment ¶
func (c *Client) DescribeDeployment(depName, depNamespace string) (*appsv1.DeploymentStatus, error)
DescribeDeployment gets the deployment status
func (*Client) DescribeStatefulSet ¶
func (c *Client) DescribeStatefulSet(ssetName string, ssetNamespace string) (*appsv1.StatefulSetStatus, error)
DescribeStatefulSet gets status of the statefulset
func (*Client) GetDaemonSet ¶
GetDaemonSet gets the the daemon set with given name
func (*Client) GetDaemonSetPods ¶
GetDaemonSetPods returns list of pods for the daemonset
func (*Client) GetDeployment ¶
func (c *Client) GetDeployment(name, namespace string) (*appsv1.Deployment, error)
GetDeployment returns a deployment for the give name and namespace
func (*Client) GetDeploymentPods ¶
GetDeploymentPods returns pods for the given deployment
func (*Client) GetDeploymentsUsingStorageClass ¶
func (c *Client) GetDeploymentsUsingStorageClass(scName string) ([]appsv1.Deployment, error)
GetDeploymentsUsingStorageClass returns all deployments using the given storage class
func (*Client) GetPVCsForStatefulSet ¶
func (c *Client) GetPVCsForStatefulSet(ss *appsv1.StatefulSet) (*corev1.PersistentVolumeClaimList, error)
GetPVCsForStatefulSet returns all the PVCs for given stateful set
func (*Client) GetReplicaSet ¶
func (c *Client) GetReplicaSet(name, namespace string) (*appsv1.ReplicaSet, error)
GetReplicaSet gets the the daemon set with given name
func (*Client) GetReplicaSetByDeployment ¶
func (c *Client) GetReplicaSetByDeployment(deployment *appsv1.Deployment) (*appsv1.ReplicaSet, error)
GetReplicaSetByDeployment get ReplicaSet for a Given Deployment
func (*Client) GetReplicaSetPods ¶
GetReplicaSetPods returns list of pods for the ReplicaSet
func (*Client) GetStatefulSet ¶
func (c *Client) GetStatefulSet(name, namespace string) (*appsv1.StatefulSet, error)
GetStatefulSet returns a statefulset for given name and namespace
func (*Client) GetStatefulSetPods ¶
GetStatefulSetPods returns pods for the given statefulset
func (*Client) GetStatefulSetsUsingStorageClass ¶
func (c *Client) GetStatefulSetsUsingStorageClass(scName string) ([]appsv1.StatefulSet, error)
GetStatefulSetsUsingStorageClass returns all statefulsets using given storage class
func (*Client) ListDaemonSets ¶
func (c *Client) ListDaemonSets(namespace string, listOpts metav1.ListOptions) ([]appsv1.DaemonSet, error)
ListDaemonSets lists all daemonsets in given namespace
func (*Client) ListDeployments ¶
func (c *Client) ListDeployments(namespace string, options metav1.ListOptions) (*appsv1.DeploymentList, error)
ListDeployments lists all deployments for the given namespace
func (*Client) ListReplicaSets ¶
func (c *Client) ListReplicaSets(namespace string, listOpts metav1.ListOptions) ([]appsv1.ReplicaSet, error)
ListReplicaSets lists all ReplicaSets in given namespace
func (*Client) ListStatefulSets ¶
func (c *Client) ListStatefulSets(namespace string) (*appsv1.StatefulSetList, error)
ListStatefulSets lists all the statefulsets for a given namespace
func (*Client) UpdateDaemonSet ¶
UpdateDaemonSet updates the given daemon set and returns the updated ds
func (*Client) UpdateDeployment ¶
func (c *Client) UpdateDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error)
UpdateDeployment updates the given deployment
func (*Client) UpdateReplicaSet ¶
func (c *Client) UpdateReplicaSet(rs *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error)
UpdateReplicaSet updates the given daemon set and returns the updated rs
func (*Client) UpdateStatefulSet ¶
func (c *Client) UpdateStatefulSet(statefulset *appsv1.StatefulSet) (*appsv1.StatefulSet, error)
UpdateStatefulSet creates the given statefulset
func (*Client) ValidateDaemonSet ¶
ValidateDaemonSet checks if the given daemonset is ready within given timeout
func (*Client) ValidateDeployment ¶
func (c *Client) ValidateDeployment(deployment *appsv1.Deployment, timeout, retryInterval time.Duration) error
ValidateDeployment validates the given deployment if it's running and healthy
func (*Client) ValidatePVCsForStatefulSet ¶
func (c *Client) ValidatePVCsForStatefulSet(ss *appsv1.StatefulSet, timeout, retryTimeout time.Duration) error
ValidatePVCsForStatefulSet validates the PVCs for the given stateful set
func (*Client) ValidateReplicaSet ¶
ValidateReplicaSet checks if the given ReplicaSet is ready within given timeout
func (*Client) ValidateStatefulSet ¶
ValidateStatefulSet validates the given statefulset if it's running and healthy within the given timeout
func (*Client) ValidateTerminatedDeployment ¶
func (c *Client) ValidateTerminatedDeployment(deployment *appsv1.Deployment, timeout, timeBeforeRetry time.Duration) error
ValidateTerminatedDeployment validates if given deployment is terminated
func (*Client) ValidateTerminatedStatefulSet ¶
func (c *Client) ValidateTerminatedStatefulSet(statefulset *appsv1.StatefulSet, timeout, timeBeforeRetry time.Duration) error
ValidateTerminatedStatefulSet validates if given deployment is terminated
type DaemonSetOps ¶
type DaemonSetOps interface { // CreateDaemonSet creates the given daemonset CreateDaemonSet(ds *appsv1.DaemonSet) (*appsv1.DaemonSet, error) // ListDaemonSets lists all daemonsets in given namespace ListDaemonSets(namespace string, listOpts metav1.ListOptions) ([]appsv1.DaemonSet, error) // GetDaemonSet gets the the daemon set with given name GetDaemonSet(string, string) (*appsv1.DaemonSet, error) // ValidateDaemonSet checks if the given daemonset is ready within given timeout ValidateDaemonSet(name, namespace string, timeout time.Duration) error // GetDaemonSetPods returns list of pods for the daemonset GetDaemonSetPods(*appsv1.DaemonSet) ([]corev1.Pod, error) // UpdateDaemonSet updates the given daemon set and returns the updated ds UpdateDaemonSet(*appsv1.DaemonSet) (*appsv1.DaemonSet, error) // DeleteDaemonSet deletes the given daemonset DeleteDaemonSet(name, namespace string) error }
DaemonSetOps is an interface to perform k8s daemon set operations
type DeploymentOps ¶
type DeploymentOps interface { // ListDeployments lists all deployments for the given namespace ListDeployments(namespace string, options metav1.ListOptions) (*appsv1.DeploymentList, error) // GetDeployment returns a deployment for the give name and namespace GetDeployment(name, namespace string) (*appsv1.Deployment, error) // CreateDeployment creates the given deployment CreateDeployment(*appsv1.Deployment) (*appsv1.Deployment, error) // UpdateDeployment updates the given deployment UpdateDeployment(*appsv1.Deployment) (*appsv1.Deployment, error) // DeleteDeployment deletes the given deployment DeleteDeployment(name, namespace string) error // ValidateDeployment validates the given deployment if it's running and healthy ValidateDeployment(deployment *appsv1.Deployment, timeout, retryInterval time.Duration) error // ValidateTerminatedDeployment validates if given deployment is terminated ValidateTerminatedDeployment(*appsv1.Deployment, time.Duration, time.Duration) error // GetDeploymentPods returns pods for the given deployment GetDeploymentPods(*appsv1.Deployment) ([]corev1.Pod, error) // DescribeDeployment gets the deployment status DescribeDeployment(name, namespace string) (*appsv1.DeploymentStatus, error) // GetDeploymentsUsingStorageClass returns all deployments using the given storage class GetDeploymentsUsingStorageClass(scName string) ([]appsv1.Deployment, error) }
DeploymentOps is an interface to perform k8s deployment operations
type Ops ¶
type Ops interface { DaemonSetOps DeploymentOps StatefulSetOps ReplicaSetOps // SetConfig sets the config and resets the client SetConfig(config *rest.Config) }
Ops is an interface to perform kubernetes related operations on the apps resources.
func NewInstanceFromConfigFile ¶
NewInstanceFromConfigFile returns new instance of client by using given config file
type ReplicaSetOps ¶
type ReplicaSetOps interface { // CreateReplicaSet creates the given ReplicaSet CreateReplicaSet(rs *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error) // ListReplicaSets lists all ReplicaSets in given namespace ListReplicaSets(namespace string, listOpts metav1.ListOptions) ([]appsv1.ReplicaSet, error) // GetReplicaSet gets the the daemon set with given name GetReplicaSet(string, string) (*appsv1.ReplicaSet, error) // ValidateReplicaSet checks if the given ReplicaSet is ready within given timeout ValidateReplicaSet(name, namespace string, timeout time.Duration) error // GetReplicaSetPods returns list of pods for the ReplicaSet GetReplicaSetPods(*appsv1.ReplicaSet) ([]corev1.Pod, error) // UpdateReplicaSet updates the given daemon set and returns the updated rs UpdateReplicaSet(*appsv1.ReplicaSet) (*appsv1.ReplicaSet, error) // DeleteReplicaSet deletes the given ReplicaSet DeleteReplicaSet(name, namespace string) error // GetReplicaSetByDeployment deletes the given ReplicaSet GetReplicaSetByDeployment(deployment *appsv1.Deployment) (*appsv1.ReplicaSet, error) }
ReplicaSetOps is an interface to perform k8s daemon set operations
type StatefulSetOps ¶
type StatefulSetOps interface { // ListStatefulSets lists all the statefulsets for a given namespace ListStatefulSets(namespace string) (*appsv1.StatefulSetList, error) // GetStatefulSet returns a statefulset for given name and namespace GetStatefulSet(name, namespace string) (*appsv1.StatefulSet, error) // CreateStatefulSet creates the given statefulset CreateStatefulSet(ss *appsv1.StatefulSet) (*appsv1.StatefulSet, error) // UpdateStatefulSet creates the given statefulset UpdateStatefulSet(ss *appsv1.StatefulSet) (*appsv1.StatefulSet, error) // DeleteStatefulSet deletes the given statefulset DeleteStatefulSet(name, namespace string) error // ValidateStatefulSet validates the given statefulset if it's running and healthy within the given timeout ValidateStatefulSet(ss *appsv1.StatefulSet, timeout time.Duration) error // ValidateTerminatedStatefulSet validates if given deployment is terminated ValidateTerminatedStatefulSet(ss *appsv1.StatefulSet, timeout, retryInterval time.Duration) error // GetStatefulSetPods returns pods for the given statefulset GetStatefulSetPods(ss *appsv1.StatefulSet) ([]corev1.Pod, error) // DescribeStatefulSet gets status of the statefulset DescribeStatefulSet(name, namespace string) (*appsv1.StatefulSetStatus, error) // GetStatefulSetsUsingStorageClass returns all statefulsets using given storage class GetStatefulSetsUsingStorageClass(scName string) ([]appsv1.StatefulSet, error) // GetPVCsForStatefulSet returns all the PVCs for given stateful set GetPVCsForStatefulSet(ss *appsv1.StatefulSet) (*corev1.PersistentVolumeClaimList, error) // ValidatePVCsForStatefulSet validates the PVCs for the given stateful set ValidatePVCsForStatefulSet(ss *appsv1.StatefulSet, timeout, retryInterval time.Duration) error }
StatefulSetOps is an interface to perform k8s stateful set operations