clustertlsconfig

package
v0.82.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// ConfigFileKey is the secret's key containing the YAML configuration.
	ConfigFileKey = "cluster-tls-config.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config is the Alertmanager cluster's mTLS configuration.

Config can make a secret which holds the cluster configuration as well as volumes and volume mounts for referencing the secret and the necessary TLS credentials.

func New

func New(mountingDir string, a *monitoringv1.Alertmanager) (*Config, error)

New creates a new ClusterTLSConfig. All volumes related to the cluster TLS config will be mounted via the `mountingDir`. The Secret where the cluster TLS config will be stored will be named `secretName`. All volumes containing TLS credentials related to cluster TLS configuration will be prefixed with "cluster-tls-server-config-" or "cluster-tls-client-config-" respectively, for server and client credentials.

func (Config) ClusterTLSConfiguration

func (c Config) ClusterTLSConfiguration() ([]byte, error)

CreateOrUpdateConfigSecret create or update a Kubernetes secret with the data for the cluster TLS config file. The format of the cluster TLS config file is available in the official prometheus documentation: https://github.com/prometheus/alertmanager/blob/main/docs/https.md#gossip-traffic/

func (Config) GetMountParameters

func (c Config) GetMountParameters() (*monitoringv1.Argument, []v1.Volume, []v1.VolumeMount, error)

GetMountParameters returns volumes and volume mounts referencing the cluster TLS config file and the associated TLS credentials. In addition, GetMountParameters returns a cluster.tls-config command line option pointing to the cluster TLS config file in the volume mount. All TLS credentials related to cluster TLS configuration will be prefixed with "cluster-tls-server-config-" or "cluster-tls-client-config-" respectively, for server and client credentials. The server and client TLS credentials are mounted in different paths: ~/{mountingDir}/server-tls/ and ~/{mountingDir}/client-tls/ respectively.

func (Config) GetSecretName

func (c Config) GetSecretName() string

Jump to

Keyboard shortcuts

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