v1

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SchemeGroupVersion schema.GroupVersion

SchemeGroupVersion variable for newly added kh state to be added to Kuberhealthy

Functions

func ConfigureScheme

func ConfigureScheme(GroupName string, GroupVersion string) error

ConfigureScheme configures the runtime scheme for use with CRD creation

Types

type KHStateV1Client

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

KHStateV1Client is used to interact with features provided by the khstate group.

func Client

func Client(kubeConfigFile string) (*KHStateV1Client, error)

func New

New creates a new KHStateV1Client for the given RESTClient.

func NewForConfig

func NewForConfig(c *rest.Config) (*KHStateV1Client, error)

NewForConfig creates a new KHStateV1Client for the given config.

func NewForConfigOrDie

func NewForConfigOrDie(c *rest.Config) *KHStateV1Client

NewForConfigOrDie creates a new KHStateV1Client for the given config and panics if there is an error in the config.

func (*KHStateV1Client) KuberhealthyStates

func (c *KHStateV1Client) KuberhealthyStates(namespace string) KuberhealthyStateInterface

func (*KHStateV1Client) RESTClient

func (c *KHStateV1Client) RESTClient() rest.Interface

RESTClient returns a RESTClient that is used to communicate with API server by this client implementation.

type KHStateV1Interface

type KHStateV1Interface interface {
	RESTClient() rest.Interface
	KuberhealthyStatesGetter
}

type KHWorkload

type KHWorkload string

KHWorkload is used to describe the different types of kuberhealthy workloads: KhCheck or KHJob

const (
	KHCheck KHWorkload = "KHCheck"
	KHJob   KHWorkload = "KHJob"
)

Two types of KHWorkloads are available: Kuberhealthy Check or Kuberhealthy Job KHChecks run on a scheduled run interval KHJobs run once

type KuberhealthyState

type KuberhealthyState struct {
	metav1.TypeMeta `json:",inline" yaml:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

	// Spec holds the desired state of the KuberhealthyState (from the client).
	// +optional
	Spec WorkloadDetails `json:"spec" yaml:"spec"`
}

KuberhealthyState represents the data in the CRD for configuring an the state of khjobs or khchecks for Kuberhealthy +k8s:openapi-gen=true +kubebuilder:printcolumn:name="OK",type=string,JSONPath=`.spec.OK`,description="OK status" +kubebuilder:printcolumn:name="Age LastRun",type=date,JSONPath=`.spec.LastRun`,description="Last Run" +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age" +kubebuilder:resource:path="khstates" +kubebuilder:resource:singular="khstate" +kubebuilder:resource:shortName="khs"

func NewKuberhealthyState

func NewKuberhealthyState(name string, spec WorkloadDetails) KuberhealthyState

NewKuberhealthyState creates a KuberhealthyState struct which represents the data inside a KuberhealthyState resource

func (*KuberhealthyState) DeepCopy

func (in *KuberhealthyState) DeepCopy() *KuberhealthyState

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KuberhealthyState.

func (*KuberhealthyState) DeepCopyInto

func (in *KuberhealthyState) DeepCopyInto(out *KuberhealthyState)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*KuberhealthyState) DeepCopyObject

func (in *KuberhealthyState) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type KuberhealthyStateInterface

type KuberhealthyStateInterface interface {
	Create(*KuberhealthyState) (KuberhealthyState, error)
	Update(*KuberhealthyState) (KuberhealthyState, error)
	Delete(name string, options *metav1.DeleteOptions) error
	DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
	Get(name string, options metav1.GetOptions) (KuberhealthyState, error)
	List(opts metav1.ListOptions) (KuberhealthyStateList, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
	Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result KuberhealthyState, err error)
}

KuberhealthyStateInterface has methods to work with KuberhealthyState resources.

type KuberhealthyStateList

type KuberhealthyStateList struct {
	metav1.TypeMeta `json:",inline" yaml:",inline"`
	metav1.ListMeta `json:"metadata" yaml:"metadata"`

	Items []KuberhealthyState `json:"items" yaml:"items"`
}

KuberhealthyStateList is a list of KuberhealthyState resources

func (*KuberhealthyStateList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KuberhealthyStateList.

func (*KuberhealthyStateList) DeepCopyInto

func (in *KuberhealthyStateList) DeepCopyInto(out *KuberhealthyStateList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*KuberhealthyStateList) DeepCopyObject

func (in *KuberhealthyStateList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type KuberhealthyStatesGetter

type KuberhealthyStatesGetter interface {
	KuberhealthyStates(namespace string) KuberhealthyStateInterface
}

KuberhealthyStatesGetter has a method to return a KuberhealthyStateInterface. A group's client should implement this interface.

type WorkloadDetails

type WorkloadDetails struct {
	OK          bool     `json:"OK" yaml:"OK"`                   // true or false status of the khWorkload, whether or not it completed successfully
	Errors      []string `json:"Errors" yaml:"Errors"`           // the list of errors reported from the khWorkload run
	RunDuration string   `json:"RunDuration" yaml:"RunDuration"` // the time it took for the khWorkload to complete
	Namespace   string   `json:"Namespace" yaml:"Namespace"`     // the namespace the khWorkload was run in
	Node        string   `json:"Node" yaml:"Node"`               // the node the khWorkload ran on
	// +nullable
	LastRun          *metav1.Time `json:"LastRun,omitempty" yaml:"LastRun,omitempty"` // the time the khWorkload was last run
	AuthoritativePod string       `json:"AuthoritativePod" yaml:"AuthoritativePod"`   // the main kuberhealthy pod creating and updating the khstate
	CurrentUUID      string       `json:"uuid" yaml:"uuid"`                           // the UUID that is authorized to report statuses into the kuberhealthy endpoint
	// contains filtered or unexported fields
}

WorkloadDetails contains details about a single kuberhealthy check or job's current status +k8s:openapi-gen=true +nullable:name="LastRun"

func NewWorkloadDetails

func NewWorkloadDetails(workloadType KHWorkload) WorkloadDetails

NewWorkloadDetails creates a new WorkloadDetails struct

func (*WorkloadDetails) DeepCopy

func (in *WorkloadDetails) DeepCopy() *WorkloadDetails

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadDetails.

func (*WorkloadDetails) DeepCopyInto

func (in *WorkloadDetails) DeepCopyInto(out *WorkloadDetails)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WorkloadDetails) GetKHWorkload

func (wd *WorkloadDetails) GetKHWorkload() KHWorkload

GetKHWorkload returns the workload for the WorkloadDetails struct

Jump to

Keyboard shortcuts

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