secrets

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	APIServer  config.URL `yaml:"api_server,omitempty"`
	KubeConfig string     `yaml:"kubeconfig_file,omitempty"`
}

ClientConfig configures access to the Kubernetes API server.

type KubernetesSecretConfig

type KubernetesSecretConfig struct {
	Namespace string `yaml:"namespace"`
	Name      string `yaml:"name"`
	Key       string `yaml:"key"`
}

KubernetesSecretConfig is the configuration pointing to a specific Kubernetes Secret.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages the Kubernetes secret provider.

func NewManager

func NewManager(ctx context.Context, reg prometheus.Registerer, opts ProviderOptions) Manager

NewManager creates a new secret manager with the provided options.

func (*Manager) ApplyConfig

func (m *Manager) ApplyConfig(providerConfig *WatchSPConfig, configs []SecretConfig) error

ApplyConfig applies the new secrets, diffing each one with the last configuration to apply the relevant update.

func (*Manager) Close

func (m *Manager) Close(reg prometheus.Registerer)

Close cancels the manager, stopping the Kubernetes secret provider.

func (*Manager) Fetch

func (m *Manager) Fetch(ctx context.Context, name string) (string, error)

Fetch implements github.com/prometheus/common/config.SecretManager.Fetch.

type ProviderOptions

type ProviderOptions struct {
	Logger log.Logger
}

ProviderOptions provides options for a Provider.

type Secret

type Secret interface {
	// Fetch fetches the secret content.
	Fetch(ctx context.Context) (string, error)
}

Secret represents a sensitive value.

type SecretConfig

type SecretConfig struct {
	Name   string                 `yaml:"name"`
	Config KubernetesSecretConfig `yaml:"config"`
}

SecretConfig maps a secret name references to a Kubernetes secret.

type SecretFn

type SecretFn func(ctx context.Context) (string, error)

SecretFn wraps a function to make it a Secret.

func (*SecretFn) Fetch

func (fn *SecretFn) Fetch(ctx context.Context) (string, error)

Fetch implements Secret.Fetch.

type WatchSPConfig

type WatchSPConfig struct {
	ClientConfig
}

WatchSPConfig configures access to the Kubernetes API server. TODO(TheSpiritXIII): https://github.com/GoogleCloudPlatform/prometheus-engine/issues/867

Jump to

Keyboard shortcuts

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