exporter

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDBFileName = "uri_dsn.txt"

Variables

View Source
var DefaultConfig = Config{

	Release:            "dbclaim-exporter",
	ImageRepo:          "quay.io/prometheuscommunity/postgres-exporter",
	ImageTag:           "v0.10.1",
	DatasourceFileName: DefaultDBFileName,

	Resources: map[string]map[string]string{
		"requests": {
			"cpu":    "100m",
			"memory": "128Mi",
		},
		"limits": {
			"cpu":    "500m",
			"memory": "512Mi",
		},
	},
	Values: MustReadValues([]byte(`annotations:
  "prometheus.io/scrape": "true"
  "prometheus.io/path": "/metrics"
  "prometheus.io/port": "9187"
`)),
}

Functions

func Apply

func Apply(ctx context.Context, cli client.Client, cfg *Config) error

Apply provided config to cluster

func Render

func Render(ctx context.Context, cfg *Config) (string, string, error)

Render template based on config available

Types

type Config

type Config struct {
	// Default Values
	Name      string
	Namespace string
	ImageRepo string
	ImageTag  string

	// Override Values
	Release      string
	TemplatePath string

	// DBClaimOwnerRef ensures deployment is cleaned up when db claim is deleted
	DBClaimOwnerRef    string
	DBClaimUID         string
	ConfigCheckSum     string
	ServiceAccountName string
	ImagePullSecrets   []string

	AppendConstantLabels map[string]string

	DatasourceUser       string
	DatasourceSecretName string
	DatasourceFileName   string

	Resources map[string]map[string]string

	DepYamlPath    string
	ConfigYamlPath string
	Values         Values
	// contains filtered or unexported fields
}

Config is used to render out the deployment yaml

func NewConfig

func NewConfig() *Config

NewConfig returns a config with default values populated

type Values

type Values map[string]interface{}

Values represents a collection of chart values.

func MustReadValues

func MustReadValues(data []byte) Values

func ReadValues

func ReadValues(data []byte) (vals Values, err error)

func (Values) Encode

func (v Values) Encode(w io.Writer) error

Encode writes serialized Values information to the given io.Writer.

func (Values) YAML

func (v Values) YAML() (string, error)

YAML encodes the Values into a YAML string.

Jump to

Keyboard shortcuts

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