dcos storage plugin-configuration

ENTERPRISE

BETA

Manage plugin configurations.

WARNING: Beta Software This software may contain bugs, incomplete features, incorrect documentation, or other discrepancies. Contact Mesosphere before deploying a beta candidate service. Product support is available to approved participants in the beta test program. Contact support@mesosphere.io for information about participation.

dcos storage plugin-configuration

Manage plugin configurations.

Synopsis

A plugin configuration specifies how DSS launches a CSI plugin instance when a volume provider is created.

A CSI plugin is a software component used to present storage capacity to a DC/OS cluster. An example CSI plugin is the lvm CSI plugin which presents LVM2 volume groups as storage capacity to a DC/OS cluster. A CSI plugin runs on a DC/OS private or public agent in the cluster.

DSS takes care of managing the various instances of a CSI plugin running in the DC/OS cluster.

A plugin configuration specifies a CSI plugin to use. Currently the only supported plugins are lvm and devices.

A plugin configuration can specify environment variables, resource limits and the URI to the CSI plugin binary which will be fetched and launched when a volume provider is created from the plugin configuration. A new version of a plugin configuration is created using the ‘dcos storage plugin-configuration update’ subcommand.

You can view the values of the config-version field for your plugin configurations using the dcos storage plugin-configuration list command.

DSS ships with a default plugin configuration for the lvm and devices plugins. You can see the default plugin configuration using the ‘dcos storage plugin-configuration generate’ subcommand.

# Print default configuration for `lvm` plugins.
$ dcos storage plugin-configuration generate --name=lvm

# Print default configuration for `devices` plugins.
$ dcos storage plugin-configuration generate --name=devices
```bash

After you upgrade DSS you may want to upgrade your plugin configurations to pick
up tweaks and fixes. On the other hand, you may have already carefully crafted
your plugin configurations, in which case DSS does not want to automatically
update them. If you would like to update your plugin configurations you can run
the following commands

```bash
# List all versions of the 'lvm' plugin configuration, newer versions are
# displayed at the bottom.
# The bottom version of the plugin configuration is the latest one. If the
# --all-versions flag is not specified, only the latest plugin configuration
# will be shown.
$ dcos storage plugin-configuration list --name=lvm --all-versions
{
  "plugin-configurations": [
      {
          "name": "lvm",
          "description": "Default configuration for the lvm plugin shipped with DSS",
          "config-version": 1,
          "spec": {
              "csi-template": {
                  "services": [
                      "CONTROLLER_SERVICE",
                      "NODE_SERVICE"
                  ],
                  "command": {
                      "value": "{{.Cmdline | json }}",
                      "shell": true,
                      "environment": {
                          "CONTAINER_LOGGER_DESTINATION_TYPE": "journald+logrotate",
                          "CONTAINER_LOGGER_EXTRA_LABELS": "{\"CSI_PLUGIN\":\"csilvm\"}",
                          "LD_LIBRARY_PATH": "/opt/mesosphere/lib",
                          "PATH": "/opt/mesosphere/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                      },
                      "uris": [
                          {
                              "value": "http://storage-artifacts.marathon.l4lb.thisdcos.directory:10000/csilvm",
                              "cache": true,
                              "executable": true
                          }
                      ]
                  },
                  "resources": [
                      {
                          "name": "cpus",
                          "value": 0.1
                      },
                      {
                          "name": "mem",
                          "value": 128
                      },
                      {
                          "name": "disk",
                          "value": 10
                      }
                  ]
              }
          },
          "created-at": "2019-04-01T09:40:58.237692Z"
      },
      {
          "name": "lvm",
          "description": "Default configuration for the lvm plugin shipped with DSS",
          "config-version": 2,
          "spec": {
              "csi-template": {
                  "services": [
                      "CONTROLLER_SERVICE",
                      "NODE_SERVICE"
                  ],
                  "command": {
                      "value": "{{.Cmdline | json }}",
                      "shell": true,
                      "environment": {
                          "CONTAINER_LOGGER_DESTINATION_TYPE": "journald+logrotate",
                          "CONTAINER_LOGGER_EXTRA_LABELS": "{\"CSI_PLUGIN\":\"csilvm\"}",
                          "LD_LIBRARY_PATH": "/opt/mesosphere/lib",
                          "PATH": "/opt/mesosphere/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                      },
                      "uris": [
                          {
                              "value": "http://storage-artifacts.marathon.l4lb.thisdcos.directory:10000/csilvm",
                              "cache": true,
                              "executable": true
                          }
                      ]
                  },
                  "resources": [
                      {
                          "name": "cpus",
                          "value": 0.1
                      },
                      {
                          "name": "mem",
                          "value": 256
                      },
                      {
                          "name": "disk",
                          "value": 10
                      }
                  ]
              }
          },
          "created-at": "2019-04-02T09:40:58.237692Z"
      }
  ]
}

# Update the lvm plugin configuration using the default 'lvm' plugin configuration
# that is baked into the current DSS version. This is typically done after upgrading.
$ dcos storage plugin-configuration generate --name=lvm | \
  dcos storage plugin-configuration update

# Let's list the 'lvm' plugin configuration versions once more.
$ dcos storage plugin-configuration list --name=lvm --all-versions
{
  "plugin-configurations": [
      {
          "name": "lvm",
          "description": "Default configuration for the lvm plugin shipped with DSS",
          "config-version": 1,
          "spec": {
              "csi-template": {
                  "services": [
                      "CONTROLLER_SERVICE",
                      "NODE_SERVICE"
                  ],
                  "command": {
                      "value": "{{.Cmdline | json }}",
                      "shell": true,
                      "environment": {
                          "CONTAINER_LOGGER_DESTINATION_TYPE": "journald+logrotate",
                          "CONTAINER_LOGGER_EXTRA_LABELS": "{\"CSI_PLUGIN\":\"csilvm\"}",
                          "LD_LIBRARY_PATH": "/opt/mesosphere/lib",
                          "PATH": "/opt/mesosphere/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                      },
                      "uris": [
                          {
                              "value": "http://storage-artifacts.marathon.l4lb.thisdcos.directory:10000/csilvm",
                              "cache": true,
                              "executable": true
                          }
                      ]
                  },
                  "resources": [
                      {
                          "name": "cpus",
                          "value": 0.1
                      },
                      {
                          "name": "mem",
                          "value": 128
                      },
                      {
                          "name": "disk",
                          "value": 10
                      }
                  ]
              }
          },
          "created-at": "2019-04-01T09:40:58.237692Z"
      },
      {
          "name": "lvm",
          "description": "Default configuration for the lvm plugin shipped with DSS",
          "config-version": 2,
          "spec": {
              "csi-template": {
                  "services": [
                      "CONTROLLER_SERVICE",
                      "NODE_SERVICE"
                  ],
                  "command": {
                      "value": "{{.Cmdline | json }}",
                      "shell": true,
                      "environment": {
                          "CONTAINER_LOGGER_DESTINATION_TYPE": "journald+logrotate",
                          "CONTAINER_LOGGER_EXTRA_LABELS": "{\"CSI_PLUGIN\":\"csilvm\"}",
                          "LD_LIBRARY_PATH": "/opt/mesosphere/lib",
                          "PATH": "/opt/mesosphere/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                      },
                      "uris": [
                          {
                              "value": "http://storage-artifacts.marathon.l4lb.thisdcos.directory:10000/csilvm",
                              "cache": true,
                              "executable": true
                          }
                      ]
                  },
                  "resources": [
                      {
                          "name": "cpus",
                          "value": 0.1
                      },
                      {
                          "name": "mem",
                          "value": 256
                      },
                      {
                          "name": "disk",
                          "value": 10
                      }
                  ]
              }
          },
          "created-at": "2019-04-02T09:40:58.237692Z"
        },
        {
            "name": "lvm",
            "description": "Default configuration for the lvm plugin shipped with DSS",
            "config-version": 3,
            "spec": {
                "csi-template": {
                    "services": [
                        "CONTROLLER_SERVICE",
                        "NODE_SERVICE"
                    ],
                    "command": {
                        "value": "{{.Cmdline | json }}",
                        "shell": true,
                        "environment": {
                            "CONTAINER_LOGGER_DESTINATION_TYPE": "journald+logrotate",
                            "CONTAINER_LOGGER_EXTRA_LABELS": "{\"CSI_PLUGIN\":\"csilvm\"}",
                            "LD_LIBRARY_PATH": "/opt/mesosphere/lib",
                            "PATH": "/opt/mesosphere/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                        },
                        "uris": [
                            {
                                "value": "http://storage-artifacts.marathon.l4lb.thisdcos.directory:10000/csilvm",
                                "cache": true,
                                "executable": true
                            }
                        ]
                    },
                    "resources": [
                        {
                            "name": "cpus",
                            "value": 0.1
                        },
                        {
                            "name": "mem",
                            "value": 512
                        },
                        {
                            "name": "disk",
                            "value": 10
                        }
                    ]
                }
            },
            "created-at": "2019-04-03T09:40:58.237692Z"
        }
    ]
}

Notice that there is a new lvm plugin configuration version registered (i.e., "config-version": 3).

Now that the lvm plugin configuration has been updated we need to upgrade our lvm volume providers to use the latest version.

# Show the list of existing providers. There is only one volume provider called `lvm-ssds`.
$ dcos storage provider list --plugin=lvm --json
{
    "providers": [
        {
            "name": "lvm-ssds",
            "spec": {
                "plugin": {
                    "name": "lvm",
                    "config-version": 1,
                },
                ...
            }
        }
    ]
}

# We see that it currently lists the plugin as `lvm` and the `config-version` as 1.
# We will proceed to upgrade this volume provider from `config-version: 1` to `config-version: 3`.
$ cat <<EOF | dcos storage provider modify
{
    "name": "lvm-ssds",
    "spec": {
        "plugin": {
            "name": "lvm",
            "config-version": 3
        }
    }
}
EOF
```bash

It is somewhat awkward having to specify the plugin configuration's
'config-version' when modifying the volume provider if all we intend to do is
update it use the latest config-version. Instead, we can set the config-version
field to "latest" and DSS will replace the "latest" string with whatever the
current plugin configuration's 'config-version' is.

```bash
# Upgrade this volume provider from 'config-version: 1' to 'config-version: latest'.
$ cat <<EOF | dcos storage provider modify
{
    "name": "lvm-ssds",
    "spec": {
        "plugin": {
            "name": "lvm",
            "config-version": "latest"
        }
    }
}
EOF

If the spec.plugin field is present in the volume provider configuration JSON the volume provider’s plugin configuration is updated. If the spec.plugin field is not present, the provider’s plugin configuration version is not modified.

dcos storage plugin-configuration [flags]

Options inherited from parent commands

Name Description
-h,--help Help for this command.
--timeout duration Override the default request timeout. (default 55s)