Documentation ¶
Index ¶
- Constants
- type Hpa
- type K8s
- type KubernetesAPI
- func (k KubernetesAPI) Connect() dynamic.Interface
- func (k KubernetesAPI) GetDeployments(namespace string) []unstructured.Unstructured
- func (k KubernetesAPI) GetHorizontalPodAutoscalers(namespace string) []Hpa
- func (k KubernetesAPI) ScaleDeployments(deployments []unstructured.Unstructured, hpas []Hpa, scaleAction string, ...)
Constants ¶
View Source
const ( //ScaleUp const for scaling up action ScaleUp = "UP" //ScaleDown const for scaling up action ScaleDown = "DOWN" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type K8s ¶
type K8s interface { Connect() dynamic.Interface GetDeployments(Client dynamic.Interface, namespace string) []unstructured.Unstructured GetHorizontalPodAutoscalers(Client dynamic.Interface, namespace string) []Hpa ScaleDeployments(Client dynamic.Interface, deployments []unstructured.Unstructured) }
K8s interface for k8s package
type KubernetesAPI ¶
KubernetesAPI is the struct for k8s
func (KubernetesAPI) Connect ¶
func (k KubernetesAPI) Connect() dynamic.Interface
Connect returns new kubernetes Client
func (KubernetesAPI) GetDeployments ¶
func (k KubernetesAPI) GetDeployments(namespace string) []unstructured.Unstructured
GetDeployments gets all deployments from the specified namespace
func (KubernetesAPI) GetHorizontalPodAutoscalers ¶
func (k KubernetesAPI) GetHorizontalPodAutoscalers(namespace string) []Hpa
GetHorizontalPodAutoscalers gets all hpas from all namespaces except kube-system
func (KubernetesAPI) ScaleDeployments ¶
func (k KubernetesAPI) ScaleDeployments(deployments []unstructured.Unstructured, hpas []Hpa, scaleAction string, dryRun bool)
ScaleDeployments scales all deployments from all namespaces except kube-system either down to 0, or up to the minimum replicas if available(or 1)
Click to show internal directories.
Click to hide internal directories.