internal

package
v1.5.4-0...-af4ab59 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultYamlPaths = []YAMLCertRef{
	{
		CertMatchExpr: "$.clusters[:].cluster[\"certificate-authority-data\"]",
		IDMatchExpr:   "$.clusters[:].name",
		Format:        YAMLCertFormatBase64,
	},
	{
		CertMatchExpr: "$.clusters[:].cluster[\"certificate-authority\"]",
		IDMatchExpr:   "$.clusters[:].name",
		Format:        YAMLCertFormatFile,
	},
	{
		CertMatchExpr: "$.users[:].user[\"client-certificate-data\"]",
		IDMatchExpr:   "$.users[:].name",
		Format:        YAMLCertFormatBase64,
	},
	{
		CertMatchExpr: "$.users[:].user[\"client-certificate\"]",
		IDMatchExpr:   "$.users[:].name",
		Format:        YAMLCertFormatFile,
	},
}

DefaultYamlPaths : Pre-written paths for some k8s config files

View Source
var Version = "0.0.0"

Version is the exporter semantic version and is set at link time

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	ListenAddress         string
	Files                 []string
	Directories           []string
	YAMLs                 []string
	YAMLPaths             []YAMLCertRef
	TrimPathComponents    int
	MaxCacheDuration      time.Duration
	ExposeRelativeMetrics bool
	ExposeErrorMetrics    bool
	ExposeLabels          []string
	KubeSecretTypes       []string
	KubeIncludeNamespaces []string
	KubeExcludeNamespaces []string
	KubeIncludeLabels     []string
	KubeExcludeLabels     []string
	// contains filtered or unexported fields
}

Exporter : Configuration (from command-line)

func (*Exporter) ConnectToKubernetesCluster

func (exporter *Exporter) ConnectToKubernetesCluster(path string) error

ConnectToKubernetesCluster : Try connect to a cluster from inside if path is empty, otherwise try loading the kubeconfig at path "path"

func (*Exporter) DiscoverCertificates

func (exporter *Exporter) DiscoverCertificates()

DiscoverCertificates : Parse all certs in a dry run with verbose logging

func (*Exporter) Listen

func (exporter *Exporter) Listen() error

Listen : Listen for requests

func (*Exporter) ListenAndServe

func (exporter *Exporter) ListenAndServe() error

ListenAndServe : Convenience function to start exporter

func (*Exporter) Serve

func (exporter *Exporter) Serve() error

Serve : Actually reply to requests

func (*Exporter) Shutdown

func (exporter *Exporter) Shutdown() error

Shutdown : Properly tear down server

type YAMLCertFormat

type YAMLCertFormat int

YAMLCertFormat : Type of cert encoding in YAML files

const (
	YAMLCertFormatFile   YAMLCertFormat = iota
	YAMLCertFormatBase64                = iota
)

YAMLCertFormat : Impl

type YAMLCertRef

type YAMLCertRef struct {
	CertMatchExpr string
	IDMatchExpr   string
	Format        YAMLCertFormat
}

YAMLCertRef : Contains information to access certificates in yaml files

Jump to

Keyboard shortcuts

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