kubernetes

package
v1.39.2-cluster Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLabels added in v1.35.0

func GetLabels(sdc *SDConfig, baseDir string) ([]map[string]string, error)

GetLabels returns labels for the given sdc and baseDir.

Types

type Container

type Container struct {
	Name  string
	Ports []ContainerPort
}

Container implements k8s container.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#container-v1-core

type ContainerPort

type ContainerPort struct {
	Name          string
	ContainerPort int
	Protocol      string
}

ContainerPort implements k8s container port.

type DaemonEndpoint

type DaemonEndpoint struct {
	Port int
}

DaemonEndpoint represents DaemonEndpoint from k8s API.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#daemonendpoint-v1-core

type EndpointAddress

type EndpointAddress struct {
	Hostname  string
	IP        string
	NodeName  string
	TargetRef ObjectReference
}

EndpointAddress implements k8s endpoint address.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#endpointaddress-v1-core

type EndpointPort

type EndpointPort struct {
	AppProtocol string
	Name        string
	Port        int
	Protocol    string
}

EndpointPort implements k8s endpoint port.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#endpointport-v1beta1-discovery-k8s-io

type EndpointSubset

type EndpointSubset struct {
	Addresses         []EndpointAddress
	NotReadyAddresses []EndpointAddress
	Ports             []EndpointPort
}

EndpointSubset implements k8s endpoint subset.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#endpointsubset-v1-core

type Endpoints

type Endpoints struct {
	Metadata ObjectMeta
	Subsets  []EndpointSubset
}

Endpoints implements k8s endpoints.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#endpoints-v1-core

type EndpointsList

type EndpointsList struct {
	Items []Endpoints
}

EndpointsList implements k8s endpoints list.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#endpointslist-v1-core

type HTTPIngressPath

type HTTPIngressPath struct {
	Path string
}

HTTPIngressPath represents HTTP ingress path in k8s.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#httpingresspath-v1beta1-extensions

type HTTPIngressRuleValue

type HTTPIngressRuleValue struct {
	Paths []HTTPIngressPath
}

HTTPIngressRuleValue represents HTTP ingress rule value in k8s.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#httpingressrulevalue-v1beta1-extensions

type Ingress

type Ingress struct {
	Metadata ObjectMeta
	Spec     IngressSpec
}

Ingress represents ingress in k8s.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#ingress-v1beta1-extensions

type IngressList

type IngressList struct {
	Items []Ingress
}

IngressList represents ingress list in k8s.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#ingresslist-v1beta1-extensions

type IngressRule

type IngressRule struct {
	Host string
	HTTP HTTPIngressRuleValue `json:"http"`
}

IngressRule represents ingress rule in k8s.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#ingressrule-v1beta1-extensions

type IngressSpec

type IngressSpec struct {
	TLS   []IngressTLS `json:"tls"`
	Rules []IngressRule
}

IngressSpec represents ingress spec in k8s.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#ingressspec-v1beta1-extensions

type IngressTLS

type IngressTLS struct {
	Hosts []string
}

IngressTLS represents ingress TLS spec in k8s.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#ingresstls-v1beta1-extensions

type Namespaces added in v1.35.0

type Namespaces struct {
	Names []string `yaml:"names"`
}

Namespaces represents namespaces for SDConfig

type Node

type Node struct {
	Metadata ObjectMeta
	Status   NodeStatus
}

Node represents Node from k8s API.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#node-v1-core

type NodeAddress

type NodeAddress struct {
	Type    string
	Address string
}

NodeAddress represents NodeAddress from k8s API.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodeaddress-v1-core

type NodeDaemonEndpoints

type NodeDaemonEndpoints struct {
	KubeletEndpoint DaemonEndpoint
}

NodeDaemonEndpoints represents NodeDaemonEndpoints from k8s API.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodedaemonendpoints-v1-core

type NodeList

type NodeList struct {
	Items []Node
}

NodeList represents NodeList from k8s API.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodelist-v1-core

type NodeStatus

type NodeStatus struct {
	Addresses       []NodeAddress
	DaemonEndpoints NodeDaemonEndpoints
}

NodeStatus represents NodeStatus from k8s API.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#nodestatus-v1-core

type ObjectMeta

type ObjectMeta struct {
	Name            string
	Namespace       string
	UID             string
	Labels          discoveryutils.SortedLabels
	Annotations     discoveryutils.SortedLabels
	OwnerReferences []OwnerReference
}

ObjectMeta represents ObjectMeta from k8s API.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#objectmeta-v1-meta

type ObjectReference

type ObjectReference struct {
	Kind      string
	Name      string
	Namespace string
}

ObjectReference implements k8s object reference.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#objectreference-v1-core

type OwnerReference

type OwnerReference struct {
	Name       string
	Controller bool
	Kind       string
}

OwnerReference represents OwnerReferense from k8s API.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#ownerreference-v1-meta

type Pod

type Pod struct {
	Metadata ObjectMeta
	Spec     PodSpec
	Status   PodStatus
}

Pod implements k8s pod.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#pod-v1-core

type PodCondition

type PodCondition struct {
	Type   string
	Status string
}

PodCondition implements k8s pod condition.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podcondition-v1-core

type PodList

type PodList struct {
	Items []Pod
}

PodList implements k8s pod list.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podlist-v1-core

type PodSpec

type PodSpec struct {
	NodeName       string
	Containers     []Container
	InitContainers []Container
}

PodSpec implements k8s pod spec.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podspec-v1-core

type PodStatus

type PodStatus struct {
	Phase      string
	PodIP      string
	HostIP     string
	Conditions []PodCondition
}

PodStatus implements k8s pod status.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#podstatus-v1-core

type SDConfig added in v1.35.0

type SDConfig struct {
	APIServer       string                    `yaml:"api_server"`
	Role            string                    `yaml:"role"`
	BasicAuth       *promauth.BasicAuthConfig `yaml:"basic_auth"`
	BearerToken     string                    `yaml:"bearer_token"`
	BearerTokenFile string                    `yaml:"bearer_token_file"`
	TLSConfig       *promauth.TLSConfig       `yaml:"tls_config"`
	Namespaces      Namespaces                `yaml:"namespaces"`
	Selectors       []Selector                `yaml:"selectors"`
}

SDConfig represents kubernetes-based service discovery config.

See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config

type Selector

type Selector struct {
	Role  string `yaml:"role"`
	Label string `yaml:"label"`
	Field string `yaml:"field"`
}

Selector represents kubernetes selector.

See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/ and https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/

type Service

type Service struct {
	Metadata ObjectMeta
	Spec     ServiceSpec
}

Service is k8s service.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#service-v1-core

type ServiceList

type ServiceList struct {
	Items []Service
}

ServiceList is k8s service list.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#servicelist-v1-core

type ServicePort

type ServicePort struct {
	Name     string
	Protocol string
	Port     int
}

ServicePort is k8s service port.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#serviceport-v1-core

type ServiceSpec

type ServiceSpec struct {
	ClusterIP    string
	ExternalName string
	Type         string
	Ports        []ServicePort
}

ServiceSpec is k8s service spec.

See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#servicespec-v1-core

Jump to

Keyboard shortcuts

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