diagnose

package

Documentation

Overview

* Tencent is pleased to support the open source community by making TKEStack * available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * 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 * * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.

* Tencent is pleased to support the open source community by making TKEStack * available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * 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 * * https://opensource.org/licenses/Apache-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 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

View Source
var Factories = map[string]Factory{}

Factories store all registered Diagnostic Creator

Functions

func Add

func Add(typ string, f Factory)

Add register a Diagnostic Factory

func CommonDeafer

func CommonDeafer(c chan *Result)

Types

type Catalogue

type Catalogue []string

Catalogue is the default catalogue type of a Diagnostic

var (
	// CatalogueMaster Diagnostic diagnose controller panel status
	// master nodes status should belong to this catalogue
	CatalogueMaster Catalogue = []string{"master"}
	// CatalogueNode Diagnostics diagnose nodes status
	CatalogueNode Catalogue = []string{"node"}
	// CatalogueResource Diagnostics diagnose cluster resources status
	CatalogueResource Catalogue = []string{"resource"}
	// CatalogueOther Diagnostics have no certain catalogue
	CatalogueOther Catalogue = []string{"other"}
)

type Diagnostic

type Diagnostic interface {
	// Complete check and complete config items
	Complete() error
	// Meta return core MetaData
	Meta() MetaData
	// StartDiagnose return a result chan that will output results
	// [chan *Result] will pop results one by one
	// diagnostic is deemed to finish if [chan *Result] is closed
	StartDiagnose(ctx context.Context, param StartDiagnoseParam) (chan *Result, error)
}

Diagnostic diagnose some aspects of cluster

type Factory

type Factory struct {
	// Creator is a factory function to create Diagnostic
	Creator func(d *MetaData) Diagnostic
	// SupportedClouds indicate what cloud providers will be supported of this diagnostic
	SupportedClouds []string
	// Catalogue is the catalogue type of the Diagnostic
	Catalogue Catalogue
}

Factory create a new Diagnostic

type HealthyLevel

type HealthyLevel string

HealthyLevel means the healthy level of diagnostic result

const (
	// HealthyLevelFailed means diagnostic is failed
	// this is not a error but an acceptable failed
	HealthyLevelFailed HealthyLevel = "failed"
	// HealthyLevelGood means no health problem
	HealthyLevelGood HealthyLevel = "good"
	// HealthyLevelWarn means warn unHealthy
	HealthyLevelWarn HealthyLevel = "warn"
	// HealthyLevelRisk means risk unHealthy
	HealthyLevelRisk HealthyLevel = "risk"
	// HealthyLevelSerious means serious unHealthy
	HealthyLevelSerious HealthyLevel = "serious"
)

func (HealthyLevel) Compare

func (h HealthyLevel) Compare(t HealthyLevel) int

Compare compare 2 HealthyLevel return == 0 if h == t return > 0 if h > t return < 0 if h < t

func (HealthyLevel) Verify

func (h HealthyLevel) Verify() bool

Verify return false if h is illegal

type MetaData

type MetaData struct {
	plugins.MetaData
	// Catalogue is the catalogue type of the Diagnostic
	Catalogue Catalogue
}

MetaData contains core attributes of a Diagnostic

func (*MetaData) Meta

func (m *MetaData) Meta() MetaData

Meta return core MetaData this function can be use for struct implement Diagnostic interface

type MetaObject

type MetaObject interface {
	schema.ObjectKind
	v1.Object
}

func GetRootOwner

func GetRootOwner(obj MetaObject, uid2obj map[types.UID]MetaObject) MetaObject

type Result

type Result struct {
	// Level is the healthy status
	Level HealthyLevel
	// ObjName is the name of diagnosed object
	ObjName string
	// ObjInfo is the core information of Obj
	ObjInfo map[string]interface{}
	// Title is the short description of Result,that is, the title of Result
	Title translate.Message
	// Desc is the full description of Result
	Desc translate.Message
	// Proposal is the full description that show how solve the healthy problem
	Proposal translate.Message
}

Result is a diagnostic result item

type StartDiagnoseParam

type StartDiagnoseParam struct {
	// CloudType is the cloud provider type fo cluster
	CloudType string
	// Resources contains all diagnose able resources
	Resources *cluster.Resources
}

StartDiagnoseParam contains all items that StartDiagnose need

Directories

Path Synopsis
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
master
args/apiserver
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
args/controller-manager
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
args/etcd
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
args/scheduler
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
capacity
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
components
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
node
ha
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
iptables
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
sys
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
other
example
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
resource
hpa/ip
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
workload/affinity
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
workload/batch
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
workload/ha
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
workload/healthcheck
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
workload/pdb
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.
workload/requestslimits
* Tencent is pleased to support the open source community by making TKEStack * available.
* Tencent is pleased to support the open source community by making TKEStack * available.

Jump to

Keyboard shortcuts

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