项目作者: kaustavb12

项目描述 :
Installs rexray docker plugin to nodes in cluster
高级语言: Shell
项目地址: git://github.com/kaustavb12/rexray-plugin-installer.git
创建时间: 2021-04-02T01:35:17Z
项目社区:https://github.com/kaustavb12/rexray-plugin-installer

开源协议:MIT License

下载


Build

Rexray Plugin Installer

Docker image with embedded shell script to install or update Rexray plug-in to nodes in Docker Swarm Clusters

Currently only rexray/dobs and rexray/s3fs plug-ins are supported. Support for other rexray plug-ins to be included later.

Usage

  1. install-plugin.sh --driver <plugin> [--version <plugin-version>] [--update] DRIVER-OPTIONS

--driver <plugin> Mandatory Rexray plugin driver. Currently only dobs and s3fs are supported.

--version <plugin-version> Optional The plug-in version tag to installed. Can be either latest or specific tag like 0.11.4

--update Optional Force Update installed plug-in irrespective of plug-in version installed

rexray/dobs Driver Options

--do-secret <do_token_secret> Mandatory Docker secret holding the DigitalOcean Access Token to be used to set DOBS_TOKEN. Do not use the actual API Token. It is assumed that the secret is mounted in the default location /run/secrets/

--do-region <do_region> Mandatory Set DOBS_REGION - The region where volumes should be created. Example : blr1, fra1, nyc3, etc.

--do-convert-underscore Optional Set DOBS_CONVERTUNDERSCORES to true

--do-init-delay <time> Optional Set DOBS_STATUSINITIALDELAY - Time duration used to wait when polling volume status

--do-max-attempts <count> Optional Set DOBS_STATUSMAXATTEMPTS - Number of times the status of a volume will be queried before giving up

--do-status-timeout <time> Optional Set DOBS_STATUSTIMEOUT - Maximum length of time that polling for volume status can occur

--http-proxy <proxy_endpoint> Optional Set HTTP_PROXY - Address of HTTP proxy server to gain access to API endpoint

rexray/s3fs Driver Options

--aws-accesskey-secret <s3_accesskey_secret> Mandatory Docker Secret holding the AWS Access Key ID to be used to set S3FS_ACCESSKEY. Do not use the actual API Token. It is assumed that the secret is mounted in the default location /run/secrets/

--aws-secretkey-secret <s3_secretkey_secret> Mandatory Docker Secret holding the AWS Secret Access Key to be used to set S3FS_SECRETKEY. Do not use the actual API Token. It is assumed that the secret is mounted in the default location /run/secrets/

--s3-disable-pathstyle Optional Set S3FS_DISABLEPATHSTYLE to true

--s3-max-retry <count> Optional Set S3FS_MAXRETRIES - The number of retries that will be made for failed operations by the AWS SDK

--s3-region <s3_region> Optional Set S3FS_REGION - The AWS region. Example : ap-south-1, ap-east-1, us-east-2, etc.

--s3-options <s3_options> Optional Set S3FS_OPTION - Additional options to pass to S3FS

--http-proxy <proxy_endpoint> Optional Set HTTP_PROXY - Address of HTTP proxy server to gain access to API endpoint

  1. $ ./install-plugin.sh --help
  2. Usage: install-plugin.sh --driver <plugin> [--version <plugin-version>] [--update] DRIVER-OPTIONS
  3. REXRAY PLUGINS SUPPORTED
  4. dobs DigitalOcean Block Storage
  5. s3fs AWS S3
  6. DigitalOcean DRIVER OPTIONS
  7. --do-secret <do_token_secret> Docker Secret containing DigitalOcean Access Token to be used to set DOBS_TOKEN
  8. --do-region <do_region> Set DOBS_REGION - The region where volumes should be created
  9. [--do-convert-underscore] Set DOBS_CONVERTUNDERSCORES to true
  10. [--do-init-delay <time>] Set DOBS_STATUSINITIALDELAY - Time duration used to wait when polling volume status
  11. [--do-max-attempts <count>] Set DOBS_STATUSMAXATTEMPTS - Number of times the status of a volume will be queried before giving up
  12. [--do-status-timeout <time>] Set DOBS_STATUSTIMEOUT - Maximum length of time that polling for volume status can occur
  13. [--http-proxy <proxy_endpoint>] Set HTTP_PROXY - Address of HTTP proxy server to gain access to API endpoint
  14. AWS S3 DRIVER OPTIONS
  15. --aws-accesskey-secret <s3_accesskey_secret> Docker Secret container AWS Access Key to be used to set S3FS_ACCESSKEY
  16. --aws-secretkey-secret <s3_secretkey_secret> Docker Secret container AWS Secret Key to be used to set S3FS_SECRETKEY
  17. [--s3-disable-pathstyle] Set S3FS_DISABLEPATHSTYLE to true
  18. [--s3-max-retry <count>] Set S3FS_MAXRETRIES - The number of retries that will be made for failed operations by the AWS SDK
  19. [--s3-region <s3_region>] Set S3FS_REGION - The AWS region
  20. [--s3-options <s3_options>] Set S3FS_OPTION - Additional options to pass to S3FS
  21. [--http-proxy <proxy_endpoint>] Set HTTP_PROXY - Address of HTTP proxy server to gain access to API endpoint

Sample Stack

  1. version: "3.8"
  2. services:
  3. install-rexray-plugin:
  4. image: "kaustavb12/rexray-plugin-installer"
  5. volumes:
  6. - /var/run/docker.sock:/var/run/docker.sock
  7. secrets:
  8. - rexray_do_token
  9. command: sh -c "./install-plugin.sh --driver dobs --version 0.11.4 --do-secret rexray_do_token --do-region blr1 --do-convert-underscore"
  10. deploy:
  11. mode: global
  12. restart_policy:
  13. condition: on-failure
  14. secrets:
  15. rexray_do_token:
  16. external: true

Script Behaviour

  1. If no version using the --version option is provided, the script installs plug-in using latest tag to nodes where plug-in is not already installed. If plug-in is already installed, then no action is taken.

  2. If latest is provided as version --version latest, the script installs plug-in using latest tag to nodes. If plug-in is already installed, script updates the plug-in with latest tag.

  3. If specific version is provided --version 0.11.4, the script installs plug-in using that specific tag to nodes. If plug-in is already installed, script checks the tag of the installed plug-in. If the installed tag does not match the provided tag (including installed tag being latest), then the plug-in is updated using the provided tag.

  4. If force update option --update is used, the script updates plug-in already installed irrespective of the installed tag and provided tag. If plug-in is not already installed, then it is installed with appropriate tag. This is useful if any driver options need to be updated without changing the version tag.

NOTE: To update an already installed plug-in, the plug-in is first removed and then re-installed with appropriate tag and options.