Documentation ¶
Index ¶
- Constants
- func IgnoreAlreadyExists(err error) error
- func IgnoreNotFound(err error) error
- func NewEventRecorder(clientSet *kubernetes.Clientset, logf func(format string, args ...interface{})) record.EventRecorder
- func NewPerfJob(objectMeta metav1.ObjectMeta, app string, imageSpec perfv1alpha1.ImageSpec, ...) *batchv1.Job
- func NewPersistentVolumeClaim(pvcSpec corev1.PersistentVolumeClaimSpec, name, namespace string) *corev1.PersistentVolumeClaim
- type Access
- func (a *Access) CreateWithReference(ctx context.Context, object, owner metav1.Object) error
- func (a *Access) DeleteObject(ctx context.Context, object, owner metav1.Object) error
- func (a *Access) IsDeploymentReady(namespacedName types.NamespacedName) (ready bool, err error)
- func (a *Access) IsEndpointReady(namespacedName types.NamespacedName) (finished bool, err error)
- func (a *Access) IsJobFinished(namespacedName types.NamespacedName) (finished bool, err error)
- func (a *Access) RecordEventf(object metav1.Object, eventtype, reason, messageFmt string, ...) error
Constants ¶
const ( // CreateFailed is an event provided via EventRecorder CreateFailed = "CreateFailed" // Created is an event provided via EventRecorder Created = "Created" // Deleted is an event provided via EventRecorder Deleted = "Deleted" )
Variables ¶
This section is empty.
Functions ¶
func IgnoreAlreadyExists ¶
IgnoreAlreadyExists returns nil on k8s Already Exists type of errors, but returns the error as-is otherwise
func IgnoreNotFound ¶
IgnoreNotFound returns nil on k8s Not Found type of errors, but returns the error as-is otherwise
func NewEventRecorder ¶ added in v0.3.0
func NewEventRecorder(clientSet *kubernetes.Clientset, logf func(format string, args ...interface{})) record.EventRecorder
NewEventRecorder creates a new event recorder
func NewPerfJob ¶ added in v0.4.1
func NewPerfJob(objectMeta metav1.ObjectMeta, app string, imageSpec perfv1alpha1.ImageSpec, podConfig perfv1alpha1.PodConfigurationSpec) *batchv1.Job
NewPerfJob creates a new kubernetes job with the given arguments
func NewPersistentVolumeClaim ¶ added in v0.4.1
func NewPersistentVolumeClaim(pvcSpec corev1.PersistentVolumeClaimSpec, name, namespace string) *corev1.PersistentVolumeClaim
NewPersistentVolumeClaim creates a PVC based on the provided pvcSpec, name and namespace
Types ¶
type Access ¶
type Access struct { Client client.Client Clientset *k8sclient.Clientset Scheme *runtime.Scheme EventRecorder record.EventRecorder }
Access provides client related structs to access kubernetes
func (*Access) CreateWithReference ¶
CreateWithReference method creates a kubernetes resource and sets the owner reference to a given object. It provides basic idempotency (by ignoring Already Exists errors). Successful creation of the event is logged via EventRecorder to the owner.
func (*Access) DeleteObject ¶
DeleteObject method deletes a kubernetes resource while ignores not found errors, so that it can be called multiple times. Successful deletion of the event is logged via EventRecorder to the owner.
func (*Access) IsDeploymentReady ¶ added in v0.2.1
func (a *Access) IsDeploymentReady(namespacedName types.NamespacedName) (ready bool, err error)
IsDeploymentReady returns true if the given deployment's ready replicas matching with the desired replicas
func (*Access) IsEndpointReady ¶ added in v0.2.1
func (a *Access) IsEndpointReady(namespacedName types.NamespacedName) (finished bool, err error)
IsEndpointReady returns true if the given endpoint is fully connected to at least one pod
func (*Access) IsJobFinished ¶ added in v0.2.0
func (a *Access) IsJobFinished(namespacedName types.NamespacedName) (finished bool, err error)
IsJobFinished returns true if the given job has already succeeded or failed