v1alpha1

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TPRAlertmanagersKind = "Alertmanager"
	TPRAlertmanagerName  = "alertmanagers"
)
View Source
const (
	TPRGroup   = "monitoring.coreos.com"
	TPRVersion = "v1alpha1"
)
View Source
const (
	TPRPrometheusesKind = "Prometheus"
	TPRPrometheusName   = "prometheuses"
)
View Source
const (
	TPRServiceMonitorsKind = "ServiceMonitor"
	TPRServiceMonitorName  = "servicemonitors"
)

Variables

This section is empty.

Functions

func UnstructuredFromAlertmanager

func UnstructuredFromAlertmanager(a *Alertmanager) (*unstructured.Unstructured, error)

UnstructuredFromAlertmanager marshals an Alertmanager object into dynamic client's unstructured

func UnstructuredFromPrometheus

func UnstructuredFromPrometheus(p *Prometheus) (*unstructured.Unstructured, error)

UnstructuredFromPrometheus marshals a Prometheus object into dynamic client's unstructured

func UnstructuredFromServiceMonitor

func UnstructuredFromServiceMonitor(s *ServiceMonitor) (*unstructured.Unstructured, error)

UnstructuredFromServiceMonitor marshals a ServiceMonitor object into dynamic client's unstructured

Types

type AlertingSpec

type AlertingSpec struct {
	// AlertmanagerEndpoints Prometheus should fire alerts against.
	Alertmanagers []AlertmanagerEndpoints `json:"alertmanagers"`
}

AlertingSpec defines paramters for alerting configuration of Prometheus servers.

type Alertmanager

type Alertmanager struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              AlertmanagerSpec    `json:"spec"`
	Status            *AlertmanagerStatus `json:"status,omitempty"`
}

func AlertmanagerFromUnstructured

func AlertmanagerFromUnstructured(r *unstructured.Unstructured) (*Alertmanager, error)

AlertmanagerFromUnstructured unmarshals an Alertmanager object from dynamic client's unstructured

type AlertmanagerEndpoints

type AlertmanagerEndpoints struct {
	// Namespace of Endpoints object.
	Namespace string `json:"namespace"`
	// Name of Endpoints object in Namespace.
	Name string `json:"name"`
	// Port the Alertmanager API is exposed on.
	Port intstr.IntOrString `json:"port"`
	// Scheme to use when firing alerts.
	Scheme string `json:"scheme"`
}

AlertmanagerEndpoints defines a selection of a single Endpoints object containing alertmanager IPs to fire alerts against.

type AlertmanagerInterface

type AlertmanagerInterface interface {
	Create(*Alertmanager) (*Alertmanager, error)
	Get(name string) (*Alertmanager, error)
	Update(*Alertmanager) (*Alertmanager, error)
	Delete(name string, options *v1.DeleteOptions) error
	List(opts metav1.ListOptions) (runtime.Object, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
}

type AlertmanagerList

type AlertmanagerList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
	metav1.ListMeta `json:"metadata,omitempty"`
	// Items is a list of third party objects
	Items []Alertmanager `json:"items"`
}

type AlertmanagerSpec

type AlertmanagerSpec struct {
	// Version the cluster should be on.
	Version string `json:"version,omitempty"`
	// Base image that is used to deploy pods.
	BaseImage string `json:"baseImage,omitempty"`
	// Size is the expected size of the alertmanager cluster. The controller will
	// eventually make the size of the running cluster equal to the expected
	// size.
	Replicas int32 `json:"replicas,omitempty"`
	// Storage is the definition of how storage will be used by the Alertmanager
	// instances.
	Storage *StorageSpec `json:"storage,omitempty"`
	// ExternalURL is the URL under which Alertmanager is externally reachable
	// (for example, if Alertmanager is served via a reverse proxy). Used for
	// generating relative and absolute links back to Alertmanager itself. If the
	// URL has a path portion, it will be used to prefix all HTTP endpoints
	// served by Alertmanager. If omitted, relevant URL components will be
	// derived automatically.
	ExternalURL string `json:"externalUrl,omitempty"`
	// If set to true all actions on the underlaying managed objects are not
	// goint to be performed, except for delete actions.
	Paused bool `json:"paused,omitempty"`
}

type AlertmanagerStatus

type AlertmanagerStatus struct {
	// Represents whether any actions on the underlaying managed objects are
	// being performed. Only delete actions will be performed.
	Paused bool `json:"paused"`
	// Total number of non-terminated pods targeted by this Alertmanager
	// cluster (their labels match the selector).
	Replicas int32 `json:"replicas"`
	// Total number of non-terminated pods targeted by this Alertmanager
	// cluster that have the desired version spec.
	UpdatedReplicas int32 `json:"updatedReplicas"`
	// Total number of available pods (ready for at least minReadySeconds)
	// targeted by this Alertmanager cluster.
	AvailableReplicas int32 `json:"availableReplicas"`
	// Total number of unavailable pods targeted by this Alertmanager cluster.
	UnavailableReplicas int32 `json:"unavailableReplicas"`
}

type AlertmanagersGetter

type AlertmanagersGetter interface {
	Alertmanagers(namespace string) AlertmanagerInterface
}

type Endpoint

type Endpoint struct {
	// Name of the service port this endpoint refers to. Mutually exclusive with targetPort.
	Port string `json:"port,omitempty"`
	// Name or number of the target port of the endpoint. Mutually exclusive with port.
	TargetPort intstr.IntOrString `json:"targetPort,omitempty"`
	// HTTP path to scrape for metrics.
	Path string `json:"path,omitempty"`
	// HTTP scheme to use for scraping.
	Scheme string `json:"scheme,omitempty"`
	// Interval at which metrics should be scraped
	Interval string `json:"interval,omitempty"`
	// TLS configuration to use when scraping the endpoint
	TLSConfig *TLSConfig `json:"tlsConfig,omitempty"`
	// File to read bearer token for scraping targets.
	BearerTokenFile string `json:"bearerTokenFile,omitempty"`
}

Endpoint defines a scrapeable endpoint serving Prometheus metrics.

type MonitoringV1alpha1Client

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

func NewForConfig

func NewForConfig(c *rest.Config) (*MonitoringV1alpha1Client, error)

func (*MonitoringV1alpha1Client) Alertmanagers

func (c *MonitoringV1alpha1Client) Alertmanagers(namespace string) AlertmanagerInterface

func (*MonitoringV1alpha1Client) Prometheuses

func (c *MonitoringV1alpha1Client) Prometheuses(namespace string) PrometheusInterface

func (*MonitoringV1alpha1Client) RESTClient

func (c *MonitoringV1alpha1Client) RESTClient() rest.Interface

func (*MonitoringV1alpha1Client) ServiceMonitors

func (c *MonitoringV1alpha1Client) ServiceMonitors(namespace string) ServiceMonitorInterface

type MonitoringV1alpha1Interface

type MonitoringV1alpha1Interface interface {
	RESTClient() rest.Interface
	PrometheusesGetter
	AlertmanagersGetter
	ServiceMonitorsGetter
}

type NamespaceSelector

type NamespaceSelector struct {
	Any        bool     `json:"any,omitempty"`
	MatchNames []string `json:"matchNames,omitempty"`
}

type Prometheus

type Prometheus struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              PrometheusSpec    `json:"spec"`
	Status            *PrometheusStatus `json:"status,omitempty"`
}

Prometheus defines a Prometheus deployment.

func PrometheusFromUnstructured

func PrometheusFromUnstructured(r *unstructured.Unstructured) (*Prometheus, error)

PrometheusFromUnstructured unmarshals a Prometheus object from dynamic client's unstructured

type PrometheusInterface

type PrometheusInterface interface {
	Create(*Prometheus) (*Prometheus, error)
	Get(name string) (*Prometheus, error)
	Update(*Prometheus) (*Prometheus, error)
	Delete(name string, options *v1.DeleteOptions) error
	List(opts metav1.ListOptions) (runtime.Object, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
}

type PrometheusList

type PrometheusList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []*Prometheus `json:"items"`
}

PrometheusList is a list of Prometheuses.

type PrometheusSpec

type PrometheusSpec struct {
	// ServiceMonitors to be selected for target discovery.
	ServiceMonitorSelector *metav1.LabelSelector `json:"serviceMonitorSelector,omitempty"`
	// Version of Prometheus to be deployed.
	Version string `json:"version,omitempty"`
	// When a Prometheus deployment is paused, no actions except for deletion
	// will be performed on the underlying objects.
	Paused bool `json:"paused,omitempty"`
	// Base image to use for a Prometheus deployment.
	BaseImage string `json:"baseImage,omitempty"`
	// Number of instances to deploy for a Prometheus deployment.
	Replicas int32 `json:"replicas,omitempty"`
	// Time duration Prometheus shall retain data for.
	Retention string `json:"retention,omitempty"`
	// The external URL the Prometheus instances will be available under. This is
	// necessary to generate correct URLs. This is necessary if Prometheus is not
	// served from root of a DNS name.
	ExternalURL string `json:"externalUrl,omitempty"`
	// The route prefix Prometheus registers HTTP handlers for. This is useful,
	// if using ExternalURL and a proxy is rewriting HTTP routes of a request,
	// and the actual ExternalURL is still true, but the server serves requests
	// under a different route prefix. For example for use with `kubectl proxy`.
	RoutePrefix string `json:"routePrefix,omitempty"`
	// Storage spec to specify how storage shall be used.
	Storage *StorageSpec `json:"storage,omitempty"`
	// Define details regarding alerting.
	Alerting AlertingSpec `json:"alerting,omitempty"`
	// Define resources requests and limits for single Pods.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`
	// Define which Nodes the Pods are scheduled on.
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
}

PrometheusSpec holds specification parameters of a Prometheus deployment.

type PrometheusStatus

type PrometheusStatus struct {
	// Represents whether any actions on the underlaying managed objects are
	// being performed. Only delete actions will be performed.
	Paused bool `json:"paused"`
	// Total number of non-terminated pods targeted by this Prometheus deployment
	// (their labels match the selector).
	Replicas int32 `json:"replicas"`
	// Total number of non-terminated pods targeted by this Prometheus deployment
	// that have the desired version spec.
	UpdatedReplicas int32 `json:"updatedReplicas"`
	// Total number of available pods (ready for at least minReadySeconds)
	// targeted by this Prometheus deployment.
	AvailableReplicas int32 `json:"availableReplicas"`
	// Total number of unavailable pods targeted by this Prometheus deployment.
	UnavailableReplicas int32 `json:"unavailableReplicas"`
}

type PrometheusesGetter

type PrometheusesGetter interface {
	Prometheuses(namespace string) PrometheusInterface
}

type ServiceMonitor

type ServiceMonitor struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ServiceMonitorSpec `json:"spec"`
}

ServiceMonitor defines monitoring for a set of services.

func ServiceMonitorFromUnstructured

func ServiceMonitorFromUnstructured(r *unstructured.Unstructured) (*ServiceMonitor, error)

ServiceMonitorFromUnstructured unmarshals a ServiceMonitor object from dynamic client's unstructured

type ServiceMonitorInterface

type ServiceMonitorInterface interface {
	Create(*ServiceMonitor) (*ServiceMonitor, error)
	Get(name string) (*ServiceMonitor, error)
	Update(*ServiceMonitor) (*ServiceMonitor, error)
	Delete(name string, options *v1.DeleteOptions) error
	List(opts metav1.ListOptions) (runtime.Object, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
}

type ServiceMonitorList

type ServiceMonitorList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []*ServiceMonitor `json:"items"`
}

ServiceMonitorList is a list of ServiceMonitors.

type ServiceMonitorSpec

type ServiceMonitorSpec struct {
	// The label to use to retrieve the job name from.
	JobLabel string `json:"jobLabel,omitempty"`
	// A list of endpoints allowed as part of this ServiceMonitor.
	Endpoints []Endpoint `json:"endpoints,omitempty"`
	// Selector to select Endpoints objects.
	Selector metav1.LabelSelector `json:"selector"`
	// Selector to select which namespaces the Endpoints objects are discovered from.
	NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"`
}

ServiceMonitorSpec contains specification parameters for a ServiceMonitor.

type ServiceMonitorsGetter

type ServiceMonitorsGetter interface {
	ServiceMonitors(namespace string) *dynamic.ResourceClient
}

type StorageSpec

type StorageSpec struct {
	// Name of the StorageClass to use when requesting storage provisioning. More
	// info: https://kubernetes.io/docs/user-guide/persistent-volumes/#storageclasses
	Class string `json:"class"`
	// A label query over volumes to consider for binding.
	Selector *metav1.LabelSelector `json:"selector"`
	// Resources represents the minimum resources the volume should have. More
	// info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources
	Resources v1.ResourceRequirements `json:"resources"`
}

StorageSpec defines the configured storage for a group Prometheus servers.

type TLSConfig

type TLSConfig struct {
	// The CA cert to use for the targets.
	CAFile string `yaml:"caFile,omitempty"`
	// The client cert file for the targets.
	CertFile string `yaml:"certFile,omitempty"`
	// The client key file for the targets.
	KeyFile string `yaml:"keyFile,omitempty"`
	// Used to verify the hostname for the targets.
	ServerName string `yaml:"serverName,omitempty"`
	// Disable target certificate validation.
	InsecureSkipVerify bool `yaml:"insecureSkipVerify,omitempty"`
}

TLSConfig specifies TLS configuration parameters.

Jump to

Keyboard shortcuts

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