Documentation
¶
Overview ¶
Package kubernetes implements a kubernetes resources provider for ResourceDiscovery server.
See:
ResourceTypes variable for the list of supported resource types. SupportedFilters variable for the list of supported filters.
Kubernetes provider is configured through a protobuf based config file (proto/config.proto). Example config:
{ pods {} }
Index ¶
Constants ¶
const DefaultProviderID = "k8s"
DefaultProviderID is the povider id to use for this provider if a provider id is not configured explicitly.
Variables ¶
var ( LocalCACert = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" LocalTokenFile = "/var/run/secrets/kubernetes.io/serviceaccount/token" )
Variables defined by Kubernetes spec to find out local CA cert and token.
var ResourceTypes = struct { Pods, Endpoints, Services string }{ "pods", "endpoints", "services", }
ResourceTypes declares resource types supported by the Kubernetes provider.
var SupportedFilters = struct { RegexFilterKeys []string LabelsFilter bool }{ []string{"name", "namespace", "port"}, true, }
SupportedFilters defines filters supported by this provider.
Example filters: filter { key: "name" value: "cloudprober.*" } filter { key: "namespace" value: "teamx.*" } filter { key: "port" value: "http.*" } filter { key: "labels.app" value: "service-a" }
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements a Kubernetes (K8s) provider for use with a ResourceDiscovery server.
func (*Provider) ListResources ¶
func (p *Provider) ListResources(req *pb.ListResourcesRequest) (*pb.ListResourcesResponse, error)
ListResources returns the list of resources from the cache.