kubernetes

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

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

View Source
const DefaultProviderID = "k8s"

DefaultProviderID is the povider id to use for this provider if a provider id is not configured explicitly.

Variables

View Source
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.

View Source
var ResourceTypes = struct {
	Pods, Endpoints, Services, Ingresses string
}{
	"pods",
	"endpoints",
	"services",
	"ingresses",
}

ResourceTypes declares resource types supported by the Kubernetes provider.

View Source
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 New

New creates a Kubernetes (k8s) provider for RDS server, based on the provided config.

func (*Provider) ListResources

func (p *Provider) ListResources(req *pb.ListResourcesRequest) (*pb.ListResourcesResponse, error)

ListResources returns the list of resources from the cache.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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