k8s

package
v1.5.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocalIP

func GetLocalIP() (string, error)

GetLocalIP returns the non loopback local IP of the host

func NodeNameFilter added in v1.5.3

func NodeNameFilter(nodeName string) internalinterfaces.TweakListOptionsFunc

NodeNameFilter will tweak the options to include the node name as field selector.

Types

type Client

type Client interface {
	// Start just starts any informers required.
	Start(<-chan struct{})
	// GetPodInfo returns the pod name, namespace & replica set name for a given pod ip
	GetPodInfo(podip string) (podns, podname, rsName string, selectors *metav1.LabelSelector, err error)
	// ListPodIds pod matching azure identity or nil
	ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error)
	// GetSecret returns secret the secretRef represents
	GetSecret(secretRef *v1.SecretReference) (*v1.Secret, error)
	// ListPodIdentityExceptions returns list of azurepodidentityexceptions
	ListPodIdentityExceptions(namespace string) (*[]aadpodid.AzurePodIdentityException, error)
}

Client api client

func NewFakeClient

func NewFakeClient() (Client, error)

NewFakeClient new fake kubernetes api client

func NewKubeClient

func NewKubeClient(log inlog.Logger, nodeName string, scale bool) (Client, error)

NewKubeClient new kubernetes api client

type FakeClient

type FakeClient struct {
}

FakeClient implements Interface

func (*FakeClient) GetPodInfo

func (c *FakeClient) GetPodInfo(podip string) (podns, podname, rsName string, selectors *metav1.LabelSelector, err error)

GetPodInfo returns fake pod name, namespace and replicaset

func (*FakeClient) GetSecret

func (c *FakeClient) GetSecret(secretRef *v1.SecretReference) (*v1.Secret, error)

GetSecret returns secret the secretRef represents

func (*FakeClient) ListPodIdentityExceptions

func (c *FakeClient) ListPodIdentityExceptions(ns string) (*[]aadpodid.AzurePodIdentityException, error)

ListPodIdentityExceptions ...

func (*FakeClient) ListPodIds

func (c *FakeClient) ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error)

ListPodIds for pod

func (*FakeClient) Start added in v1.5.3

func (c *FakeClient) Start(exit <-chan struct{})

Start - for starting informer clients in the fake Client

type KubeClient

type KubeClient struct {
	// Main Kubernetes client
	ClientSet kubernetes.Interface
	// Crd client used to access our CRD resources.
	CrdClient   *crd.Client
	PodInformer cache.SharedIndexInformer
	// contains filtered or unexported fields
}

KubeClient k8s client

func (*KubeClient) GetPodInfo

func (c *KubeClient) GetPodInfo(podip string) (podns, poddname, rsName string, labels *metav1.LabelSelector, err error)

GetPodInfo get pod ns,name from apiserver

func (*KubeClient) GetSecret

func (c *KubeClient) GetSecret(secretRef *v1.SecretReference) (*v1.Secret, error)

GetSecret returns secret the secretRef represents

func (*KubeClient) ListPodIdentityExceptions

func (c *KubeClient) ListPodIdentityExceptions(ns string) (*[]aadpodid.AzurePodIdentityException, error)

ListPodIdentityExceptions lists azurepodidentityexceptions

func (*KubeClient) ListPodIds

func (c *KubeClient) ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error)

ListPodIds lists matching ids for pod or error

func (*KubeClient) Start added in v1.5.3

func (c *KubeClient) Start(exit <-chan struct{})

Start the corresponding starts

func (*KubeClient) Sync added in v1.5.3

func (c *KubeClient) Sync(exit <-chan struct{})

Jump to

Keyboard shortcuts

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