Documentation ¶
Index ¶
- Constants
- func CheckAlarms(ctx context.Context, params CheckParameters) ([]string, error)
- func EnsureVMOff(ctx context.Context, params ShutdownParams) error
- func FetchVersion(ctx context.Context, params CheckParameters) (string, error)
- func RetrieveVM(ctx context.Context, client *govmomi.Client, name string) (mo.VirtualMachine, error)
- func ShouldShutdown(esx *Host) bool
- func ShouldShutdownNode(node *v1.Node) bool
- func ShouldStart(node *v1.Node) bool
- func ShutdownAllowed(state Maintenance) bool
- type CheckParameters
- type Config
- type Credential
- type Host
- type HostInfo
- type Maintenance
- type PollPowerOffParams
- type Runnable
- func (r *Runnable) CheckMaintenance(ctx context.Context, conf *Config, esx *Host) error
- func (r *Runnable) FetchVersion(ctx context.Context, vCenters *VCenters, esx *Host) error
- func (r *Runnable) NeedLeaderElection() bool
- func (r *Runnable) Reconcile(ctx context.Context)
- func (r *Runnable) ShutdownNodes(ctx context.Context, conf *Config, esx *Host) error
- func (r *Runnable) Start(ctx context.Context) error
- func (r *Runnable) StartNodes(ctx context.Context, vCenters *VCenters, esx *Host)
- type ShutdownParams
- type VCenters
Constants ¶
const AvailabilityZoneReplacer string = "$AZ"
Specifies the string in a vCenter URL, which is replaced by the availability zone.
Variables ¶
This section is empty.
Functions ¶
func CheckAlarms ¶ added in v0.19.3
func CheckAlarms(ctx context.Context, params CheckParameters) ([]string, error)
Returns list of active alarm names as described here: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.monitoring.doc/GUID-82933270-1D72-4CF3-A1AF-E5A1343F62DE.html
func EnsureVMOff ¶ added in v0.21.0
func EnsureVMOff(ctx context.Context, params ShutdownParams) error
func FetchVersion ¶ added in v0.17.0
func FetchVersion(ctx context.Context, params CheckParameters) (string, error)
func RetrieveVM ¶ added in v0.21.0
func ShouldShutdown ¶
Checks, if all Nodes on an ESX need maintenance and are allowed to be shutdown.
func ShouldShutdownNode ¶ added in v0.19.5
func ShouldStart ¶
Checks if the controller initiated the maintenance and the underlying ESX is not in maintenance.
func ShutdownAllowed ¶ added in v0.19.4
func ShutdownAllowed(state Maintenance) bool
Types ¶
type CheckParameters ¶
type Config ¶
type Config struct { Intervals struct { Check struct { Jitter float64 `config:"jitter" validate:"min=0.001"` Period time.Duration `config:"period" validate:"required"` } `config:"check" validate:"required"` PodDeletion struct { Period time.Duration Timeout time.Duration } `config:"podDeletion" validate:"required"` PodEviction struct { Period time.Duration `config:"period" validate:"required"` Timeout time.Duration `config:"timeout" validate:"required"` Force bool `config:"force"` } `config:"podEviction" validate:"required"` VMShutdown struct { Period time.Duration `config:"period" validate:"required"` Timeout time.Duration `config:"timeout" validate:"required"` } `config:"vmShutdown" validate:"required"` } `config:"intervals" validate:"required"` Alarms []string VCenters VCenters `config:"vCenters" validate:"required"` }
func (*Config) AlarmsAsSet ¶ added in v0.19.3
type Credential ¶
type Maintenance ¶
type Maintenance string
const AlarmMaintenance Maintenance = "alarm"
const InMaintenance Maintenance = "true"
const NoMaintenance Maintenance = "false"
const UnknownMaintenance Maintenance = "unknown"
func CheckForMaintenance ¶
func CheckForMaintenance(ctx context.Context, params CheckParameters) (Maintenance, error)
Performs a check for the specified host if allowed by timestamps.
type PollPowerOffParams ¶ added in v0.21.0
type PollPowerOffParams struct {
// contains filtered or unexported fields
}
type Runnable ¶
func (*Runnable) CheckMaintenance ¶
Checks the maintenance mode of the given ESX and attaches the according Maintenance label.
func (*Runnable) FetchVersion ¶ added in v0.17.0
func (*Runnable) NeedLeaderElection ¶
func (*Runnable) ShutdownNodes ¶
Shuts down nodes on the given ESX, if the ESX has a maintenance and a node is labelled accordingly.
type ShutdownParams ¶ added in v0.21.0
type VCenters ¶
type VCenters struct { // URL to regional vCenters with the availability zone replaced by AvailabilityZoneReplacer. Template string `config:"templateUrl" validate:"required"` // If true the vCenters certificates are not validated. Insecure bool `config:"insecure"` // Pair of credentials per availability zone. Credentials map[string]Credential `config:"credentials" validate:"required"` // contains filtered or unexported fields }
VCenters contains connection information to regional vCenters.