Documentation ¶
Overview ¶
Package k8sclient enables interaction with Kubernetes using both a typed client and a dynamic client
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Client = *NewKubeClient(cli.New())
Client is a global variable. Before use, it must be assigned and initialized
Functions ¶
This section is empty.
Types ¶
type KubeClient ¶
type KubeClient struct { // EnvSettings provides generic Kubernets and Helm options; while Helm is not needed // for A/B/n functionality, we use here since we do so in other places and it // provides an easy way to get the Kubernetes configuration whether in cluster or not. *cli.EnvSettings // contains filtered or unexported fields }
KubeClient embeds Kube configuration, and enables interaction with a Kubernetes cluster through Kube APIs
func NewFakeKubeClient ¶
func NewFakeKubeClient(s *cli.EnvSettings, objects ...runtime.Object) *KubeClient
NewFakeKubeClient returns a fake Kubernetes client that is able to manage secrets Includes dynamic client with Deployments as listed objects Used by test cases in several packages to define (global) k8sclient.Client for testing
func NewKubeClient ¶
func NewKubeClient(s *cli.EnvSettings) *KubeClient
NewKubeClient returns a KubeClient with the given settings. Must be initialized before it can be used.
func (*KubeClient) Dynamic ¶
func (c *KubeClient) Dynamic() dynamic.Interface
Dynamic is the dynamic (untyped) k8s client interface
func (*KubeClient) Initialize ¶
func (c *KubeClient) Initialize() (err error)
Initialize initializes the Kubernetes clientset
func (*KubeClient) Typed ¶
func (c *KubeClient) Typed() kubernetes.Interface
Typed is the typed k8s client interface