Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyTraffic(ctx context.Context, proxyAddress string, assignment *nanny.TrafficAssignment, ...) error
- func Controller(context.Context) (string, *http.Client, error)
- func GetListeners(ctx context.Context, s store.Store, cfg *config.GKEConfig) ([]*nanny.Listener, error)
- func NewPrometheusHandler(db *metricdb.T, logger *slog.Logger) http.Handler
- func PrepareRollout(ctx context.Context, cfg *config.GKEConfig) (*controller.RolloutRequest, error)
- func RecordListener(ctx context.Context, s store.Store, cfg *config.GKEConfig, lis *nanny.Listener) error
- func RunController(ctx context.Context, id string, region string, port int) error
- func RunDistributor(ctx context.Context, id, region string, port, managerPort int) error
- func RunManager(ctx context.Context, id, region string, port, proxyPort int) error
- func RunProxy(ctx context.Context, id string, port int) error
- func Store(region string) (store.Store, error)
- type ListenState
- type Starter
Constants ¶
const PrometheusURL = "/metrics"
URL on the controller where the metrics are exported in the Prometheus format.
Variables ¶
var ( // The directories and files where "weaver gke-local" stores data. LogDir = filepath.Join(runtime.LogsDir(), "gke-local") DataDir = filepath.Join(must(runtime.DataDir()), "gke-local") MetricsFile = filepath.Join(DataDir, "metrics.db") TracesFile = filepath.Join(DataDir, "traces.db") )
var File_internal_local_local_proto protoreflect.FileDescriptor
Functions ¶
func ApplyTraffic ¶ added in v0.22.1
func ApplyTraffic(ctx context.Context, proxyAddress string, assignment *nanny.TrafficAssignment, region string) error
ApplyTraffic applies the traffic assignment on the proxy running at the given address.
func Controller ¶ added in v0.18.0
Controller returns the address the tool should use to connect to the controller, as well as the HTTP client that can be used to reach it.
func GetListeners ¶ added in v0.22.1
func GetListeners(ctx context.Context, s store.Store, cfg *config.GKEConfig) ([]*nanny.Listener, error)
GetListeners returns network listeners in the given store associated with a given application version.
If a replica that exports a listener dies, we don't update the traffic rules to reflect the new set of listeners in case of a gke-local deployer. Note that this is intentional, as we don't worry about processes deaths.
func NewPrometheusHandler ¶
NewPrometheusHandler returns a Prometheus HTTP handler that exports metrics stored in the given metrics database. The returned handler supports the following query parameters:
- app=<app>, which restricts metrics to the given application, and
- version=<version>, which restricts metrics to the given app version.
func PrepareRollout ¶
func PrepareRollout(ctx context.Context, cfg *config.GKEConfig) (*controller.RolloutRequest, error)
PrepareRollout returns a new rollout request for the given application version. This call may mutate the passed-in config.
func RecordListener ¶
func RecordListener(ctx context.Context, s store.Store, cfg *config.GKEConfig, lis *nanny.Listener) error
RecordListener records the network listener exported by an application version.
func RunController ¶ added in v0.18.0
RunController creates and runs a controller.
func RunDistributor ¶ added in v0.18.0
RunDistributor creates and runs a distributor.
func RunManager ¶ added in v0.18.0
RunManager creates and runs a manager.
Types ¶
type ListenState ¶
type ListenState struct { // Listeners is the set of all exported listeners in the deployment. Listeners []*nanny.Listener `protobuf:"bytes,1,rep,name=listeners,proto3" json:"listeners,omitempty"` // contains filtered or unexported fields }
ListenState contains the state stored for the network listeners in the store.
func (*ListenState) Descriptor
deprecated
func (*ListenState) Descriptor() ([]byte, []int)
Deprecated: Use ListenState.ProtoReflect.Descriptor instead.
func (*ListenState) GetListeners ¶
func (x *ListenState) GetListeners() []*nanny.Listener
func (*ListenState) ProtoMessage ¶
func (*ListenState) ProtoMessage()
func (*ListenState) ProtoReflect ¶
func (x *ListenState) ProtoReflect() protoreflect.Message
func (*ListenState) Reset ¶
func (x *ListenState) Reset()
func (*ListenState) String ¶
func (x *ListenState) String() string
type Starter ¶
type Starter struct {
// contains filtered or unexported fields
}
Starter starts ReplicaSets on the local machine.
func NewStarter ¶
NewStarter creates a starter that runs all replicas of a colocation group as OS processes on the local machine.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package cond implements a context-aware condition variable.
|
Package cond implements a context-aware condition variable. |
Package proxy provides an implementation of a simple proxying service.
|
Package proxy provides an implementation of a simple proxying service. |