Documentation ¶
Overview ¶
Copyright 2017 Gravitational, Inc. 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.
Copyright 2017 Gravitational, Inc. 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
- func BasicCheckers() *compositeChecker
- func ConnectToKube(masterURL string, configPath string) (*kube.Clientset, error)
- func DockerHealth(socketPath string) health.Checker
- func EtcdHealth(config *ETCDConfig) (health.Checker, error)
- func InterPodCommunication(kubeAddr, nettestImage string) health.Checker
- func KubeAPIServerHealth(kubeAddr string, config string) health.Checker
- func KubeletHealth(addr string) health.Checker
- func NewCompositeChecker(name string, checkers []health.Checker) health.Checker
- func NewHTTPHealthzChecker(name, URL string, checker HTTPResponseChecker) health.Checker
- func NewHTTPHealthzCheckerWithTransport(name, URL string, transport http.RoundTripper, checker HTTPResponseChecker) health.Checker
- func NewInterPodChecker(masterURL, nettestContainerImage string) health.Checker
- func NewNodesStatusChecker(hostPort string, nodesReadyThreshold int) health.Checker
- func NewProbeFromErr(name, detail string, err error) *pb.Probe
- func NewSystemdChecker() systemdChecker
- func NewUnixSocketHealthzChecker(name, URL, socketPath string, checker HTTPResponseChecker) health.Checker
- func NodesStatusHealth(kubeAddr string, nodesReadyThreshold int) health.Checker
- func PreInstallCheckers() health.Checker
- func Sysctl(name string) (string, error)
- func SystemdHealth() health.Checker
- type ETCDConfig
- type HTTPHealthzChecker
- type HTTPResponseChecker
- type HostChecker
- type KubeChecker
- type KubeStatusChecker
- type OSChecker
- type OSRelease
- type PortChecker
- type PortRange
- type ProcessChecker
- type StorageChecker
- type SysctlChecker
- type SystemStatusType
Constants ¶
const ( SystemStatusRunning SystemStatusType = "running" SystemStatusDegraded = "degraded" SystemStatusLoading = "loading" SystemStatusStopped = "stopped" SystemStatusUnknown = "" )
Variables ¶
This section is empty.
Functions ¶
func BasicCheckers ¶ added in v0.0.7
func BasicCheckers() *compositeChecker
BasicCheckers will try to detect most common problems preventing k8s cluster to function properly
func ConnectToKube ¶
ConnectToKube establishes a connection to kubernetes on the specified address and returns an API client.
func DockerHealth ¶
DockerHealth creates a checker that checks health of the docker daemon under the specified socketPath
func EtcdHealth ¶
func EtcdHealth(config *ETCDConfig) (health.Checker, error)
EtcdHealth creates a checker that checks health of etcd
func InterPodCommunication ¶ added in v0.0.3
InterPodCommunication creates a checker that runs a network test in the cluster by scheduling pods and verifying the communication
func KubeAPIServerHealth ¶ added in v0.0.3
KubeAPIServerHealth creates a checker for the kubernetes API server
func KubeletHealth ¶
KubeletHealth creates a checker for the kubernetes kubelet component
func NewCompositeChecker ¶ added in v0.0.8
NewCompositeChecker makes checker out of array of checkers
func NewHTTPHealthzChecker ¶
func NewHTTPHealthzChecker(name, URL string, checker HTTPResponseChecker) health.Checker
NewHTTPHealthzChecker creates a health.Checker for an HTTP health endpoint using the specified URL and a custom response checker
func NewHTTPHealthzCheckerWithTransport ¶ added in v0.0.3
func NewHTTPHealthzCheckerWithTransport(name, URL string, transport http.RoundTripper, checker HTTPResponseChecker) health.Checker
NewHTTPHealthzCheckerWithTransport creates a health.Checker for an HTTP health endpoint using the specified transport, URL and a custom response checker
func NewInterPodChecker ¶ added in v0.0.3
NewInterPodChecker returns an instance of interPodChecker.
func NewNodesStatusChecker ¶ added in v0.0.4
NewNodesStatusChecker returns a Checker that tests kubernetes nodes availability
func NewProbeFromErr ¶
NewProbeFromErr creates a new Probe given an error and a checker name
func NewSystemdChecker ¶
func NewSystemdChecker() systemdChecker
func NewUnixSocketHealthzChecker ¶
func NewUnixSocketHealthzChecker(name, URL, socketPath string, checker HTTPResponseChecker) health.Checker
NewUnixSocketHealthzChecker returns a new Checker that tests the specified unix domain socket path and URL
func NodesStatusHealth ¶ added in v0.0.4
NodesStatusHealth creates a checker that reports a number of ready kubernetes nodes
func PreInstallCheckers ¶ added in v0.0.7
PreInstallCheckers are designed to run on a node before installing telekube
func SystemdHealth ¶
SystemdHealth creates a checker that reports the status of systemd units
Types ¶
type ETCDConfig ¶ added in v0.0.3
type ETCDConfig struct { // Endpoints lists etcd server endpoints Endpoints []string // CAFile is an SSL Certificate Authority file used to secure // communication with etcd CAFile string // CertFile is an SSL certificate file used to secure // communication with etcd CertFile string // KeyFile is an SSL key file used to secure communication with etcd KeyFile string // InsecureSkipVerify controls whether a client verifies the // server's certificate chain and host name. InsecureSkipVerify bool }
ETCDConfig defines a set of configuration parameters for accessing etcd endpoints
func (*ETCDConfig) NewHTTPTransport ¶ added in v0.0.7
func (r *ETCDConfig) NewHTTPTransport() (*http.Transport, error)
NewHTTPTransport creates a new http.Transport from the specified set of attributes. The resulting transport can be used to create an http.Client
type HTTPHealthzChecker ¶ added in v0.0.3
type HTTPHealthzChecker struct { URL string // contains filtered or unexported fields }
HTTPHealthzChecker is a health.Checker that can validate service health over HTTP
func (*HTTPHealthzChecker) Check ¶ added in v0.0.3
func (r *HTTPHealthzChecker) Check(ctx context.Context, reporter health.Reporter)
Check runs an HTTP check and reports errors to the specified Reporter
func (*HTTPHealthzChecker) Name ¶ added in v0.0.3
func (r *HTTPHealthzChecker) Name() string
Name returns the name of this checker
type HTTPResponseChecker ¶ added in v0.0.3
HTTPResponseChecker is a function that can validate service health from the provided response
type HostChecker ¶ added in v0.0.8
type HostChecker struct { // MinCPU is minimum amount of logical CPUs MinCPU int // MinRamBytes is minimum amount of RAM MinRAMBytes uint64 }
HostChecker validates CPU and RAM requirements
func (*HostChecker) Check ¶ added in v0.0.8
func (c *HostChecker) Check(ctx context.Context, reporter health.Reporter)
Check runs check
func (*HostChecker) Name ¶ added in v0.0.8
func (c *HostChecker) Name() string
Name returns checker id
type KubeChecker ¶
type KubeChecker struct {
// contains filtered or unexported fields
}
KubeChecker implements Checker that can check and report problems with kubernetes services.
func (*KubeChecker) Check ¶
func (r *KubeChecker) Check(ctx context.Context, reporter health.Reporter)
Check runs the wrapped kubernetes service checker function and reports status to the specified reporter
func (*KubeChecker) Name ¶
func (r *KubeChecker) Name() string
Name returns the name of this checker
type KubeStatusChecker ¶
KubeStatusChecker is a function that can check status of kubernetes services.
type OSChecker ¶ added in v0.0.7
type OSChecker struct {
Releases []OSRelease
}
OSChecker validates host OS based on https://www.freedesktop.org/software/systemd/man/os-release.html
func DefaultOSChecker ¶ added in v0.0.7
func DefaultOSChecker() *OSChecker
DefaultOSChecker returns standard distributions supported by Telekube
type OSRelease ¶ added in v0.0.7
type OSRelease struct { // ID is either ubuntu, redhat or centos ID string // VersionID is major release version i.e. 16.04 VersionID string }
OSRelease is used to represent a certain OS release based on https://www.freedesktop.org/software/systemd/man/os-release.html fields
type PortChecker ¶ added in v0.0.7
type PortChecker struct {
Ranges []PortRange
}
PortChecker will validate that all required ports are in fact unoccupied
func DefaultPortChecker ¶ added in v0.0.7
func DefaultPortChecker() *PortChecker
func PreInstallPortChecker ¶ added in v0.0.7
func PreInstallPortChecker() *PortChecker
PreInstallPortChecker validates no actual checkers
func (*PortChecker) Check ¶ added in v0.0.7
func (c *PortChecker) Check(ctx context.Context, reporter health.Reporter)
Check will scan current open ports and report every conflict detected
func (*PortChecker) Name ¶ added in v0.0.7
func (c *PortChecker) Name() string
Name returns this checker name
type ProcessChecker ¶ added in v0.0.7
type ProcessChecker struct { // ProcessNames contains list of processes which should not be running at the time of check ProcessNames []string }
ProcessChecker is checking aginst known list of conflicting processes
func DefaultProcessChecker ¶ added in v0.0.7
func DefaultProcessChecker() *ProcessChecker
DefaultProcessChecker returns checker which will ensure no conflicting program is running
func (*ProcessChecker) Check ¶ added in v0.0.7
func (c *ProcessChecker) Check(ctx context.Context, r health.Reporter)
Check will query current process list and report for each conflicting program found
func (*ProcessChecker) Name ¶ added in v0.0.7
func (c *ProcessChecker) Name() string
Name returns checker name
type StorageChecker ¶ added in v0.0.8
type StorageChecker struct { // Path represents volume to be checked Path string // WillBeCreated when true, then all checks will be applied to first existing dir, or fail otherwise WillBeCreated bool // MinBytesPerSecond is minimum write speed for probe to succeed MinBytesPerSecond uint64 // Filesystems define list of supported filesystems, or any if empty Filesystems []string // MinFreeBytes define minimum free volume capacity MinFreeBytes uint64 // contains filtered or unexported fields }
StorageChecker verifies volume matches requirements
func (*StorageChecker) Check ¶ added in v0.0.8
func (c *StorageChecker) Check(ctx context.Context, reporter health.Reporter)
func (*StorageChecker) Name ¶ added in v0.0.8
func (c *StorageChecker) Name() string
Name returns name of the checker
type SysctlChecker ¶ added in v0.0.7
type SysctlChecker struct { // Name is checker name CheckerName string // Param is parameter name Param string // Expected is expected parameter value Expected string // OnMissing is description when parameter is missing OnMissing string // OnValueMismatch is description when parameter value is not equal to expected OnValueMismatch string }
SysctlCHecker verifies various /proc filesystem runtime parameters
func NewBrNetfilterChecker ¶ added in v0.0.7
func NewBrNetfilterChecker() *SysctlChecker
NewBrNetfilterChecker will check if br_netfilter module has established bridge networking
func NewIPForwardChecker ¶ added in v0.0.7
func NewIPForwardChecker() *SysctlChecker
NewIPForwardChecker returns new IP forward checker
func (*SysctlChecker) Check ¶ added in v0.0.7
func (c *SysctlChecker) Check(ctx context.Context, reporter health.Reporter)
Check will verify the parameter value is as expected or complain otherwise
func (*SysctlChecker) Name ¶ added in v0.0.7
func (c *SysctlChecker) Name() string
Name returns name of checker
type SystemStatusType ¶
type SystemStatusType string