CSM CLI
csm
is a command-line client for installation of Dell Container Storage Modules and CSI Drivers for Kubernetes clusters.
Pre-requisites
- Deploy the Container Storage Modules Installer
- Download/Install the
csm
binary from Github: https://github.com/dell/csm. Alternatively, you can build the binary by:- cloning the
csm
repository - changing into
csm/cmd/csm
directory - running
make build
- cloning the
- create a
cli_env.sh
file that contains the correct values for the below variables. And export the variables by runningsource ./cli_env.sh
# Change this to CSM API Server IP
export API_SERVER_IP="127.0.0.1"
# Change this to CSM API Server Port
export API_SERVER_PORT="31313"
# CSM API Server protocol - allowed values are https & http
export SCHEME="https"
# Path to store JWT <token>
export AUTH_CONFIG_PATH="/home/user/installer-token/"
Usage
~$ ./csm -h
csm is command line tool for csm application
Usage:
csm [flags]
csm [command]
Available Commands:
add add cluster, configuration or storage
approve-task approve task for application
authenticate authenticate user
change change - subcommand is password
create create application
delete delete storage, cluster, configuration or application
get get storage, cluster, application, configuration, supported driver, module, storage type
help Help about any command
reject-task reject task for an application
update update storage, configuration or cluster
Flags:
-h, --help help for csm-cli
Use "csm [command] --help" for more information about a command.
Authenticate the User
To begin with, you need to authenticate the user who will be managing the CSM Installer and its components.
./csm authenticate --username=<admin-username> --password=<admin-password>
Or more securely, run the above command without --password
to be prompted for one
./csm authenticate --username=<admin-username>
Enter user's password:
Change Password
To change password follow below command
./csm change password --username=<admin-username>
View Supported Platforms
You can now view the supported DellCSI Drivers
./csm get supported-drivers
You can also view the supported Modules
./csm get supported-modules
And also view the supported Storage Array Types
./csm get supported-storage-arrays
Add a Cluster
You can now add a cluster by providing cluster detail name and Kubeconfig path
./csm add cluster --clustername <desire-cluster-name> --configfilepath <path-to-kubeconfig>
Upload Configuration Files
You can now add a configuration file that can be used for creating application by providing filename and path
./csm add configuration --filename <name-of-the-desire-file> --filepath <path-to-the-desired-file>
Add a Storage System
You can now add storage endpoints, array type and its unique id
./csm add storage --endpoint <storage-array-endpoint> --storage-type <storage-array-type> --unique-id <storage-array-unique-id> --username <storage-array-username>
The optional --meta-data
flag can be used to provide additional meta-data for the storage system that is used when creating Secrets for the CSI Driver. These fields include:
- isDefault: Set to true if this storage system is used as default for multi-array configuration
- skipCertificateValidation: Set to true to skip certificate validation
- mdmId: Comma separated list of MDM IPs for PowerFlex
- nasName: NAS Name for PowerStore
- blockProtocol: Block Protocol for PowerStore
- port: Port for PowerScale
- portGroups: Comma separated list of port group names for PowerMax
Create an Application
You may now create an application depending on the specific use case. Below are the common use cases:
CSI Driver
./csm create application --clustername <created-cluster-name> \
--driver-type powerflex:<tag> --name <desired-application-name> \
--storage-arrays <storage-array-type>
CSI Driver with CSM Authorization
CSM Authorization requires a token.yaml
issued by storage Admin from the CSM Authorization Server, a certificate file, and the token.yaml
and cert
should be added by following the steps in adding configuration file. CSM Authorization does not yet support all CSI Drivers/platforms(See supported platforms documentation or supported platforms via CLI)).
Finally, run the command below:
./csm create application --clustername <created-cluster-name> \
--driver-type powerflex:<tag> --name <desired-application-name> \
--storage-arrays <storage-array-unique-id> \
--module-type authorization:<tag> \
--module-configuration "karaviAuthorizationProxy.proxyAuthzToken.filename=<filename-for-token>,karaviAuthorizationProxy.rootCertificate.filename=<filename-for-cert>,karaviAuthorizationProxy.proxyHost=<proxyHost-address>"
CSM Observability(Standalone)
CSM Observability depends on driver config secret(s) corresponding to the metric(s) you want to enable. Please see CSM Observability for all Supported Metrics. For the sake of demonstration, assuming we want to enable CSM Metrics for PowerFlex, the PowerFlex secret yaml should be added by following the steps in adding configuration file. Once this is done, run the command below:
./csm create application --clustername <created-cluster-name> \
--name <desired-application-name> \
--module-type observability:<tag> \
--module-configuration "karaviMetricsPowerflex.driverConfig.filename=<filename-for-powerflex-config>,karaviMetricsPowerflex.enabled=true"
CSM Observability(Standalone) with CSM Authorization
See the individual steps for configuaration file pre-requisites for CSM Observability (Standalone) with CSM Authorization
./csm create application --clustername <created-cluster-name> \
--name <desired-application-name> \
--module-type "observability:<tag>,authorization:<tag>" \
--module-configuration "karaviMetricsPowerflex.driverConfig.filename=<filename-for-powerflex-config>,karaviMetricsPowerflex.enabled=true,karaviAuthorizationProxy.proxyAuthzToken.filename=<filename-for-token>,karaviAuthorizationProxy.rootCertificate.filename=<filename-for-cert>,karaviAuthorizationProxy.proxyHost=<proxyHost-address>"
CSI Driver for Dell PowerMax with reverse proxy module
To deploy CSI Driver for Dell PowerMax with reverse proxy module, first upload reverse proxy tls crt and tls key via adding configuration file. Then, use the below command to create application:
./csm create application --clustername <created-cluster-name> \
--driver-type powermax:<tag> --name <desired-application-name> \
--storage-arrays <powermax-unique-id> \
--module-type reverse-proxy:<tag> \
--module-configuration reverseProxy.tlsSecretKeyFile=<revprotlskey>,reverseProxy.tlsSecretCertFile=<revprotlscert>
CSI Driver with replication module
To deploy CSI driver with replication module, first add a target cluster through adding cluster. Then, use the below command(this command is an example to deploy CSI Driver for Dell PowerStore with replication module) to create application::
./csm create application --clustername <created-cluster-name> \
--driver-type powerstore:<tag> --name <desired-application-name> \
--storage-arrays <storage-array-unique-id> \
--module-configuration target_cluster=<created-target-cluster-name> \
--module-type replication:<tag>
CSI Driver with other module(s) not covered above
Assuming you want to deploy a driver with module A
and module B
. If they have specific configurations of A.image="docker:v1"
,A.filename=hello
, and B.namespace=world
.
./csm create application --clustername <created-cluster-name> \
--driver-type powerflex:<tag> --name <desired-application-name> \
--storage-arrays <storage-array-unique-id> \
--module-type "module A:<tag>,module B:<tag>" \
--module-configuration "A.image=docker:v1,A.filename=hello,B.namespace=world"
Note:
--driver-type
and--module-type
flags in create application command MUST match the values from the supported CSM platforms- Replication module supports only using a pair of clusters at a time (source and a target/or single cluster) from CSM installer, However
repctl
can be used if needed to add multiple pairs of target clusters. Using replication module with other modules during application creation is not yet supported.
Approve application/task
You may now approve the task so that you can continue to work with the application
./csm approve-task --applicationname <created-application-name>
Reject application/task
You may want to reject a task or application to discontinue the ongoing process
./csm reject-task --applicationname <created-application-name>
Delete application/task
If you want to delete an application
./csm delete application --name <created-application-name>
Note: When deleting an application, the namespace and Secrets are not deleted. These resources need to be deleted manually. See more in Troubleshooting.
Note: All commands and associated syntax can be displayed with -h or –help