Documentation ¶
Overview ¶
Package kubernetes implements helper functions for manipulating resources in a Kubernetes cluster.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeKubernetes ¶
FakeKubernetes is a fake implementation of the Kubernetes interface
func NewFakeKubernetes ¶
func NewFakeKubernetes(clientset *fake.Clientset) (*FakeKubernetes, error)
NewFakeKubernetes returns a new fake implementation of Kubernetes from fake Clientset
func (*FakeKubernetes) Context ¶
func (f *FakeKubernetes) Context() context.Context
Context returns the context for executing k8s actions
func (*FakeKubernetes) GetFakeProcessExecutor ¶
func (f *FakeKubernetes) GetFakeProcessExecutor() *helpers.FakePodCommandExecutor
GetFakeProcessExecutor returns the FakeProcessExecutor used by the helpers to mock the execution of commands in a Pod
func (*FakeKubernetes) Helpers ¶
func (f *FakeKubernetes) Helpers() helpers.Helpers
Helpers return a instance of FakeHelper
func (*FakeKubernetes) NamespacedHelpers ¶
func (f *FakeKubernetes) NamespacedHelpers(namespace string) helpers.Helpers
NamespacedHelpers return a instance of FakeHelper for a given namespace
type Kubernetes ¶
type Kubernetes interface { kubernetes.Interface Context() context.Context Helpers() helpers.Helpers NamespacedHelpers(namespace string) helpers.Helpers }
Kubernetes defines an interface that extends kubernetes interface[k8s.io/client-go/kubernetes.Interface] Adding helper functions for common tasks
func New ¶ added in v0.1.3
func New(ctx context.Context) (Kubernetes, error)
New returns a Kubernetes instance or an error when no config is eligible to be used. there are three ways of loading the kubernetes config, using the order as they are described below 1. in-cluster config, from serviceAccount token. 2. KUBECONFIG environment variable. 3. $HOME/.kube/config file.
func NewFromKubeconfig ¶
func NewFromKubeconfig(ctx context.Context, kubeconfig string) (Kubernetes, error)
NewFromKubeconfig returns a Kubernetes instance configured with the kubeconfig pointed by the given path