Merge pull request #714 from mikebrow/disable-tls-flag
adds a new flag to enable TLS support (insecure for now)
This commit is contained in:
commit
d36d62ecd4
@ -83,6 +83,8 @@ type PluginConfig struct {
|
|||||||
StatsCollectPeriod int `toml:"stats_collect_period" json:"statsCollectPeriod"`
|
StatsCollectPeriod int `toml:"stats_collect_period" json:"statsCollectPeriod"`
|
||||||
// SystemdCgroup enables systemd cgroup support.
|
// SystemdCgroup enables systemd cgroup support.
|
||||||
SystemdCgroup bool `toml:"systemd_cgroup" json:"systemdCgroup"`
|
SystemdCgroup bool `toml:"systemd_cgroup" json:"systemdCgroup"`
|
||||||
|
// EnableTLSStreaming indicates to enable the TLS streaming support.
|
||||||
|
EnableTLSStreaming bool `toml:"enable_tls_streaming" json:"enableTLSStreaming"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config contains all configurations for cri server.
|
// Config contains all configurations for cri server.
|
||||||
@ -118,6 +120,7 @@ func DefaultConfig() PluginConfig {
|
|||||||
StreamServerAddress: "",
|
StreamServerAddress: "",
|
||||||
StreamServerPort: "10010",
|
StreamServerPort: "10010",
|
||||||
EnableSelinux: false,
|
EnableSelinux: false,
|
||||||
|
EnableTLSStreaming: false,
|
||||||
SandboxImage: "k8s.gcr.io/pause:3.1",
|
SandboxImage: "k8s.gcr.io/pause:3.1",
|
||||||
StatsCollectPeriod: 10,
|
StatsCollectPeriod: 10,
|
||||||
SystemdCgroup: false,
|
SystemdCgroup: false,
|
||||||
|
@ -60,13 +60,15 @@ func newStreamServer(c *criService, addr, port string) (streaming.Server, error)
|
|||||||
config := streaming.DefaultConfig
|
config := streaming.DefaultConfig
|
||||||
config.Addr = net.JoinHostPort(addr, port)
|
config.Addr = net.JoinHostPort(addr, port)
|
||||||
runtime := newStreamRuntime(c)
|
runtime := newStreamRuntime(c)
|
||||||
tlsCert, err := newTLSCert()
|
if c.config.EnableTLSStreaming {
|
||||||
if err != nil {
|
tlsCert, err := newTLSCert()
|
||||||
return nil, errors.Wrap(err, "failed to generate tls certificate for stream server")
|
if err != nil {
|
||||||
}
|
return nil, errors.Wrap(err, "failed to generate tls certificate for stream server")
|
||||||
config.TLSConfig = &tls.Config{
|
}
|
||||||
Certificates: []tls.Certificate{tlsCert},
|
config.TLSConfig = &tls.Config{
|
||||||
InsecureSkipVerify: true,
|
Certificates: []tls.Certificate{tlsCert},
|
||||||
|
InsecureSkipVerify: true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return streaming.NewServer(config, runtime)
|
return streaming.NewServer(config, runtime)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user