client

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: Apache-2.0 Imports: 39 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPodResourceUsage

func GetPodResourceUsage(pc promv1.API, obj metav1.ObjectMeta) core.ResourceList

Types

type BasicAuth

type BasicAuth struct {
	Username     string `yaml:"username" json:"username"`
	Password     string `yaml:"password,omitempty" json:"password,omitempty"`
	PasswordFile string `yaml:"password_file,omitempty" json:"password_file,omitempty"`
}

BasicAuth contains basic HTTP authentication credentials.

type ChangeStats

type ChangeStats struct {
	Comment string `json:"comment,omitempty"`
	Diff    string `json:"diff,omitempty"`
}

type ClientBuilder

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

func NewBuilder

func NewBuilder(mgr manager.Manager, flags *Config) (*ClientBuilder, error)

func (*ClientBuilder) GetPrometheusClient

func (r *ClientBuilder) GetPrometheusClient() (promv1.API, error)

func (*ClientBuilder) Reconcile

func (r *ClientBuilder) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*ClientBuilder) Setup

func (r *ClientBuilder) Setup() error

type Config

type Config struct {
	// The address where metrics will be sent
	Addr string
	// The HTTP basic authentication credentials for the targets.
	BasicAuth BasicAuth `yaml:"basic_auth,omitempty" json:"basic_auth,omitempty"`
	// The bearer token for the targets. Deprecated in favour of
	// Authorization.Credentials.
	BearerToken string `yaml:"bearer_token,omitempty" json:"bearer_token,omitempty"`
	// The bearer token file for the targets. Deprecated in favour of
	// Authorization.CredentialsFile.
	BearerTokenFile string `yaml:"bearer_token_file,omitempty" json:"bearer_token_file,omitempty"`
	// HTTP proxy server to use to connect to the targets.
	ProxyURL string `yaml:"proxy_url,omitempty" json:"proxy_url,omitempty"`
	// TLSConfig to use to connect to the targets.
	TLSConfig prom_config.TLSConfig `yaml:"tls_config,omitempty" json:"tls_config,omitempty"`
}

func NewPrometheusConfig

func NewPrometheusConfig() *Config

func ToPrometheusConfig

func ToPrometheusConfig(cfg *rest.Config, ref appcatalog.ServiceReference) (*Config, error)

func (*Config) AddFlags

func (p *Config) AddFlags(fs *pflag.FlagSet)

func (*Config) AddGoFlags

func (p *Config) AddGoFlags(fs *flag.FlagSet)

func (*Config) NewPrometheusClient

func (p *Config) NewPrometheusClient() (promapi.Client, error)

func (*Config) ToHTTPClientConfig

func (p *Config) ToHTTPClientConfig() (*prom_config.HTTPClientConfig, error)

func (*Config) Validate

func (p *Config) Validate() error

type FileHash

type FileHash struct {
	Data []byte `json:"data,omitempty"`
	Hash uint64 `json:"hash,omitempty"`
}

Jump to

Keyboard shortcuts

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