webconfig

package
v0.87.0-rhobs1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config is the web configuration for prometheus and alertmanager instance.

Config can make a secret which holds the web config contents, as well as volumes and volume mounts for referencing the secret and the necessary TLS files.

func New

func New(mountingDir string, secretName string, configFileFields monitoringv1.WebConfigFileFields) (*Config, error)

New creates a new Config.

func (Config) CreateOrUpdateWebConfigSecret

func (c Config) CreateOrUpdateWebConfigSecret(ctx context.Context, secretClient clientv1.SecretInterface, s *v1.Secret) error

CreateOrUpdateWebConfigSecret create or update a Kubernetes secret with the data for the web config file. The format of the web config file is available in the official prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/https/#https-and-authentication

func (Config) GetMountParameters

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

GetMountParameters returns volumes and volume mounts referencing the config file and the associated TLS files. In addition, GetMountParameters returns a web.config.file command line option pointing to the file in the volume mount.

type TLSReferences

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

TLSReferences represent TLS material referenced from secrets/configmaps.

func NewTLSReferences

func NewTLSReferences(mountPath string, keySecret corev1.SecretKeySelector, cert, clientCA monitoringv1.SecretOrConfigMap) *TLSReferences

func (*TLSReferences) GetCAFilename

func (tr *TLSReferences) GetCAFilename() string

GetCAFilename retruns the filename (key) of the client CA certificate.

func (*TLSReferences) GetCAMountPath

func (tr *TLSReferences) GetCAMountPath() string

GetCAMountPath is the mount path of the client CA certificate inside a prometheus container.

func (*TLSReferences) GetCertFilename

func (tr *TLSReferences) GetCertFilename() string

GetCertFilename returns the filename (key) of the certificate.

func (*TLSReferences) GetCertMountPath

func (tr *TLSReferences) GetCertMountPath() string

GetCertMountPath is the mount path of the TLS certificate inside a prometheus container,.

func (*TLSReferences) GetKeyFilename

func (tr *TLSReferences) GetKeyFilename() string

GetKeyFilename returns the filename of the private key.

func (*TLSReferences) GetKeyMountPath

func (tr *TLSReferences) GetKeyMountPath() string

GetKeyMountPath is the mount path of the TLS key inside a prometheus container.

func (*TLSReferences) GetMountParameters

func (tr *TLSReferences) GetMountParameters(volumePrefix string) ([]corev1.Volume, []corev1.VolumeMount, error)

GetMountParameters creates volumes and volume mounts referencing the TLS credentials.

Jump to

Keyboard shortcuts

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