1
+ package runtime
2
+
3
+ // ContainerdConfigToml provides containerd configuration data for the server
4
+ type ContainerdConfigToml struct {
5
+ // Version of the config file
6
+ Version int `toml:"version"`
7
+ // Root is the path to a directory where containerd will store persistent data
8
+ Root string `toml:"root"`
9
+ // State is the path to a directory where containerd will store transient data
10
+ State string `toml:"state"`
11
+ // TempDir is the path to a directory where to place containerd temporary files
12
+ TempDir string `toml:"temp,omitempty"`
13
+ // PluginDir is the directory for dynamic plugins to be stored
14
+ //
15
+ // Deprecated: Please use proxy or binary external plugins.
16
+ PluginDir string `toml:"plugin_dir,omitempty"`
17
+ // GRPC configuration settings
18
+ GRPC GRPCConfig `toml:"grpc,omitempty"`
19
+ // TTRPC configuration settings
20
+ TTRPC TTRPCConfig `toml:"ttrpc,omitempty"`
21
+ // Debug and profiling settings
22
+ Debug Debug `toml:"debug,omitempty"`
23
+ // Metrics and monitoring settings
24
+ Metrics MetricsConfig `toml:"metrics,omitempty"`
25
+ // DisabledPlugins are IDs of plugins to disable. Disabled plugins won't be
26
+ // initialized and started.
27
+ // DisabledPlugins must use a fully qualified plugin URI.
28
+ DisabledPlugins []string `toml:"disabled_plugins,omitempty"`
29
+ // RequiredPlugins are IDs of required plugins. Containerd exits if any
30
+ // required plugin doesn't exist or fails to be initialized or started.
31
+ // RequiredPlugins must use a fully qualified plugin URI.
32
+ RequiredPlugins []string `toml:"required_plugins,omitempty"`
33
+ // Plugins provides plugin specific configuration for the initialization of a plugin
34
+ Plugins PluginsConfig `toml:"plugins,omitempty"`
35
+ // OOMScore adjust the containerd's oom score
36
+ OOMScore int `toml:"oom_score,omitempty"`
37
+ // Cgroup specifies cgroup information for the containerd daemon process
38
+ Cgroup CgroupConfig `toml:"cgroup,omitempty"`
39
+ // ProxyPlugins configures plugins which are communicated to over GRPC
40
+ ProxyPlugins map [string ]ProxyPlugin `toml:"proxy_plugins,omitempty"`
41
+ // Timeouts specified as a duration
42
+ Timeouts map [string ]string `toml:"timeouts,omitempty"`
43
+ // Imports are additional file path list to config files that can overwrite main config file fields
44
+ Imports []string `toml:"imports,omitempty"`
45
+ // StreamProcessors configuration
46
+ StreamProcessors map [string ]StreamProcessor `toml:"stream_processors,omitempty"`
47
+ }
48
+
49
+ type StreamProcessor struct {
50
+ // Accepts specific media-types
51
+ Accepts []string `toml:"accepts,omitempty"`
52
+ // Returns the media-type
53
+ Returns string `toml:"returns,omitempty"`
54
+ // Path or name of the binary
55
+ Path string `toml:"path"`
56
+ // Args to the binary
57
+ Args []string `toml:"args,omitempty"`
58
+ // Environment variables for the binary
59
+ Env []string `toml:"env,omitempty"`
60
+ }
61
+
62
+ type GRPCConfig struct {
63
+ Address string `toml:"address"`
64
+ TCPAddress string `toml:"tcp_address,omitempty"`
65
+ TCPTLSCA string `toml:"tcp_tls_ca,omitempty"`
66
+ TCPTLSCert string `toml:"tcp_tls_cert,omitempty"`
67
+ TCPTLSKey string `toml:"tcp_tls_key,omitempty"`
68
+ UID int `toml:"uid,omitempty"`
69
+ GID int `toml:"gid,omitempty"`
70
+ MaxRecvMsgSize int `toml:"max_recv_message_size,omitempty"`
71
+ MaxSendMsgSize int `toml:"max_send_message_size,omitempty"`
72
+ }
73
+
74
+ // TTRPCConfig provides TTRPC configuration for the socket
75
+ type TTRPCConfig struct {
76
+ Address string `toml:"address"`
77
+ UID int `toml:"uid,omitempty"`
78
+ GID int `toml:"gid,omitempty"`
79
+ }
80
+
81
+ // Debug provides debug configuration
82
+ type Debug struct {
83
+ Address string `toml:"address,omitempty"`
84
+ UID int `toml:"uid,omitempty"`
85
+ GID int `toml:"gid,omitempty"`
86
+ Level string `toml:"level,omitempty"`
87
+ // Format represents the logging format. Supported values are 'text' and 'json'.
88
+ Format string `toml:"format,omitempty"`
89
+ }
90
+
91
+ // MetricsConfig provides metrics configuration
92
+ type MetricsConfig struct {
93
+ Address string `toml:"address,omitempty"`
94
+ GRPCHistogram bool `toml:"grpc_histogram,omitempty"`
95
+ }
96
+
97
+ // CgroupConfig provides cgroup configuration
98
+ type CgroupConfig struct {
99
+ Path string `toml:"path,omitempty"`
100
+ }
101
+
102
+ // ProxyPlugin provides a proxy plugin configuration
103
+ type ProxyPlugin struct {
104
+ Type string `toml:"type"`
105
+ Address string `toml:"address"`
106
+ Platform string `toml:"platform,omitempty"`
107
+ Exports map [string ]string `toml:"exports,omitempty"`
108
+ Capabilities []string `toml:"capabilities,omitempty"`
109
+ }
110
+
111
+ type PluginsConfig struct {
112
+ Cri CriConfig `toml:"io.containerd.grpc.v1.cri,omitempty"`
113
+ Cgroups MonitorConfig `toml:"io.containerd.monitor.v1.cgroups,omitempty"`
114
+ LinuxRuntime interface {} `toml:"io.containerd.runtime.v1.linux,omitempty"`
115
+ Scheduler GCSchedulerConfig `toml:"io.containerd.gc.v1.scheduler,omitempty"`
116
+ Bolt interface {} `toml:"io.containerd.metadata.v1.bolt,omitempty"`
117
+ Task RuntimeV2TaskConfig `toml:"io.containerd.runtime.v2.task,omitempty"`
118
+ Opt interface {} `toml:"io.containerd.internal.v1.opt,omitempty"`
119
+ Restart interface {} `toml:"io.containerd.internal.v1.restart,omitempty"`
120
+ Tracing interface {} `toml:"io.containerd.internal.v1.tracing,omitempty"`
121
+ Otlp interface {} `toml:"io.containerd.tracing.processor.v1.otlp,omitempty"`
122
+ Aufs interface {} `toml:"io.containerd.snapshotter.v1.aufs,omitempty"`
123
+ Btrfs interface {} `toml:"io.containerd.snapshotter.v1.btrfs,omitempty"`
124
+ Devmapper interface {} `toml:"io.containerd.snapshotter.v1.devmapper,omitempty"`
125
+ Native interface {} `toml:"io.containerd.snapshotter.v1.native,omitempty"`
126
+ Overlayfs interface {} `toml:"io.containerd.snapshotter.v1.overlayfs,omitempty"`
127
+ Zfs interface {} `toml:"io.containerd.snapshotter.v1.zfs,omitempty"`
128
+ }
129
+
130
+ type MonitorConfig struct {
131
+ NoPrometheus bool `toml:"no_prometheus,omitempty"`
132
+ }
133
+
134
+ type GCSchedulerConfig struct {
135
+ PauseThreshold float64 `toml:"pause_threshold,omitempty"`
136
+ DeletionThreshold int `toml:"deletion_threshold,omitempty"`
137
+ MutationThreshold int `toml:"mutation_threshold,omitempty"`
138
+ ScheduleDelay string `toml:"schedule_delay,omitempty"`
139
+ StartupDelay string `toml:"startup_delay,omitempty"`
140
+ }
141
+
142
+ type RuntimeV2TaskConfig struct {
143
+ Platforms []string `toml:"platforms,omitempty"`
144
+ SchedCore bool `toml:"sched_core,omitempty"`
145
+ }
146
+
147
+ type CriConfig struct {
148
+ Containerd CriContainerdConfig `toml:"containerd,omitempty"`
149
+ Registry RegistryConfig `toml:"registry,omitempty"`
150
+ }
151
+
152
+ type CriContainerdConfig struct {
153
+ DefaultRuntimeName string `toml:"default_runtime_name,omitempty"`
154
+ Runtimes map [string ]RuntimeConfig `toml:"runtimes,omitempty"`
155
+ }
156
+
157
+ type RuntimeConfig struct {
158
+ PrivilegedWithoutHostDevices bool `toml:"privileged_without_host_devices,omitempty"`
159
+ RuntimeType string `toml:"runtime_type"`
160
+ Options RuntimeOptions `toml:"options,omitempty"`
161
+ }
162
+
163
+ type RuntimeOptions struct {
164
+ BinaryName string `toml:"BinaryName,omitempty"`
165
+ }
166
+
167
+ type RegistryConfig struct {
168
+ ConfigPath string `toml:"config_path,omitempty"`
169
+ }
0 commit comments