Documentation ¶
Index ¶
- func FindNodeRoles(node *corev1.Node) []string
- func GetObjectsFromYAML(s, namespace string) (objs []runtime.Object, err error)
- func GetScheme() *runtime.Scheme
- func GetUnstructuredFromYAML(s, namespace string) (objs []*unstructured.Unstructured, err error)
- func NodeStatus(node *corev1.Node) (status []string)
- func PodStatus(pod *corev1.Pod) (reason string)
- func RolloutStatus(obj runtime.Object) (msg string, done bool, err error)
- type Client
- type ClientImpl
- func (c *ClientImpl) GetContext() context.Context
- func (c *ClientImpl) GetDiscoveryClient() discovery.DiscoveryInterface
- func (c *ClientImpl) GetDynamicClient() dynamic.Interface
- func (c *ClientImpl) GetKubeClient() kubernetes.Interface
- func (c *ClientImpl) GetRESTConfig() *rest.Config
- func (c *ClientImpl) GetRESTMapper() meta.RESTMapper
- func (c *ClientImpl) IsReady(obj runtime.Object) (ready bool, err error)
- func (c *ClientImpl) IsReadyWithUpdate(obj runtime.Object) (ready bool, retObj runtime.Object, err error)
- func (c *ClientImpl) KindToMapping(gvk schema.GroupVersionKind) (mapping *meta.RESTMapping, err error)
- func (c *ClientImpl) ListAllResources(namespace string) (objs []unstructured.Unstructured, err error)
- func (c *ClientImpl) ModelToMapping(model runtime.Object) (mapping *meta.RESTMapping, err error)
- func (c *ClientImpl) Ping() error
- func (c *ClientImpl) ResourceToMapping(gvr schema.GroupVersionResource) (mapping *meta.RESTMapping, err error)
- func (c *ClientImpl) SetContext(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindNodeRoles ¶
FindNodeRoles returns the roles of a given node. The roles are determined by looking for: * a node-role.kubernetes.io/<role>="" label * a kubernetes.io/role="<role>" label
func GetObjectsFromYAML ¶
GetObjectsFromYAML get actual object from yaml text
func GetUnstructuredFromYAML ¶
func GetUnstructuredFromYAML(s, namespace string) (objs []*unstructured.Unstructured, err error)
func NodeStatus ¶
func PodStatus ¶
PodStatus returns the pod's current status source code: https://github.com/kubernetes/kubernetes/blob/master/pkg/printers/internalversion/printers.go#L740
Types ¶
type Client ¶
type Client interface { GetContext() context.Context SetContext(ctx context.Context) GetRESTConfig() *rest.Config GetKubeClient() kubernetes.Interface GetDynamicClient() dynamic.Interface GetDiscoveryClient() discovery.DiscoveryInterface GetRESTMapper() meta.RESTMapper // health Ping() error // types ResourceToMapping(gvr schema.GroupVersionResource) (mapping *meta.RESTMapping, err error) KindToMapping(gvk schema.GroupVersionKind) (mapping *meta.RESTMapping, err error) ModelToMapping(model runtime.Object) (mapping *meta.RESTMapping, err error) // resources IsReady(obj runtime.Object) (ready bool, err error) IsReadyWithUpdate(obj runtime.Object) (ready bool, retObj runtime.Object, err error) ListAllResources(namespace string) (objs []unstructured.Unstructured, err error) }
Client kubernetes client interface
func NewClientForConfig ¶
NewClientForConfig returns the kubernetes client with rest config
func NewClientInCluster ¶
NewClientInCluster returns the kubernetes client inside the cluster
func NewClientOutCluster ¶
NewClientOutCluster returns the kubernetes client from the kubeconfig and context out of the cluster
type ClientImpl ¶
type ClientImpl struct {
// contains filtered or unexported fields
}
ClientImpl describes the a kubernetes client
func (*ClientImpl) GetContext ¶
func (c *ClientImpl) GetContext() context.Context
GetContext get current context
func (*ClientImpl) GetDiscoveryClient ¶
func (c *ClientImpl) GetDiscoveryClient() discovery.DiscoveryInterface
GetDiscoveryClient returns the discovery client
func (*ClientImpl) GetDynamicClient ¶
func (c *ClientImpl) GetDynamicClient() dynamic.Interface
GetDynamicClient returns the dynamic client
func (*ClientImpl) GetKubeClient ¶
func (c *ClientImpl) GetKubeClient() kubernetes.Interface
GetKubeClient returns the kubernetes client
func (*ClientImpl) GetRESTConfig ¶
func (c *ClientImpl) GetRESTConfig() *rest.Config
GetRESTConfig returns the REST config
func (*ClientImpl) GetRESTMapper ¶
func (c *ClientImpl) GetRESTMapper() meta.RESTMapper
GetRESTMapper returns the rest mapper
func (*ClientImpl) IsReady ¶
func (c *ClientImpl) IsReady(obj runtime.Object) (ready bool, err error)
IsReady returns whether the runtime object is ready or not
func (*ClientImpl) IsReadyWithUpdate ¶
func (c *ClientImpl) IsReadyWithUpdate(obj runtime.Object) (ready bool, retObj runtime.Object, err error)
IsReadyWithUpdate returns whether the runtime object is ready or not with update
func (*ClientImpl) KindToMapping ¶
func (c *ClientImpl) KindToMapping(gvk schema.GroupVersionKind) (mapping *meta.RESTMapping, err error)
KindToMapping gvk to mapping
func (*ClientImpl) ListAllResources ¶
func (c *ClientImpl) ListAllResources(namespace string) (objs []unstructured.Unstructured, err error)
ListAllResources list all resources within namespace, if namespace is empty, the scale would be all namespaces
func (*ClientImpl) ModelToMapping ¶
func (c *ClientImpl) ModelToMapping(model runtime.Object) (mapping *meta.RESTMapping, err error)
ModelToMapping model to mapping
func (*ClientImpl) Ping ¶
func (c *ClientImpl) Ping() error
Ping returns if the API server is online or not
func (*ClientImpl) ResourceToMapping ¶
func (c *ClientImpl) ResourceToMapping(gvr schema.GroupVersionResource) (mapping *meta.RESTMapping, err error)
ResourceToMapping gvr to mapping
func (*ClientImpl) SetContext ¶
func (c *ClientImpl) SetContext(ctx context.Context)
SetContext set query context