utils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNodeIPOrName

func GetNodeIPOrName(ctx context.Context, kubeClient clientset.Interface, name string) string

GetNodeIPOrName returns the IP address or the name of a node in the cluster

func ParseNameNS

func ParseNameNS(input string) (string, string, error)

ParseNameNS parses a string searching a namespace and name

Types

type Endpoint

type Endpoint struct {
	// Address IP address of the endpoint
	Address string `json:"address"`
	// Port number of the TCP port
	Port string `json:"port"`
}

Endpoint describes a kubernetes endpoint, same as a target in Kong.

type Info

type Info struct {
	KubernetesVersion string
	KongVersion       string
	KICVersion        string
	Hostname          string
	KongDB            string
	ID                string
}

Info holds the metadata to be sent as part of a report.

type IngressAPI

type IngressAPI int
const (
	OtherAPI          IngressAPI = iota
	NetworkingV1      IngressAPI = iota
	NetworkingV1beta1 IngressAPI = iota
	ExtensionsV1beta1 IngressAPI = iota
)

func NegotiateResourceAPI

func NegotiateResourceAPI(client discovery.ServerResourcesInterface, kind string, allowedVersions []IngressAPI,
) (IngressAPI, error)

func (IngressAPI) String

func (ia IngressAPI) String() string

type PodInfo

type PodInfo struct {
	Name      string
	Namespace string
	NodeIP    string
	// Labels selectors of the running pod
	// This is used to search for other Ingress controller pods
	Labels map[string]string
}

PodInfo contains runtime information about the pod running the Ingres controller

func GetPodDetails

func GetPodDetails(ctx context.Context, kubeClient clientset.Interface) (*PodInfo, error)

GetPodDetails returns runtime information about the pod: name, namespace and IP of the node where it is running

type RawSSLCert

type RawSSLCert struct {
	Cert []byte
	Key  []byte
}

RawSSLCert represnts TLS cert and key in bytes

type Reporter

type Reporter struct {
	Info Info

	Logger logrus.FieldLogger
	// contains filtered or unexported fields
}

Reporter sends anonymous reports of runtime properties and errors in Kong.

func (Reporter) Run

func (r Reporter) Run(done <-chan struct{})

Run starts the reporter. It will send reports until done is closed.

Jump to

Keyboard shortcuts

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