Documentation ¶
Overview ¶
Package k8s contains a client for accessing the kubernetes API.
Index ¶
- func GetKubeConfig() string
- type Client
- type ClientImpl
- func (k *ClientImpl) APIExtensionClientSet() apiextension.Interface
- func (k *ClientImpl) APIRegistrationClientSet() aggregator.Interface
- func (k *ClientImpl) ClientSet() kubernetes.Interface
- func (k *ClientImpl) Config() *rest.Config
- func (k *ClientImpl) DynamicClientSet() dynamic.Interface
- func (k *ClientImpl) HelmAction(namespace string) (*action.Configuration, error)
- func (k *ClientImpl) MeshExists() (bool, error)
- func (k *ClientImpl) MetricsClientSet() metrics.Interface
- func (k *ClientImpl) Namespace() string
- type HelmInvoker
- type HelmWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { Config() *rest.Config Namespace() string ClientSet() kubernetes.Interface APIExtensionClientSet() apiextension.Interface APIRegistrationClientSet() aggregator.Interface MetricsClientSet() metrics.Interface DynamicClientSet() dynamic.Interface MeshExists() (bool, error) HelmAction(namespace string) (*action.Configuration, error) }
Client is a k8s client wrapper for interacting with mesh objects.
type ClientImpl ¶
type ClientImpl struct { Clientset kubernetes.Interface HelmInvoker HelmWrapper APIExtensionClientset apiextension.Interface // contains filtered or unexported fields }
ClientImpl contains the configuration and clients for a Kubernetes cluster.
func NewK8SClient ¶
func NewK8SClient(kubeconfig, namespace string) (*ClientImpl, error)
NewK8SClient creates a mesh K8s client from a kubeconfig and control plane namespace.
func (*ClientImpl) APIExtensionClientSet ¶
func (k *ClientImpl) APIExtensionClientSet() apiextension.Interface
APIExtensionClientSet returns the APIExtensionClientSet interface.
func (*ClientImpl) APIRegistrationClientSet ¶
func (k *ClientImpl) APIRegistrationClientSet() aggregator.Interface
APIRegistrationClientSet returns the APIRegistrationClientSet interface.
func (*ClientImpl) ClientSet ¶
func (k *ClientImpl) ClientSet() kubernetes.Interface
ClientSet returns the ClientSet interface.
func (*ClientImpl) Config ¶
func (k *ClientImpl) Config() *rest.Config
Config returns a k8s rest.Config object.
func (*ClientImpl) DynamicClientSet ¶
func (k *ClientImpl) DynamicClientSet() dynamic.Interface
DynamicClientSet returns the DynamicClientset interface.
func (*ClientImpl) HelmAction ¶
func (k *ClientImpl) HelmAction(namespace string) (*action.Configuration, error)
HelmAction builds an action configuration for helm requests.
func (*ClientImpl) MeshExists ¶
func (k *ClientImpl) MeshExists() (bool, error)
MeshExists returns if the mesh exists or not.
func (*ClientImpl) MetricsClientSet ¶
func (k *ClientImpl) MetricsClientSet() metrics.Interface
MetricsClientSet returns the MetricsClientset interface.
func (*ClientImpl) Namespace ¶
func (k *ClientImpl) Namespace() string
Namespace returns the control plane namespace.
type HelmInvoker ¶
type HelmInvoker struct {
// contains filtered or unexported fields
}
HelmInvoker is a struct that satisfies HelmWrapper.
func (*HelmInvoker) HelmAction ¶
func (hi *HelmInvoker) HelmAction(namespace string) (*action.Configuration, error)
HelmAction builds an action configuration for helm requests.
type HelmWrapper ¶
type HelmWrapper interface {
HelmAction(namespace string) (*action.Configuration, error)
}
HelmWrapper wraps the HelmAction function as an interface.
func NewHelmInvoker ¶
func NewHelmInvoker(kubeconfig, namespace string, deferredClientConfig clientcmd.ClientConfig) HelmWrapper
NewHelmInvoker returns a HelmInvoker satisfying the HelmWrapper Interface.