Documentation ¶
Index ¶
- func DecodeKubeObj(yml []byte) (k8sruntime.Object, *schema.GroupVersionKind, error)
- func PatchImage(deployment *appsv1.Deployment, image string) ([]byte, error)
- type Client
- type DeploymentBox
- func (b *DeploymentBox) Create(deployment *appsv1.Deployment, namespace string) (*appsv1.Deployment, error)
- func (b *DeploymentBox) Delete(name, namespace string) error
- func (b *DeploymentBox) Exists(name, namespace string) (bool, error)
- func (b *DeploymentBox) Get(name, namespace string) (*appsv1.Deployment, error)
- func (b *DeploymentBox) GetLatestReplicaSet(name, namespace string) (*appsv1.Deployment, string, error)
- func (b *DeploymentBox) GetPods(name, namespace string) (*corev1.PodList, error)
- func (b *DeploymentBox) List(namespace string) (*appsv1.DeploymentList, error)
- func (b *DeploymentBox) Patch(name, namespace string, data []byte) (*appsv1.Deployment, error)
- func (b *DeploymentBox) Scale(name, namespace string, replicas int32) error
- func (b *DeploymentBox) Watch(namespace, labelSelector string, timeoutSeconds *int64) (watch.Interface, error)
- func (b *DeploymentBox) WatchDeployment(namespace, deploymentName string, timeoutSeconds *int64) (watch.Interface, error)
- type EventBox
- type PodBox
- func (b *PodBox) Create(pod *corev1.Pod, namespace string) (*corev1.Pod, error)
- func (b *PodBox) Delete(name, namespace string) error
- func (b *PodBox) Exec(cmd []string, ptyHandler terminal.PtyHandler, ...) error
- func (b *PodBox) Exists(name, namespace string) (bool, error)
- func (b *PodBox) Get(name, namespace string) (*corev1.Pod, error)
- func (b *PodBox) List(namespace, labelSelector string) (*corev1.PodList, error)
- func (b *PodBox) LogStream(name, namespace string, opts *corev1.PodLogOptions, writer io.Writer) error
- func (b *PodBox) LogStreamLine(name, namespace string, opts *corev1.PodLogOptions, writer io.Writer) error
- func (b *PodBox) Logs(name, namespace string, opts *corev1.PodLogOptions) *restclient.Request
- func (b *PodBox) Watch(namespace string, timeoutSeconds *int64, labelSelector string) (watch.Interface, error)
- func (b *PodBox) WatchPod(namespace, podName string, timeoutSeconds *int64) (watch.Interface, error)
- type ServiceBox
- func (s *ServiceBox) Create(service *corev1.Service, namespace string) (*corev1.Service, error)
- func (s *ServiceBox) Delete(name, namespace string) error
- func (s *ServiceBox) Exists(name, namespace string) (bool, error)
- func (s *ServiceBox) Get(name, namespace string) (*corev1.Service, error)
- func (s *ServiceBox) List(namespace string) (*corev1.ServiceList, error)
- type StatefulSetBox
- func (b *StatefulSetBox) Create(statefulset *appsv1.StatefulSet, namespace string) (*appsv1.StatefulSet, error)
- func (b *StatefulSetBox) Delete(name, namespace string) error
- func (b *StatefulSetBox) Exists(name, namespace string) (bool, error)
- func (b *StatefulSetBox) Get(name, namespace string) (*appsv1.StatefulSet, error)
- func (b *StatefulSetBox) GetLatestReplicaSet(name, namespace string) (*appsv1.StatefulSet, string, error)
- func (b *StatefulSetBox) List(namespace string) (*appsv1.StatefulSetList, error)
- func (b *StatefulSetBox) ListWithSelector(namespace, labelSelector string) (*appsv1.StatefulSetList, error)
- func (b *StatefulSetBox) Patch(name, namespace string, data []byte) (*appsv1.StatefulSet, error)
- func (b *StatefulSetBox) Watch(namespace, labelSelector string, timeoutSeconds *int64) (watch.Interface, error)
- func (b *StatefulSetBox) WatchStatefulSetBox(namespace, stsName string, timeoutSeconds *int64) (watch.Interface, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeKubeObj ¶
func DecodeKubeObj(yml []byte) (k8sruntime.Object, *schema.GroupVersionKind, error)
DecodeKubeObj decode kubernetes object from yaml
func PatchImage ¶
func PatchImage(deployment *appsv1.Deployment, image string) ([]byte, error)
PatchImage reutn bytes for a StrategicMergePatch of deployment
Types ¶
type Client ¶
type Client struct { *PodBox *EventBox *DeploymentBox *ServiceBox *StatefulSetBox }
Client contains all kube resource client
type DeploymentBox ¶
type DeploymentBox struct {
// contains filtered or unexported fields
}
DeploymentBox provide functions for kubernetes deployment.
func NewDeploymentBoxWithClient ¶
func NewDeploymentBoxWithClient(c *clientset.Interface) *DeploymentBox
NewDeploymentBoxWithClient creates a DeploymentBox
func (*DeploymentBox) Create ¶
func (b *DeploymentBox) Create(deployment *appsv1.Deployment, namespace string) (*appsv1.Deployment, error)
Create creates a deployment
func (*DeploymentBox) Delete ¶
func (b *DeploymentBox) Delete(name, namespace string) error
Delete delete deployment
func (*DeploymentBox) Exists ¶
func (b *DeploymentBox) Exists(name, namespace string) (bool, error)
Exists check if deployment exists.
func (*DeploymentBox) Get ¶
func (b *DeploymentBox) Get(name, namespace string) (*appsv1.Deployment, error)
Get get specified deployment in specified namespace.
func (*DeploymentBox) GetLatestReplicaSet ¶
func (b *DeploymentBox) GetLatestReplicaSet(name, namespace string) (*appsv1.Deployment, string, error)
GetLatestReplicaSet get latest replicaSet of deployment
func (*DeploymentBox) GetPods ¶
func (b *DeploymentBox) GetPods(name, namespace string) (*corev1.PodList, error)
GetPods get pods of deployment
func (*DeploymentBox) List ¶
func (b *DeploymentBox) List(namespace string) (*appsv1.DeploymentList, error)
List list deployments in specified namespace.
func (*DeploymentBox) Patch ¶
func (b *DeploymentBox) Patch(name, namespace string, data []byte) (*appsv1.Deployment, error)
Patch patch deployment
func (*DeploymentBox) Scale ¶
func (b *DeploymentBox) Scale(name, namespace string, replicas int32) error
Scale scale deployment replicas
func (*DeploymentBox) Watch ¶
func (b *DeploymentBox) Watch(namespace, labelSelector string, timeoutSeconds *int64) (watch.Interface, error)
Watch watch deployment in specified namespace with timeoutSeconds
func (*DeploymentBox) WatchDeployment ¶
func (b *DeploymentBox) WatchDeployment(namespace, deploymentName string, timeoutSeconds *int64) (watch.Interface, error)
WatchDeployment watch specified deployment in specified namespace with timeoutSeconds
type EventBox ¶
type EventBox struct {
// contains filtered or unexported fields
}
EventBox provide functions for kubernetes event.
type PodBox ¶
type PodBox struct {
// contains filtered or unexported fields
}
PodBox provide functions for kubernetes pod.
func NewPodBoxWithClient ¶
NewPodBoxWithClient creates a PodBox
func (*PodBox) Exec ¶
func (b *PodBox) Exec(cmd []string, ptyHandler terminal.PtyHandler, namespace, podName, containerName string) error
Exec exec into a pod
func (*PodBox) LogStream ¶
func (b *PodBox) LogStream(name, namespace string, opts *corev1.PodLogOptions, writer io.Writer) error
LogStream get logs of specified pod in specified namespace and copy to writer.
func (*PodBox) LogStreamLine ¶
func (b *PodBox) LogStreamLine(name, namespace string, opts *corev1.PodLogOptions, writer io.Writer) error
LogStreamLine get logs of specified pod in specified namespace and copy to writer.
func (*PodBox) Logs ¶
func (b *PodBox) Logs(name, namespace string, opts *corev1.PodLogOptions) *restclient.Request
Logs get logs of specified pod in specified namespace.
type ServiceBox ¶
type ServiceBox struct {
// contains filtered or unexported fields
}
ServiceBox provide functions for kubernetes service.
func (*ServiceBox) Delete ¶
func (s *ServiceBox) Delete(name, namespace string) error
Delete delete service
func (*ServiceBox) Exists ¶
func (s *ServiceBox) Exists(name, namespace string) (bool, error)
Exists check if service exists.
func (*ServiceBox) Get ¶
func (s *ServiceBox) Get(name, namespace string) (*corev1.Service, error)
Get get specified service in specified namespace.
func (*ServiceBox) List ¶
func (s *ServiceBox) List(namespace string) (*corev1.ServiceList, error)
List list services in specified namespace.
type StatefulSetBox ¶
type StatefulSetBox struct {
// contains filtered or unexported fields
}
StatefulSetBox provide functions for kubernetes statefulset.
func NewStatefulSetBoxWithClient ¶
func NewStatefulSetBoxWithClient(c *clientset.Interface) *StatefulSetBox
NewStatefulSetBoxWithClient creates a statefulsetBox
func (*StatefulSetBox) Create ¶
func (b *StatefulSetBox) Create(statefulset *appsv1.StatefulSet, namespace string) (*appsv1.StatefulSet, error)
Create creates a sts
func (*StatefulSetBox) Delete ¶
func (b *StatefulSetBox) Delete(name, namespace string) error
Delete delete sts
func (*StatefulSetBox) Exists ¶
func (b *StatefulSetBox) Exists(name, namespace string) (bool, error)
Exists check if statefulset exists.
func (*StatefulSetBox) Get ¶
func (b *StatefulSetBox) Get(name, namespace string) (*appsv1.StatefulSet, error)
Get get specified statefulset in specified namespace.
func (*StatefulSetBox) GetLatestReplicaSet ¶
func (b *StatefulSetBox) GetLatestReplicaSet(name, namespace string) (*appsv1.StatefulSet, string, error)
GetLatestReplicaSet get latest replicaSet of sts
func (*StatefulSetBox) List ¶
func (b *StatefulSetBox) List(namespace string) (*appsv1.StatefulSetList, error)
List list statefulsets in specified namespace.
func (*StatefulSetBox) ListWithSelector ¶
func (b *StatefulSetBox) ListWithSelector(namespace, labelSelector string) (*appsv1.StatefulSetList, error)
ListWithSelector list statefulsets in specified namespace.
func (*StatefulSetBox) Patch ¶
func (b *StatefulSetBox) Patch(name, namespace string, data []byte) (*appsv1.StatefulSet, error)
Patch patch sts
func (*StatefulSetBox) Watch ¶
func (b *StatefulSetBox) Watch(namespace, labelSelector string, timeoutSeconds *int64) (watch.Interface, error)
Watch watch sts in specified namespace with timeoutSeconds
func (*StatefulSetBox) WatchStatefulSetBox ¶
func (b *StatefulSetBox) WatchStatefulSetBox(namespace, stsName string, timeoutSeconds *int64) (watch.Interface, error)
WatchStatefulSetBox watch specified sts in specified namespace with timeoutSeconds