Documentation
¶
Index ¶
- func GetClientset(kubeconfig, context string) (*kubernetes.Clientset, error)
- func GetDaemonsets(ctx context.Context, clientset kubernetes.Interface, namespace string) (*v1.DaemonSetList, error)
- func GetDefaultKubernetesContextAndNamespace(kubeconfig string) (string, string)
- func GetDeployments(ctx context.Context, clientset kubernetes.Interface, namespace string) (*v1.DeploymentList, error)
- func GetKubernetesContexts(kubeconfig string) ([]string, error)
- func GetNamespaces(ctx context.Context, clientset kubernetes.Interface) []string
- func GetStatefulSets(ctx context.Context, clientset kubernetes.Interface, namespace string) (*v1.StatefulSetList, error)
- func IsDaemonSetReady(ds *v1.DaemonSet, downscaled bool) bool
- func IsDeploymentReady(ds *v1.Deployment, downscaled bool) bool
- func IsStatefulSetReady(ss *v1.StatefulSet, downscaled bool) bool
- func WaitForDaemonSets(ctx context.Context, clientset kubernetes.Interface, ...) error
- func WaitForDeployments(ctx context.Context, clientset kubernetes.Interface, ...) error
- func WaitForStatefulSets(ctx context.Context, clientset kubernetes.Interface, ...) error
- type NamespaceResult
- type ResourceGroup
- type ScaleInfo
- func DownscaleDaemonsets(ctx context.Context, clientset kubernetes.Interface, ...) ([]ScaleInfo, error)
- func DownscaleDeployments(ctx context.Context, clientset kubernetes.Interface, ...) ([]ScaleInfo, error)
- func DownscaleStatefulSets(ctx context.Context, clientset kubernetes.Interface, ...) ([]ScaleInfo, error)
- func UpscaleDaemonsets(ctx context.Context, clientset kubernetes.Interface, ...) ([]ScaleInfo, error)
- func UpscaleDeployments(ctx context.Context, clientset kubernetes.Interface, ...) ([]ScaleInfo, error)
- func UpscaleStatefulSets(ctx context.Context, clientset kubernetes.Interface, ...) ([]ScaleInfo, error)
- type TreePrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClientset ¶
func GetClientset(kubeconfig, context string) (*kubernetes.Clientset, error)
func GetDaemonsets ¶
func GetDaemonsets(ctx context.Context, clientset kubernetes.Interface, namespace string) (*v1.DaemonSetList, error)
func GetDeployments ¶
func GetDeployments(ctx context.Context, clientset kubernetes.Interface, namespace string) (*v1.DeploymentList, error)
func GetKubernetesContexts ¶
func GetNamespaces ¶
func GetNamespaces(ctx context.Context, clientset kubernetes.Interface) []string
func GetStatefulSets ¶
func GetStatefulSets(ctx context.Context, clientset kubernetes.Interface, namespace string) (*v1.StatefulSetList, error)
func IsDeploymentReady ¶
func IsDeploymentReady(ds *v1.Deployment, downscaled bool) bool
func IsStatefulSetReady ¶
func IsStatefulSetReady(ss *v1.StatefulSet, downscaled bool) bool
func WaitForDaemonSets ¶
func WaitForDaemonSets(ctx context.Context, clientset kubernetes.Interface, daemonsets *v1.DaemonSetList, timeout time.Duration, downscaled bool) error
func WaitForDeployments ¶
func WaitForDeployments(ctx context.Context, clientset kubernetes.Interface, deployments *v1.DeploymentList, timeout time.Duration, downscaled bool) error
func WaitForStatefulSets ¶
func WaitForStatefulSets(ctx context.Context, clientset kubernetes.Interface, statefulsets *v1.StatefulSetList, timeout time.Duration, downscaled bool) error
Types ¶
type NamespaceResult ¶ added in v1.14.1
type NamespaceResult struct {
Namespace string
Deployments ResourceGroup
StatefulSets ResourceGroup
DaemonSets ResourceGroup
}
NamespaceResult contains all scaling results for a namespace
type ResourceGroup ¶ added in v1.14.1
type ResourceGroup struct {
Type string // "Deployments", "StatefulSets", "DaemonSets"
Resources []ScaleInfo
Skipped bool
}
ResourceGroup groups resources by type for tree output
type ScaleInfo ¶ added in v1.14.1
type ScaleInfo struct {
Name string
Replicas int32
Scaled bool
Warning string // if not scaled, this contains the reason
}
ScaleInfo contains information about a scaling operation
func DownscaleDaemonsets ¶
func DownscaleDaemonsets(ctx context.Context, clientset kubernetes.Interface, daemonsets *v1.DaemonSetList, dryRun bool) ([]ScaleInfo, error)
func DownscaleDeployments ¶
func DownscaleDeployments(ctx context.Context, clientset kubernetes.Interface, deployments *v1.DeploymentList, dryRun bool) ([]ScaleInfo, error)
func DownscaleStatefulSets ¶
func DownscaleStatefulSets(ctx context.Context, clientset kubernetes.Interface, statefulsets *v1.StatefulSetList, dryRun bool) ([]ScaleInfo, error)
func UpscaleDaemonsets ¶
func UpscaleDaemonsets(ctx context.Context, clientset kubernetes.Interface, daemonsets *v1.DaemonSetList, dryRun bool) ([]ScaleInfo, error)
func UpscaleDeployments ¶
func UpscaleDeployments(ctx context.Context, clientset kubernetes.Interface, deployments *v1.DeploymentList, dryRun bool) ([]ScaleInfo, error)
func UpscaleStatefulSets ¶
func UpscaleStatefulSets(ctx context.Context, clientset kubernetes.Interface, statefulsets *v1.StatefulSetList, dryRun bool) ([]ScaleInfo, error)
type TreePrinter ¶ added in v1.14.1
type TreePrinter struct {
// contains filtered or unexported fields
}
TreePrinter provides a tree-style output for scaling operations
func NewTreePrinter ¶ added in v1.14.1
func NewTreePrinter() *TreePrinter
NewTreePrinter creates a new TreePrinter
func NewTreePrinterWithWriter ¶ added in v1.14.1
func NewTreePrinterWithWriter(w io.Writer) *TreePrinter
NewTreePrinterWithWriter creates a TreePrinter with a custom writer
func (*TreePrinter) PrintNamespaceResult ¶ added in v1.14.1
func (tp *TreePrinter) PrintNamespaceResult(result NamespaceResult) error
PrintNamespaceResult prints the scaling result for a namespace in tree format
Click to show internal directories.
Click to hide internal directories.