Skip to content

Commit

Permalink
Introduced a new agent flag --csi_plugin_config_dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
qianzhangxa committed Aug 3, 2020
1 parent e5514e9 commit 4d3c3d7
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/configuration/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,49 @@ Example config file in this directory:
</td>
</tr>

<tr id="csi_plugin_config_dir">
<td>
--csi_plugin_config_dir=VALUE
</td>
<td>
Path to a directory that contains CSI plugin configs.
Each file in the config dir should contain a JSON object representing
a <code>CSIPluginInfo</code> object which can be either a managed CSI
plugin (i.e. the plugin launched by Mesos as a standalone container)
or an unmanaged CSI plugin (i.e. the plugin launched out of Mesos).
<p/>
Example config files in this directory:
<pre><code>{
"type": "org.apache.mesos.csi.managed-plugin",
"containers": [
{
"services": [
"CONTROLLER_SERVICE",
"NODE_SERVICE"
],
"command": {
"shell": false,
"value": "managed-plugin",
"arguments": [
"managed-plugin",
"--endpoint=$(CSI_ENDPOINT)"
]
},
"resources": [
{"name": "cpus", "type": "SCALAR", "scalar": {"value": 0.1}},
{"name": "mem", "type": "SCALAR", "scalar": {"value": 1024}}
]
}
]
}</code></pre>
<pre><code>{
"type": "org.apache.mesos.csi.unmanaged-plugin",
"node_service_endpoint": "/var/lib/unmanaged-plugin/csi.sock",
"target_path_root": "/mnt/unmanaged-plugin"
}</code></pre>
</td>
</tr>

<tr id="revocable_cpu_low_priority">
<td>
--[no-]revocable_cpu_low_priority
Expand Down
39 changes: 39 additions & 0 deletions src/slave/flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,45 @@ mesos::internal::slave::Flags::Flags()
" \"name\": \"lvm\"\n"
"}");

add(&Flags::csi_plugin_config_dir,
"csi_plugin_config_dir",
"Path to a directory that contains CSI plugin configs.\n"
"Each file in the config dir should contain a JSON object representing\n"
"a `CSIPluginInfo` object which can be either a managed CSI plugin\n"
"(i.e. the plugin launched by Mesos as a standalone container) or an\n"
"unmanaged CSI plugin (i.e. the plugin launched out of Mesos).\n"
"\n"
"Example config files in this directory:\n"
"{\n"
" \"type\": \"org.apache.mesos.csi.managed-plugin\",\n"
" \"containers\": [\n"
" {\n"
" \"services\": [\n"
" \"CONTROLLER_SERVICE\",\n"
" \"NODE_SERVICE\"\n"
" ],\n"
" \"command\": {\n"
" \"shell\": false,\n"
" \"value\": \"managed-plugin\",\n"
" \"arguments\": [\n"
" \"managed-plugin\",\n"
" \"--endpoint=$(CSI_ENDPOINT)\"\n"
" ]\n"
" },\n"
" \"resources\": [\n"
" {\"name\": \"cpus\", \"type\": \"SCALAR\", \"scalar\": {\"value\": 0.1}},\n" // NOLINT(whitespace/line_length)
" {\"name\": \"mem\", \"type\": \"SCALAR\", \"scalar\": {\"value\": 1024}}\n" // NOLINT(whitespace/line_length)
" ]\n"
" }\n"
" ]\n"
"}\n"
"\n"
"{\n"
" \"type\": \"org.apache.mesos.csi.unmanaged-plugin\",\n"
" \"node_service_endpoint\": \"/var/lib/unmanaged-plugin/csi.sock\",\n"
" \"target_path_root\": \"/mnt/unmanaged-plugin\"\n"
"}");

add(&Flags::disk_profile_adaptor,
"disk_profile_adaptor",
"The name of the disk profile adaptor module that storage resource\n"
Expand Down
1 change: 1 addition & 0 deletions src/slave/flags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Flags : public virtual logging::Flags
bool hostname_lookup;
Option<std::string> resources;
Option<std::string> resource_provider_config_dir;
Option<std::string> csi_plugin_config_dir;
Option<std::string> disk_profile_adaptor;
std::string isolation;
std::string launcher;
Expand Down

0 comments on commit 4d3c3d7

Please sign in to comment.