Documentation ¶
Index ¶
- Constants
- Variables
- type Option
- func WithClientTLS(cfg certloader.ClientConfigBuilder) Option
- func WithDialTimeout(t time.Duration) Option
- func WithErrorAggregationWindow(d time.Duration) Option
- func WithGRPCMetrics(grpcMetrics *grpc_prometheus.ServerMetrics) Option
- func WithGRPCStreamInterceptor(interceptors ...grpc.StreamServerInterceptor) Option
- func WithGRPCUnaryInterceptor(interceptors ...grpc.UnaryServerInterceptor) Option
- func WithInsecureClient() Option
- func WithInsecureServer() Option
- func WithListenAddress(a string) Option
- func WithLocalClusterName(clusterName string) Option
- func WithLogger(log logrus.FieldLogger) Option
- func WithMetricsListenAddress(a string) Option
- func WithPeerTarget(t string) Option
- func WithRetryTimeout(t time.Duration) Option
- func WithServerTLS(cfg certloader.ServerConfigBuilder) Option
- func WithSortBufferDrainTimeout(d time.Duration) Option
- func WithSortBufferMaxLen(i int) Option
- type Server
Constants ¶
const MinTLSVersion = tls.VersionTLS13
MinTLSVersion defines the minimum TLS version clients are expected to support in order to establish a connection to the hubble-relay server.
Variables ¶
var ( // ErrNoClientTLSConfig is returned when no client TLS config is set unless // WithInsecureClient() is provided. ErrNoClientTLSConfig = errors.New("no client TLS config is set") // ErrNoServerTLSConfig is returned when no server TLS config is set unless // WithInsecureServer() is provided. ErrNoServerTLSConfig = errors.New("no server TLS config is set") )
var DefaultOptions []Option
DefaultOptions to include in the server. Other packages may extend this in their init() function.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *options) error
Option customizes the configuration of the hubble-relay server.
func WithClientTLS ¶
func WithClientTLS(cfg certloader.ClientConfigBuilder) Option
WithClientTLS sets the transport credentials for connecting to peers based on the provided TLS configuration.
func WithDialTimeout ¶
WithDialTimeout sets the dial timeout that is used when establishing a connection to a hubble peer.
func WithErrorAggregationWindow ¶
WithErrorAggregationWindow sets a time window during which errors with the same error message are coalesced. The aggregated error is forwarded to the downstream consumer either when the window expires or when a new, different error occurs (whichever happens first)
func WithGRPCMetrics ¶
func WithGRPCMetrics(grpcMetrics *grpc_prometheus.ServerMetrics) Option
WithGRPCMetrics configures the server with the specified prometheus gPRC ServerMetrics.
func WithGRPCStreamInterceptor ¶
func WithGRPCStreamInterceptor(interceptors ...grpc.StreamServerInterceptor) Option
WithGRPCStreamInterceptor configures the server with the given gRPC server stream interceptors
func WithGRPCUnaryInterceptor ¶
func WithGRPCUnaryInterceptor(interceptors ...grpc.UnaryServerInterceptor) Option
WithGRPCUnaryInterceptor configures the server with the given gRPC server stream interceptors
func WithInsecureClient ¶
func WithInsecureClient() Option
WithInsecureClient disables transport security for connection to Hubble server instances. Transport security is required to WithInsecureClient is set (not recommended).
func WithInsecureServer ¶
func WithInsecureServer() Option
WithInsecureServer disables transport security. Transport security is required for the server unless WithInsecureServer is set (not recommended).
func WithListenAddress ¶
WithListenAddress sets the listen address for the hubble-relay server.
func WithLocalClusterName ¶
WithLocalClusterName sets the cluster name for the peer service so that it knows how to construct the proper TLSServerName to validate mTLS in the K8s Peer service.
func WithLogger ¶
func WithLogger(log logrus.FieldLogger) Option
WithLogger set the logger used by hubble-relay.
func WithMetricsListenAddress ¶
WithMetricsListenAddress sets the listen address for the hubble-relay server.
func WithPeerTarget ¶
WithPeerTarget sets the URL of the hubble peer service to connect to.
func WithRetryTimeout ¶
WithRetryTimeout sets the duration to wait before attempting to re-connect to a hubble peer when the connection is lost.
func WithServerTLS ¶
func WithServerTLS(cfg certloader.ServerConfigBuilder) Option
WithServerTLS sets the transport credentials for the server based on TLS.
func WithSortBufferDrainTimeout ¶
WithSortBufferDrainTimeout sets the sort buffer drain timeout value. For flows requests where the total number of flows cannot be determined (typically for flows requests in follow mode), a flow is taken out of the buffer and sent to the client after duration d if the buffer is not full. This value must be greater than 0. Setting this value too low would render the flows sorting operation ineffective. A value between 500 milliseconds and 3 seconds should be constitute a good choice in most cases.
func WithSortBufferMaxLen ¶
WithSortBufferMaxLen sets the maximum number of flows that can be buffered for sorting before being sent to the client. The provided value must be greater than 0 and is to be understood per client request. Therefore, it is advised to keep the value moderate (a value between 30 and 100 should constitute a good choice in most cases).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a proxy that connects to a running instance of hubble gRPC server via unix domain socket.