Documentation
¶
Index ¶
Constants ¶
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 ¶
ClusterTLSConfiguration 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.