k8s

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIntStr

func NewIntStr(v int) *intstr.IntOrString

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(kubeConfigYaml string) (*Client, error)

func NewClientFromFile

func NewClientFromFile(kubeConfPath string) (*Client, error)

func (*Client) Admin

func (c *Client) Admin() *admin.Client

集群管理

func (*Client) Config

func (c *Client) Config() *config.Client

应用配置

func (*Client) CurrentCluster

func (c *Client) CurrentCluster() *clientcmdapi.Cluster

func (*Client) CurrentContext

func (c *Client) CurrentContext() *clientcmdapi.Context

func (*Client) Event

func (c *Client) Event() *event.Client

应用事件

func (*Client) Gateway

func (c *Client) Gateway() *gateway.Client

func (*Client) GetContexts

func (c *Client) GetContexts() map[string]*clientcmdapi.Context

func (*Client) K8sClientSet added in v0.0.2

func (c *Client) K8sClientSet() *kubernetes.Clientset

func (*Client) Network

func (c *Client) Network() *network.Client

应用网络

func (*Client) ServerResources

func (c *Client) ServerResources() *meta.ApiResourceList

func (*Client) ServerVersion

func (c *Client) ServerVersion() (string, error)

func (*Client) Storage

func (c *Client) Storage() *storage.Client

应用存储

func (*Client) Watch

func (c *Client) Watch(ctx context.Context, req *WatchRequest) (watch.Interface, error)

func (*Client) WorkLoad

func (c *Client) WorkLoad() *workload.Client

应用负载

type ObjectKind

type ObjectKind string
const (
	OBJECT_DEPLOY       ObjectKind = "deployment"
	OBJECT_STATEFUL_SET ObjectKind = "statefulset"
	OBJECT_DAEMON_SET   ObjectKind = "daemonset"
	OBJECT_JOB          ObjectKind = "job"
	OBJECT_CRONJOB      ObjectKind = "cronjob"
	OBJECT_POD          ObjectKind = "pod"
)

func (ObjectKind) String

func (t ObjectKind) String() string

type WatchReader

type WatchReader struct {
	// contains filtered or unexported fields
}

func NewWatchReader

func NewWatchReader(w watch.Interface) *WatchReader

func (*WatchReader) Close

func (r *WatchReader) Close() error

func (*WatchReader) Read

func (r *WatchReader) Read(p []byte) (int, error)

type WatchRequest

type WatchRequest struct {
	Namespace  string     `json:"namespace"`
	ObjectKind ObjectKind `json:"kind"`
}

func NewWatchRequest

func NewWatchRequest() *WatchRequest

func (*WatchRequest) Validate

func (req *WatchRequest) Validate() error

func (*WatchRequest) WatchOptions

func (req *WatchRequest) WatchOptions() metav1.ListOptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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