health

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: 4 Imported by: 0

Documentation

Overview

Copyright 2018 Comcast Cable Communications Management, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KHWorkload added in v2.3.0

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 State

type State struct {
	OK            bool
	Errors        []string
	CheckDetails  map[string]WorkloadDetails // map of check names to last run timestamp
	JobDetails    map[string]WorkloadDetails // map of job names to last run timestamp
	CurrentMaster string
}

State represents the results of all checks being managed along with a top-level OK and Error state. This is displayed on the kuberhealthy status page as JSON

func NewState

func NewState() State

NewState creates a new health check result response

func (*State) AddError

func (h *State) AddError(s ...string)

AddError adds new errors to State

func (*State) WriteHTTPStatusResponse

func (h *State) WriteHTTPStatusResponse(w http.ResponseWriter) error

WriteHTTPStatusResponse writes a response to an http response writer

type WorkloadDetails added in v2.3.0

type WorkloadDetails struct {
	OK               bool
	Errors           []string
	RunDuration      string
	Namespace        string
	LastRun          time.Time // the time the check last was last run
	AuthoritativePod string    // the pod that last ran the check
	CurrentUUID      string    `json:"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

func NewWorkloadDetails added in v2.3.0

func NewWorkloadDetails(workloadType KHWorkload) WorkloadDetails

NewWorkloadDetails creates a new WorkloadDetails struct

func (*WorkloadDetails) GetKHWorkload added in v2.3.0

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