Documentation ¶
Index ¶
- func NewRateLimiterLatencyMetric(metricStorage MetricStorage) metrics.LatencyMetricdeprecated
- func NewRequestResultMetric(metricStorage MetricStorage, labels map[string]string) metrics.ResultMetricdeprecated
- func RegisterKubernetesClientMetrics(metricStorage MetricStorage, metricLabels map[string]string)deprecated
- type Client
- func (c *Client) APIResource(apiVersion, kind string) (*metav1.APIResource, error)
- func (c *Client) APIResourceList(apiVersion string) (lists []*metav1.APIResourceList, err error)
- func (c *Client) ApiExt() apixv1client.ApiextensionsV1Interface
- func (c *Client) DefaultNamespace() string
- func (c *Client) Dynamic() dynamic.Interface
- func (c *Client) GroupVersionResource(apiVersion, kind string) (gvr schema.GroupVersionResource, err error)
- func (c *Client) Init() error
- func (c *Client) InvalidateDiscoveryCache()
- func (c *Client) Metadata() metadata.Interface
- func (c *Client) ReloadDynamic(gvrList map[schema.GroupVersionResource]string)
- func (c *Client) RestConfig() *rest.Config
- func (c *Client) WithConfigPath(path string)
- func (c *Client) WithContextName(name string)
- func (c *Client) WithMetricLabels(labels map[string]string)
- func (c *Client) WithMetricStorage(metricStorage MetricStorage)
- func (c *Client) WithRateLimiterSettings(qps float32, burst int)
- func (c *Client) WithServer(server string)
- func (c *Client) WithTimeout(timeout time.Duration)
- type ClientRateLimiterLatencyMetricdeprecated
- type ClientRequestResultMetric
- type MetricStoragedeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRateLimiterLatencyMetric
deprecated
func NewRateLimiterLatencyMetric(metricStorage MetricStorage) metrics.LatencyMetric
Deprecated: to be removed since it is not a part of the client to support
func NewRequestResultMetric
deprecated
func NewRequestResultMetric(metricStorage MetricStorage, labels map[string]string) metrics.ResultMetric
Deprecated: to be removed since it is not a part of the client to support
func RegisterKubernetesClientMetrics
deprecated
func RegisterKubernetesClientMetrics(metricStorage MetricStorage, metricLabels map[string]string)
Deprecated: RegisterKubernetesClientMetrics defines metrics in Prometheus client.
Types ¶
type Client ¶
type Client struct { kubernetes.Interface // contains filtered or unexported fields }
func (*Client) APIResource ¶
func (c *Client) APIResource(apiVersion, kind string) (*metav1.APIResource, error)
APIResource fetches APIResource object from cluster that specifies the name of a resource and whether it is namespaced. if resource not found, we try to invalidate cache and
NOTE that fetching with empty apiVersion can give errors if there are non-working api controllers in cluster.
func (*Client) APIResourceList ¶
func (c *Client) APIResourceList(apiVersion string) (lists []*metav1.APIResourceList, err error)
APIResourceList fetches lists of APIResource objects from cluster. It returns all preferred resources if apiVersion is empty. An array with one list is returned if apiVersion is valid.
NOTE that fetching all preferred resources can give errors if there are non-working api controllers in cluster.
func (*Client) ApiExt ¶
func (c *Client) ApiExt() apixv1client.ApiextensionsV1Interface
func (*Client) DefaultNamespace ¶
func (*Client) GroupVersionResource ¶
func (c *Client) GroupVersionResource(apiVersion, kind string) (gvr schema.GroupVersionResource, err error)
GroupVersionResource returns a GroupVersionResource object to use with dynamic informer.
This method is borrowed from kubectl and kubedog. The difference are: - lower case comparison with kind, name and all short names
func (*Client) InvalidateDiscoveryCache ¶
func (c *Client) InvalidateDiscoveryCache()
InvalidateDiscoveryCache allows you to invalidate cache manually, for example, when you are deploying CRD KubeClient tries to invalidate cache automatically when needed, but you can save a few resources to call this manually
func (*Client) ReloadDynamic ¶
func (c *Client) ReloadDynamic(gvrList map[schema.GroupVersionResource]string)
ReloadDynamic creates new dynamic client with the new set of CRDs.
func (*Client) RestConfig ¶
RestConfig returns kubernetes Config with the common attributes that was passed on initialization.
func (*Client) WithConfigPath ¶
func (*Client) WithContextName ¶
func (*Client) WithMetricLabels ¶
func (*Client) WithMetricStorage ¶
func (c *Client) WithMetricStorage(metricStorage MetricStorage)
func (*Client) WithRateLimiterSettings ¶
func (*Client) WithServer ¶
func (*Client) WithTimeout ¶
type ClientRateLimiterLatencyMetric
deprecated
type ClientRateLimiterLatencyMetric struct {
// contains filtered or unexported fields
}
Deprecated: to be removed since it is not a part of the client to support
type ClientRequestResultMetric ¶
type ClientRequestResultMetric struct {
// contains filtered or unexported fields
}
func (ClientRequestResultMetric) Increment
deprecated
func (c ClientRequestResultMetric) Increment(_ context.Context, code, method, host string)
Deprecated: ClientRequestResultMetric
type MetricStorage
deprecated
type MetricStorage interface { RegisterCounter(metric string, labels map[string]string) *prometheus.CounterVec CounterAdd(metric string, value float64, labels map[string]string) RegisterHistogram(metric string, labels map[string]string, buckets []float64) *prometheus.HistogramVec HistogramObserve(metric string, value float64, labels map[string]string, buckets []float64) }
Deprecated: MetricStorage contains methods from flant/shell-operator metric storage. The metrics support is to be deleted from this library. It is left for the time being.