mesh

package
v1.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultInboundTimeout = func() *mesh_proto.Timeout_Conf {
	const factor = 2
	upstream := DefaultTimeoutResource().(*core_mesh.TimeoutResource).Spec.GetConf()

	return &mesh_proto.Timeout_Conf{
		ConnectTimeout: util_proto.Duration(factor * upstream.GetConnectTimeout().AsDuration()),
		Tcp: &mesh_proto.Timeout_Conf_Tcp{
			IdleTimeout: util_proto.Duration(factor * upstream.GetTcp().GetIdleTimeout().AsDuration()),
		},
		Http: &mesh_proto.Timeout_Conf_Http{
			RequestTimeout:    util_proto.Duration(0),
			IdleTimeout:       util_proto.Duration(factor * upstream.GetHttp().GetIdleTimeout().AsDuration()),
			StreamIdleTimeout: util_proto.Duration(factor * upstream.GetHttp().GetStreamIdleTimeout().AsDuration()),
			MaxStreamDuration: util_proto.Duration(0),
		},
	}
}

DefaultInboundTimeout returns timeouts for the inbound side. This resource is not created in the store. It's used directly in InboundProxyGenerator. In the future, it could be replaced with a new InboundTimeout policy. The main idea around these values is to have them either bigger than outbound side timeouts or disabled.

View Source
var DefaultTimeoutResource = func() model.Resource {
	return &core_mesh.TimeoutResource{
		Spec: &mesh_proto.Timeout{
			Sources: []*mesh_proto.Selector{{
				Match: mesh_proto.MatchAnyService(),
			}},
			Destinations: []*mesh_proto.Selector{{
				Match: mesh_proto.MatchAnyService(),
			}},
			Conf: &mesh_proto.Timeout_Conf{
				ConnectTimeout: util_proto.Duration(5 * time.Second),
				Tcp: &mesh_proto.Timeout_Conf_Tcp{
					IdleTimeout: util_proto.Duration(1 * time.Hour),
				},
				Http: &mesh_proto.Timeout_Conf_Http{
					IdleTimeout:       util_proto.Duration(1 * time.Hour),
					RequestTimeout:    util_proto.Duration(15 * time.Second),
					StreamIdleTimeout: util_proto.Duration(30 * time.Minute),
				},
			},
		},
	}
}

Functions

func EnsureDefaultMeshResources

func EnsureDefaultMeshResources(ctx context.Context, resManager manager.ResourceManager, meshName string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL