Documentation ¶
Overview ¶
Connection
The Connection is now working by gRPC for communicating with server.
Connection will temporary stay in directory agent instead of SDC since agent should be this only process to communicate with the server. In Osquery(kolide), only hostname is specific in compile time. The reference is here: https://github.com/kolide/launcher/blob/main/pkg/service/client_grpc.go#L102
For high performance requirements(low latency, high traffic), a look-aside load balancing is required just like Elkeid agent does. The client-side LB using grpc-LB protocol. There are 3 of the protocols.
1. pick_first (Elkeid way) 2. round_robin 3. grpclb(dropped, xDS instead)
The xDS(x Discovery Service) with it's recommanded docs here: https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol APIs: - Listener Discovery Service(LDS) - Route Discovery Service (RDS) - Cluster Discovery Service (CDS) - Endpoint Discovery Service (EDS) - Aggregate Discovery Service (ADS) (coming soon)
References: https://grpc.io/blog/grpc-load-balancing/ https://github.com/grpc/grpc/blob/master/doc/load-balancing.md
From Elkeid StatsHandler
Index ¶
- Variables
- func GetConnection(ctx context.Context) (c *grpc.ClientConn, err error)
- type Connection
- type Stats
- type StatsHandler
- func (h *StatsHandler) GetStats(now time.Time) (s Stats)
- func (h *StatsHandler) HandleConn(ctx context.Context, _ stats.ConnStats)
- func (h *StatsHandler) HandleRPC(ctx context.Context, s stats.RPCStats)
- func (h *StatsHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
- func (h *StatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context
Constants ¶
This section is empty.
Variables ¶
var CaCert []byte
var ClientCert []byte
var ClientKey []byte
var ( DefaultStatsHandler = StatsHandler{ // contains filtered or unexported fields } )
var GrpcAddr string
var InsecureTLS bool
var InsecureTransport bool
Functions ¶
func GetConnection ¶
func GetConnection(ctx context.Context) (c *grpc.ClientConn, err error)
Types ¶
type Connection ¶
type Connection struct { Addr string Options []grpc.DialOption Conn atomic.Value NetMode atomic.Value }
func New ¶
func New() *Connection
func (*Connection) String ¶
func (c *Connection) String() string
type StatsHandler ¶
type StatsHandler struct {
// contains filtered or unexported fields
}
func (*StatsHandler) HandleConn ¶
func (h *StatsHandler) HandleConn(ctx context.Context, _ stats.ConnStats)
func (*StatsHandler) HandleRPC ¶
func (h *StatsHandler) HandleRPC(ctx context.Context, s stats.RPCStats)
func (*StatsHandler) TagConn ¶
func (h *StatsHandler) TagConn(ctx context.Context, _ *stats.ConnTagInfo) context.Context
func (*StatsHandler) TagRPC ¶
func (h *StatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context