Documentation ¶
Index ¶
- type CoherenceProbe
- func (in *CoherenceProbe) ExecuteProbe(ctx context.Context, sts *appsv1.StatefulSet, probe *coh.Probe) bool
- func (in *CoherenceProbe) ExecuteProbeForSubSetOfPods(ctx context.Context, sts *appsv1.StatefulSet, probe *coh.Probe, ...) bool
- func (in *CoherenceProbe) GetPodHostName(pod corev1.Pod) string
- func (in *CoherenceProbe) GetPodsForStatefulSet(ctx context.Context, sts *appsv1.StatefulSet) (corev1.PodList, error)
- func (in *CoherenceProbe) IsPodReady(pod corev1.Pod) (bool, string)
- func (in *CoherenceProbe) IsStatusHA(ctx context.Context, deployment coh.CoherenceResource, sts *appsv1.StatefulSet) bool
- func (in *CoherenceProbe) ProbeUsingExec(ctx context.Context, pod corev1.Pod, handler *coh.Probe) (bool, error)
- func (in *CoherenceProbe) ProbeUsingHTTP(pod corev1.Pod, handler *coh.Probe) (bool, error)
- func (in *CoherenceProbe) ProbeUsingTCP(pod corev1.Pod, handler *coh.Probe) (bool, error)
- func (in *CoherenceProbe) RunProbe(ctx context.Context, pod corev1.Pod, handler *coh.Probe) (bool, error)
- func (in *CoherenceProbe) SetGetPodHostName(fn func(pod corev1.Pod) string)
- func (in *CoherenceProbe) SetTranslatePort(fn func(name string, port int) int)
- func (in *CoherenceProbe) SuspendServices(ctx context.Context, deployment coh.CoherenceResource, sts *appsv1.StatefulSet) ServiceSuspendStatus
- func (in *CoherenceProbe) TranslatePort(name string, port int) int
- type GetHTTPInterface
- type HTTPProbe
- type Result
- type ServiceSuspendStatus
- type TCPProbe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoherenceProbe ¶
type CoherenceProbe struct { Client client.Client Config *rest.Config // contains filtered or unexported fields }
func (*CoherenceProbe) ExecuteProbe ¶
func (in *CoherenceProbe) ExecuteProbe(ctx context.Context, sts *appsv1.StatefulSet, probe *coh.Probe) bool
func (*CoherenceProbe) ExecuteProbeForSubSetOfPods ¶
func (in *CoherenceProbe) ExecuteProbeForSubSetOfPods(ctx context.Context, sts *appsv1.StatefulSet, probe *coh.Probe, stsPods, pods corev1.PodList) bool
func (*CoherenceProbe) GetPodHostName ¶
func (in *CoherenceProbe) GetPodHostName(pod corev1.Pod) string
func (*CoherenceProbe) GetPodsForStatefulSet ¶
func (in *CoherenceProbe) GetPodsForStatefulSet(ctx context.Context, sts *appsv1.StatefulSet) (corev1.PodList, error)
func (*CoherenceProbe) IsPodReady ¶
func (in *CoherenceProbe) IsPodReady(pod corev1.Pod) (bool, string)
IsPodReady determines whether the specified Pods are in the Ready state.
func (*CoherenceProbe) IsStatusHA ¶
func (in *CoherenceProbe) IsStatusHA(ctx context.Context, deployment coh.CoherenceResource, sts *appsv1.StatefulSet) bool
IsStatusHA will return true if the deployment represented by the deployment is StatusHA. The number of Pods matching the StatefulSet selector must match the StatefulSet replica count ALl Pods must be in the ready state All Pods must pass the StatusHA check
func (*CoherenceProbe) ProbeUsingExec ¶
func (*CoherenceProbe) ProbeUsingHTTP ¶
func (*CoherenceProbe) ProbeUsingTCP ¶
func (*CoherenceProbe) SetGetPodHostName ¶
func (in *CoherenceProbe) SetGetPodHostName(fn func(pod corev1.Pod) string)
func (*CoherenceProbe) SetTranslatePort ¶
func (in *CoherenceProbe) SetTranslatePort(fn func(name string, port int) int)
func (*CoherenceProbe) SuspendServices ¶
func (in *CoherenceProbe) SuspendServices(ctx context.Context, deployment coh.CoherenceResource, sts *appsv1.StatefulSet) ServiceSuspendStatus
SuspendServices will request services be suspended in the Coherence cluster. This is called prior to stopping a StatefulSet to then have a graceful shutdown. The number of Pods matching the StatefulSet selector must match the StatefulSet replica count ALl Pods must be in the ready state All Pods must pass the StatusHA check
func (*CoherenceProbe) TranslatePort ¶
func (in *CoherenceProbe) TranslatePort(name string, port int) int
type GetHTTPInterface ¶
GetHTTPInterface is an interface for making HTTP requests, that returns a response and error.
type HTTPProbe ¶
type HTTPProbe interface {
Probe(url *url.URL, headers http.Header, timeout time.Duration) (Result, string, error)
}
HTTPProbe is an interface that defines the Probe function for doing HTTP readiness/liveness checks.
func NewHTTPProbe ¶
func NewHTTPProbe() HTTPProbe
NewHTTPProbe creates Probe that will skip TLS verification while probing.
func NewHTTPProbeWithTLSConfig ¶
NewHTTPProbeWithTLSConfig takes tls config as parameter.
type Result ¶
type Result string
Result is a string used to handle the results for probing container readiness/livenss
func DoHTTPProbe ¶
func DoHTTPProbe(url *url.URL, headers http.Header, client GetHTTPInterface) (Result, string, error)
DoHTTPProbe checks if a GET request to the url succeeds. If the HTTP response code is successful (i.e. 400 > code >= 200), it returns Success. If the HTTP response code is unsuccessful or HTTP communication fails, it returns Failure. This is exported because some other packages may want to do direct HTTP probes.
func DoTCPProbe ¶
DoTCPProbe checks that a TCP socket to the address can be opened. If the socket can be opened, it returns Success If the socket fails to open, it returns Failure. This is exported because some other packages may want to do direct TCP probes.
type ServiceSuspendStatus ¶
type ServiceSuspendStatus int
const ( ServiceSuspendSkipped ServiceSuspendStatus = iota // == 0 ServiceSuspendSuccessful ServiceSuspendStatus = iota // == 1 ServiceSuspendFailed ServiceSuspendStatus = iota // == 2 )