Documentation
¶
Index ¶
- Variables
- func DefaultKubernetesCacheOpts() cache.Options
- func EnsureDrain(ctx context.Context, node *corev1.Node, log logr.Logger, ...) error
- func EnsureSchedulable(ctx context.Context, k8sClient client.Client, node *corev1.Node, ...) error
- func GetAPIServerVersion(ki kubernetes.Interface) (semver.Version, error)
- func GetPodsForDrain(ctx context.Context, k8sClient client.Client, nodeName string) ([]corev1.Pod, error)
- func WaitForPodDeletions(ctx context.Context, k8sClient client.Client, pods []corev1.Pod, ...) error
- func WeekdayFromString(s string) (time.Weekday, error)
- type DrainParameters
- type OpenStackConfig
- type WaitFunc
- type WaitParameters
Constants ¶
This section is empty.
Variables ¶
View Source
var WeekdayMap = map[string]time.Weekday{ "monday": time.Monday, "mon": time.Monday, "tuesday": time.Tuesday, "tue": time.Tuesday, "wednesday": time.Wednesday, "wed": time.Wednesday, "thursday": time.Thursday, "thu": time.Thursday, "friday": time.Friday, "fri": time.Friday, "saturday": time.Saturday, "sat": time.Saturday, "sunday": time.Sunday, "sun": time.Sunday, }
Functions ¶
func DefaultKubernetesCacheOpts ¶ added in v1.9.4
func EnsureDrain ¶
func EnsureDrain(ctx context.Context, node *corev1.Node, log logr.Logger, params DrainParameters) error
Drains Pods from the given node, if required.
func EnsureSchedulable ¶
func EnsureSchedulable(ctx context.Context, k8sClient client.Client, node *corev1.Node, schedulable bool) error
Checks if the is Schedulable according to schedulable and patches the node if necessary.
func GetAPIServerVersion ¶ added in v0.18.0
func GetAPIServerVersion(ki kubernetes.Interface) (semver.Version, error)
func GetPodsForDrain ¶
func GetPodsForDrain(ctx context.Context, k8sClient client.Client, nodeName string) ([]corev1.Pod, error)
Gets a list of pods to be deleted for a node to be considered drained. Shortened https://github.com/kinvolk/flatcar-linux-update-operator/blob/master/pkg/k8sutil/drain.go .
func WaitForPodDeletions ¶
func WaitForPodDeletions(ctx context.Context, k8sClient client.Client, pods []corev1.Pod, params WaitParameters) error
Deletes the given pods and awaits there deletion.
Types ¶
type DrainParameters ¶ added in v0.18.0
type DrainParameters struct {
// how long to wait for pods to vanish
AwaitDeletion WaitParameters
// how long to wait for eviction creation to succeed
Eviction WaitParameters
Client client.Client
// for eviction API as that is not callable from client.Client
Clientset kubernetes.Interface
// when set to true and eviction creation fails
// within the eviction timeout, call a direct delete
// on pods afterwards.
ForceEviction bool
GracePeriodSeconds *int64
}
type OpenStackConfig ¶ added in v0.19.0
type OpenStackConfig struct {
Region string
AuthURL string
Username string
Password string
Domainname string
ProjectID string
}
func LoadOSConfig ¶ added in v1.9.4
func LoadOSConfigFile ¶ added in v1.9.4
func LoadOSConfigFile() (OpenStackConfig, error)
func (OpenStackConfig) Connect ¶ added in v1.9.3
func (osConf OpenStackConfig) Connect(ctx context.Context) (*gophercloud.ProviderClient, gophercloud.EndpointOpts, error)
Click to show internal directories.
Click to hide internal directories.