Managing cloud credentials using pxctl
Prerequisites
This document provides instructions for managing your cloud credentials using pxctl.
The cloud provider credentials are stored in an external secret store. For more information about securing a third-party S3-compatible objectstore for use with Portworx, refer to the Certificates as Kubernetes Secrets page.
Before you use the below commands, you should configure a secret provider of your choice with Portworx. For more information, head over to the Key Management page.
Overview
You can use the pxctl credentials command to create, list, validate, or delete your cloud credentials. Then, Portworx will use these credentials, for example, to back up your volumes to the cloud.
Run the /opt/pwx/bin/pxctl credentials command with the --help flag to list the available subcommands and flags.
List credentials
To list all configured credentials, use this command:
pxctl credentials list
S3 Credentials
UUID REGION ENDPOINT ACCESS KEY SSL ENABLED ENCRYPTION
XXXX us-east-1 s3.amazonaws.com XXXX false false
Azure Credentials
UUID ACCOUNT NAME ENCRYPTION
XXXX portworxtest false
Create and configure credentials
You can create and configure credentials in multiple ways depending on your cloud provider and how you want to manage them.
Create credentials on AWS by specifying your keys
The --s3-storage-class flag requires Portworx Enterprise version 2.5.3 or higher
Enter the pxctl credentials create command, specifying:
-
The
--providerflag with the name of the cloud provider (s3). -
The
--s3-access-keyflag with your secret access key. -
The
--s3-secret-keyflag with your access key ID. -
The
--s3-regionflag with the name of the S3 region (us-east-1). -
The
--s3-endpointflag with the name of the endpoint (s3.amazonaws.com). -
(Optional) The
--s3-storage-classflag with either theSTANDARDorSTANDARD-IAvalue, depending on which storage class you prefer. -
(Optional) The
--bucketflag with the name of the bucket. -
The name of your cloud credentials.
pxctl credentials create \
--provider s3 \
--s3-access-key <YOUR-SECRET-ACCESS-KEY>
--s3-secret-key <YOUR-ACCESS-KEY-ID> \
--s3-region us-east-1 \
--s3-endpoint s3.amazonaws.com \
--s3-storage-class STANDARD \
--bucket <BUCKET-NAME> \
<NAME>Credentials created successfully
If you have not specified the bucket name, this command will create a bucket with the Portworx cluster UUID to use for the backups.
Create credential on AWS with s3 encryption
You can configure AWS s3 credentials to use server-side encryption, assuming the s3 object-store provider supports it.
Enter the pxctl credentials create command, specifying:
-
The
--providerflag with the name of the cloud provider (s3). -
The
--s3-access-keyflag with your secret access key -
The
--s3-secret-keyflag with your access key ID -
The
--s3-regionflag with the name of the S3 region (us-east-1) -
The
--s3-endpointflag with the name of the endpoint (s3.amazonaws.com) -
The optional
--s3-storage-classflag with either theSTANDARDorSTANDARD-IAvalue, depending on which storage class you prefer -
The optional
--s3-sseflag withAES256oraws:kms, depending on how you want to do the server side encryption. If usingaws:kms, see the AWS s3 documentation. -
The name of your cloud credentials
pxctl credentials create \
--provider s3 \
--s3-access-key <YOUR-SECRET-ACCESS-KEY>
--s3-secret-key <YOUR-ACCESS-KEY-ID> \
--s3-region us-east-1 \
--s3-endpoint s3.amazonaws.com \
--s3-sse AES256 \
<NAME>Credentials created successfully
Create credentials on AWS using IAM
This feature requires Portworx Enterprise version 2.5.1 or greater
Instead of storing your secret access key and access key ID on the host, you can grant Portworx bucket permissions using IAM. You can grant the EC2 instances on which Portworx is running, or you can grant permissions for a specific bucket.