Documentation ¶
Overview ¶
Package lameduck is a generated protocol buffer package.
It is generated from these files:
github.com/google/cloudprober/targets/lameduck/config.proto
It has these top-level messages:
Options
Package lameduck implements a lameducks provider. Lameduck provider fetches lameducks from the RTC (Runtime Configurator) service. This functionality allows an operator to do hitless VM upgrades. If a target is set to be in lameduck by the operator, it is taken out of the targets list.
Index ¶
- Constants
- func InitDefaultLister(optsProto *Options, lister Lister, l *logger.Logger) error
- type Lister
- type Options
- func (*Options) Descriptor() ([]byte, []int)
- func (m *Options) GetExpirationSec() int32
- func (m *Options) GetReEvalSec() int32
- func (m *Options) GetRuntimeconfigName() string
- func (m *Options) GetRuntimeconfigProject() string
- func (*Options) ProtoMessage()
- func (m *Options) Reset()
- func (m *Options) String() string
- type Service
Constants ¶
const Default_Options_ExpirationSec int32 = 300
const Default_Options_ReEvalSec int32 = 10
const Default_Options_RuntimeconfigName string = "lame-duck-targets"
Variables ¶
This section is empty.
Functions ¶
func InitDefaultLister ¶
InitDefaultLister initializes the package using the given arguments. If a lister is given in the arguments, global.lister is set to that, otherwise a new lameduck service is created using the config options, and global.lister is set to that service. Initiating the package from a given lister is useful for testing pacakges that depend on this package.
Types ¶
type Lister ¶
Lister is an interface for getting current lameducks.
func GetDefaultLister ¶
GetDefaultLister returns the global Lister. If global lister is uninitialized, it returns an error.
type Options ¶
type Options struct { // How often to check for lame-ducked targets ReEvalSec *int32 `protobuf:"varint,1,opt,name=re_eval_sec,json=reEvalSec,def=10" json:"re_eval_sec,omitempty"` // Runtime config project. If running on GCE, this defaults to the project // containing the VM. RuntimeconfigProject *string `protobuf:"bytes,2,opt,name=runtimeconfig_project,json=runtimeconfigProject" json:"runtimeconfig_project,omitempty"` // Lame duck targets runtime config name. An operator will create a variable // here to mark a target as lame-ducked. // TODO: This name needs to be changed. RuntimeconfigName *string `` /* 127-byte string literal not displayed */ // Lame duck expiration time. We ignore variables (targets) that have been // updated more than these many seconds ago. This is a safety mechanism for // failing to cleanup. Also, the idea is that if a target has actually // disappeared, automatic targets expansion will take care of that some time // during this expiration period. ExpirationSec *int32 `protobuf:"varint,4,opt,name=expiration_sec,json=expirationSec,def=300" json:"expiration_sec,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Options) Descriptor ¶
func (*Options) GetExpirationSec ¶
func (*Options) GetReEvalSec ¶
func (*Options) GetRuntimeconfigName ¶
func (*Options) GetRuntimeconfigProject ¶
func (*Options) ProtoMessage ¶
func (*Options) ProtoMessage()
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides methods to do lameduck operations on VMs.
func NewService ¶
NewService creates a new lameduck Service using the provided config options and an oauth2 enabled *http.Client; if the client is set to nil, an oauth enabled client is created automatically using GCP default credentials.
func (*Service) Unlameduck ¶
Unlameduck removes the target from lameduck mode.