Add option to register on TCP server
Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
parent
5fdb4b8eef
commit
4b43303203
@ -15,6 +15,10 @@ version = 2
|
||||
# The 'plugins."io.containerd.grpc.v1.cri"' table contains all of the server options.
|
||||
[plugins."io.containerd.grpc.v1.cri"]
|
||||
|
||||
# disable_tcp_service disables serving CRI on the TCP server.
|
||||
# Note that a TCP server is enabled for containerd if TCPAddress is set in section [grpc].
|
||||
disable_tcp_service = true
|
||||
|
||||
# stream_server_address is the ip address streaming server is listening on.
|
||||
stream_server_address = "127.0.0.1"
|
||||
|
||||
|
@ -138,6 +138,8 @@ type PluginConfig struct {
|
||||
CniConfig `toml:"cni" json:"cni"`
|
||||
// Registry contains config related to the registry
|
||||
Registry Registry `toml:"registry" json:"registry"`
|
||||
// DisableTCPService disables serving CRI on the TCP server.
|
||||
DisableTCPService bool `toml:"disable_tcp_service" json:"disableTCPService"`
|
||||
// StreamServerAddress is the ip address streaming server is listening on.
|
||||
StreamServerAddress string `toml:"stream_server_address" json:"streamServerAddress"`
|
||||
// StreamServerPort is the port streaming server is listening on.
|
||||
@ -219,6 +221,7 @@ func DefaultConfig() PluginConfig {
|
||||
},
|
||||
},
|
||||
},
|
||||
DisableTCPService: true,
|
||||
StreamServerAddress: "127.0.0.1",
|
||||
StreamServerPort: "0",
|
||||
StreamIdleTimeout: streaming.DefaultConfig.StreamIdleTimeout.String(), // 4 hour
|
||||
|
@ -171,9 +171,15 @@ func NewCRIService(config criconfig.Config, client *containerd.Client) (CRIServi
|
||||
// Register registers all required services onto a specific grpc server.
|
||||
// This is used by containerd cri plugin.
|
||||
func (c *criService) Register(s *grpc.Server) error {
|
||||
instrumented := newInstrumentedService(c)
|
||||
runtime.RegisterRuntimeServiceServer(s, instrumented)
|
||||
runtime.RegisterImageServiceServer(s, instrumented)
|
||||
return c.register(s)
|
||||
}
|
||||
|
||||
// RegisterTCP register all required services onto a GRPC server on TCP.
|
||||
// This is used by containerd CRI plugin.
|
||||
func (c *criService) RegisterTCP(s *grpc.Server) error {
|
||||
if !c.config.DisableTCPService {
|
||||
return c.register(s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -267,6 +273,13 @@ func (c *criService) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *criService) register(s *grpc.Server) error {
|
||||
instrumented := newInstrumentedService(c)
|
||||
runtime.RegisterRuntimeServiceServer(s, instrumented)
|
||||
runtime.RegisterImageServiceServer(s, instrumented)
|
||||
return nil
|
||||
}
|
||||
|
||||
// imageFSPath returns containerd image filesystem path.
|
||||
// Note that if containerd changes directory layout, we also needs to change this.
|
||||
func imageFSPath(rootDir, snapshotter string) string {
|
||||
|
Loading…
Reference in New Issue
Block a user