Documentation ¶
Index ¶
- type Client
- func (c *Client) AddNodeLabel(ctx context.Context, nodeName, label, value string) error
- func (c *Client) FilterReadyPods(pods []core.Pod) []core.Pod
- func (c *Client) Nodes(ctx context.Context, labelSelector map[string]string) ([]core.Node, error)
- func (c *Client) PodReady(pod core.Pod) bool
- func (c *Client) Pods(ctx context.Context, namespace string, labelSelector map[string]string, ...) ([]core.Pod, error)
- func (c *Client) RemoveNodeLabel(ctx context.Context, nodeName, label string) error
- func (c *Client) ReplaceNodeLabel(ctx context.Context, nodeName, label, value string) error
- func (c *Client) Service(ctx context.Context, namespace, name string) (*core.Service, error)
- func (c *Client) UpdateDeploymentReplicas(ctx context.Context, namespace, deploymentName string, replicas int32) error
- func (c *Client) UpdateStatefulSetReplicas(ctx context.Context, namespace, statefulSetName string, replicas int32) error
- type Option
- type PatchOp
- type PatchStringValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *kubernetes.Clientset // contains filtered or unexported fields }
Client is a Kubernetes client that provides simpler interfaces than the official Kubernetes package.
func (*Client) AddNodeLabel ¶
AddNodeLabel adds or replaces a node label to the Kubernetes node.
func (*Client) FilterReadyPods ¶
FilterReadyPods filters out not-ready pods.
func (*Client) Nodes ¶
Nodes returns a list of Kubernetes nodes labeled by the argument labelSelector.
func (*Client) Pods ¶
func (c *Client) Pods(ctx context.Context, namespace string, labelSelector map[string]string, onlyReady bool) ([]core.Pod, error)
Pods returns a list of Kubernetes pods labeled by the argument labelSelector. It returns only ready pods if the argument onlyReady is true.
func (*Client) RemoveNodeLabel ¶
RemoveNodeLabel removes a node label from the Kubernetes node.
func (*Client) ReplaceNodeLabel ¶
ReplaceNodeLabel replaces a node label of the Kubernetes node. Deprecated: Use AddNodeLabel. More info: https://datatracker.ietf.org/doc/html/rfc6902#section-4.1
func (*Client) Service ¶
Service returns a service resource named by the argument name defined in the given namespace.
func (*Client) UpdateDeploymentReplicas ¶
func (c *Client) UpdateDeploymentReplicas(ctx context.Context, namespace, deploymentName string, replicas int32) error
UpdateDeploymentReplicas updates replicas of the deployment in the namespace. The replicas are changed asynchronously, thus caller has a responsibility to check the done of change.
func (*Client) UpdateStatefulSetReplicas ¶
func (c *Client) UpdateStatefulSetReplicas(ctx context.Context, namespace, statefulSetName string, replicas int32) error
UpdateStatefulSetReplicas updates the number of replicas of the statefulSet in the namespace. The replicas are changed asynchronously, thus caller has a responsibility to check the done of change.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithCluster ¶
func WithClusterConnectionInfo ¶
func WithClusterConnectionInfo(connInfo vault.ClusterConnectionInfo) Option
func WithContext ¶
func WithMasterURL ¶
type PatchStringValue ¶
type PatchStringValue struct { Op string `json:"op"` Path string `json:"path"` Value string `json:"value"` }
func NewLabelPatchStringValue ¶
func NewLabelPatchStringValue(patchOp PatchOp, label, value string) PatchStringValue