prober

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrKubeBadTarget is returned when the target doesn't match the
	// expected form for the kubernetes prober
	ErrKubeBadTarget = fmt.Errorf("Target secret must be provided in the form: <namespace>/<name>")
)
View Source
var (
	// Probers maps a friendly name to a corresponding probe function
	Probers = map[string]ProbeFn{
		"https":      ProbeHTTPS,
		"http":       ProbeHTTPS,
		"tcp":        ProbeTCP,
		"file":       ProbeFile,
		"kubernetes": ProbeKubernetes,
		"kubeconfig": ProbeKubeconfig,
	}
)

Functions

func ProbeFile

func ProbeFile(ctx context.Context, logger log.Logger, target string, module config.Module, registry *prometheus.Registry) error

ProbeFile collects certificate metrics from local files

func ProbeHTTPS

func ProbeHTTPS(ctx context.Context, logger log.Logger, target string, module config.Module, registry *prometheus.Registry) error

ProbeHTTPS performs a https probe

func ProbeKubeconfig

func ProbeKubeconfig(ctx context.Context, logger log.Logger, target string, module config.Module, registry *prometheus.Registry) error

ProbeKubeconfig collects certificate metrics from kubeconfig files

func ProbeKubernetes

func ProbeKubernetes(ctx context.Context, logger log.Logger, target string, module config.Module, registry *prometheus.Registry) error

ProbeKubernetes collects certificate metrics from kubernetes.io/tls Secrets

func ProbeTCP

func ProbeTCP(ctx context.Context, logger log.Logger, target string, module config.Module, registry *prometheus.Registry) error

ProbeTCP performs a tcp probe

Types

type KubeConfig

type KubeConfig struct {
	Path     string
	Clusters []KubeConfigCluster
	Users    []KubeConfigUser
}

func ParseKubeConfig

func ParseKubeConfig(file string) (*KubeConfig, error)

type KubeConfigCluster

type KubeConfigCluster struct {
	Name    string
	Cluster KubeConfigClusterCert
}

type KubeConfigClusterCert

type KubeConfigClusterCert struct {
	CertificateAuthority     string `yaml:"certificate-authority"`
	CertificateAuthorityData string `yaml:"certificate-authority-data"`
}

type KubeConfigUser

type KubeConfigUser struct {
	Name string
	User KubeConfigUserCert
}

type KubeConfigUserCert

type KubeConfigUserCert struct {
	ClientCertificate     string `yaml:"client-certificate"`
	ClientCertificateData string `yaml:"client-certificate-data"`
}

type ProbeFn

type ProbeFn func(ctx context.Context, logger log.Logger, target string, module config.Module, registry *prometheus.Registry) error

ProbeFn probes

Jump to

Keyboard shortcuts

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