khcheckcrd

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package khcheckcrd implements a kuberhealthy check CRD for configuring Kuberhealthy with external check pods.

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout = time.Minute * 5

DefaultTimeout is the default timeout for external checks

View Source
var SchemeGroupVersion schema.GroupVersion

SchemeGroupVersion variable for newly added kh checks 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 CheckConfig

type CheckConfig struct {
	RunInterval      string            `json:"runInterval"`      // the interval at which the check runs
	Timeout          string            `json:"timeout"`          // the maximum time the pod is allowed to run before a failure is assumed
	PodSpec          apiv1.PodSpec     `json:"podSpec"`          // a spec for the external checker
	ExtraAnnotations map[string]string `json:"extraAnnotations"` // a map of extra annotations that will be applied to the pod
	ExtraLabels      map[string]string `json:"extraLabels"`      // a map of extra labels that will be applied to the pod
}

CheckConfig represents a configuration for a kuberhealthy external checker. This includes the pod spec to run, the interval, and the whitelisted UUID that is currently allowed to report-in to the status reporting endpoint.

func NewCheckConfig

func NewCheckConfig(runInterval time.Duration, podSpec apiv1.PodSpec) CheckConfig

NewCheckConfig creates a new check configuration

type KuberhealthyCheck

type KuberhealthyCheck struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              CheckConfig `json:"spec"`
}

KuberhealthyCheck represents the data in the CRD for configuring an external checker for Kuberhealthy

func NewKuberhealthyCheck

func NewKuberhealthyCheck(name string, namespace string, spec CheckConfig) KuberhealthyCheck

NewKuberhealthyCheck creates a KuberhealthyCheck struct which represents the data inside a KuberhealthyCheck resource

func (KuberhealthyCheck) DeepCopyInto

func (h KuberhealthyCheck) DeepCopyInto(out *KuberhealthyCheck)

DeepCopyInto copies all properties of this object into another object of the same type that is provided as a pointer.

func (KuberhealthyCheck) DeepCopyObject

func (h KuberhealthyCheck) DeepCopyObject() runtime.Object

DeepCopyObject returns a generically typed copy of an object

func (KuberhealthyCheck) String

func (h KuberhealthyCheck) String() string

String satisfies the stringer interface for cleaner output when printing

type KuberhealthyCheckClient

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

KuberhealthyCheckClient holds client data for talking to Kubernetes about the khstate custom resource

func Client

func Client(GroupName string, GroupVersion string, kubeConfig string, namespace string) (*KuberhealthyCheckClient, error)

Client creates a rest client to use for interacting with CRDs

func CreateClient added in v2.3.2

func CreateClient(client rest.Interface) *KuberhealthyCheckClient

CreateClient returns a Kuberhealthy Check client using an existing rest client

func (*KuberhealthyCheckClient) Create

func (c *KuberhealthyCheckClient) Create(check *KuberhealthyCheck, resource string, namespace string) (*KuberhealthyCheck, error)

Create creates a new resource for this CRD

func (*KuberhealthyCheckClient) Delete

func (c *KuberhealthyCheckClient) Delete(resource string, name string, namespace string) (*KuberhealthyCheck, error)

Delete deletes a resource for this CRD

func (*KuberhealthyCheckClient) Get

func (c *KuberhealthyCheckClient) Get(opts metav1.GetOptions, resource string, namespace string, name string) (*KuberhealthyCheck, error)

Get fetches a resource of this CRD

func (*KuberhealthyCheckClient) List

func (c *KuberhealthyCheckClient) List(opts metav1.ListOptions, resource string, namespace string) (*KuberhealthyCheckList, error)

List lists resources for this CRD

func (*KuberhealthyCheckClient) Update

func (c *KuberhealthyCheckClient) Update(check *KuberhealthyCheck, resource string, namespace string, name string) (*KuberhealthyCheck, error)

Update updates a resource for this CRD

func (*KuberhealthyCheckClient) Watch

func (c *KuberhealthyCheckClient) Watch(opts metav1.ListOptions, resource string, namespace string) (watch.Interface, error)

Watch returns a watch.Interface that watches the requested clusterTestTypes. func (c *KuberhealthyCheckClient) Watch(opts metav1.ListOptions, resource, namespace string) (watch.Interface, error) {

type KuberhealthyCheckList

type KuberhealthyCheckList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []KuberhealthyCheck `json:"items"`
}

KuberhealthyCheckList is a list of Kuberhealthy check configurations

func (*KuberhealthyCheckList) DeepCopyInto

func (h *KuberhealthyCheckList) DeepCopyInto(out *KuberhealthyCheckList)

DeepCopyInto copies all properties of this object into another object of the same type that is provided as a pointer.

func (*KuberhealthyCheckList) DeepCopyObject

func (h *KuberhealthyCheckList) DeepCopyObject() runtime.Object

DeepCopyObject returns a generically typed copy of an object

Jump to

Keyboard shortcuts

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