Configure Portworx Backup for S3 object store with TLS
This topic explains how to configure Portworx Backup with a secure S3 compatible object store having a self-signed certificate with TLS enabled.
You need to configure the following components to add the secure S3 object store certificate. This configuration enables the components to perform the following tasks by accessing the S3 object store:
- Stork: to back up Kubernetes resources
- Portworx Backup: to create backup locations in the UI
- Portworx nodes: to back up Portworx volumes
Configure Stork and install Portworx on all the clusters added in the Portworx Backup UI.
The following sections explain how you can add the secure S3 object store certificate to each component:
Stork
You need to modify the Stork deployment file to add a secret mount with the custom certificate, and then add an environment variable pointing to the secret mount.
-
Create a secret in the namespace where Stork is deployed with the S3 object store certificate, assuming the file
public.crtcontains the certificate:kubectl -n <stork-deployed-namespace> create secret generic px-s3-certs --from-file=public.crt
After performing the above task, you can deploy Stork using any one of the two methods specified below:
1. Portworx operator method with storage cluster - stc:
- Update the stork section of stc spec with the following configuration settings:
spec:
stork:
enabled: true
env:
- name: AWS_CA_BUNDLE
value: /etc/pwx/s3cert/public.crt
- name: SSL_CERT_DIR
value: /etc/pwx/s3cert
volumes:
- mountPath: /etc/pwx/s3cert
name: px-s3-certs
secret:
items:
- key: public.crt
path: public.crt
secretName: px-s3-certs
2. Directly applying stork.spec by modifying the Stork deployment:
To modify the Stork deployment, perform the below steps.
-
Edit the Stork deployment:
kubectl edit deployment stork -n <stork-deployed-namespace> -
Add
AWS_CA_BUNDLEandSSL_CERT_DIRenvironment variables:env:- name: PX_SERVICE_NAMEvalue: portworx-api- name: AWS_CA_BUNDLEvalue: /etc/pwx/s3cert/public.crt- name: SSL_CERT_DIRvalue: /etc/pwx/s3cert -
Add volume mounts:
volumeMounts:- mountPath: /etc/pwx/s3certname: px-s3-certs -
Add a volume:
volumes:- name: px-s3-certssecret:defaultMode: 420secretName: px-s3-certs -
Save the changes and wait for the Stork pods to restart.
Portworx Backup
To configure the Portworx Backup deployment specification:
- Create a secret in the
centralnamespace with the S3 object store certificate, assuming the filepublic.crtcontains the certificate:
kubectl create ns central
kubectl -n central create secret generic px-s3-certs --from-file=public.crt
- Set the following parameter with the install or upgrade command with helm:
--set caCertsSecretName=px-s3-certs
Above command adds the parameter SSL_CERT_DIR to the backup deployment.
If you have added this parameter manually, delete the cronjob and then restart the Portworx Backup pod by executing the following commands:
kubectl -n <px-backup-namespace> get cronjob | grep ^full-main | awk '{print $1}' | xargs kubectl -n <px-backup-namespace> delete cronjob
kubectl -n <px-backup-namespace> get cronjob | grep ^quick-main | awk '{print $1}' | xargs kubectl -n <px-backup-namespace> delete cronjob
kubectl delete pods -n <px-backup-namespace> <px-backup-pod-name>
Example:
kubectl -n px-backup get cronjob | grep ^full-main | awk '{print $1}' | xargs kubectl -n px-backup delete cronjob
kubectl -n px-backup get cronjob | grep ^quick-main | awk '{print $1}' | xargs kubectl -n px-backup delete cronjob
kubectl delete pods -n px-backup px-backup-f56cdcbd9-rvb65
For more information on installation and upgrade of Portworx Backup, refer to Install Portworx Backup and Upgrade Portworx Backup sections respectively.
Alternatively, you can configure Portworx Backup by creating a secret on the same namespace where you deploy Portworx Backup, and set the caCertsSecretName parameter:
-
Configure custom CA certificate:
-
Create a secret with CA certificates into the release namespace. For example:
apiVersion: v1stringData:ca.crt: |-----BEGIN CERTIFICATE-----MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0IxEzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9yaXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAyMDQxOTUwMTZaMIGHMQswCQYDVQQGEwJHQjETMBEGA1..29tZS1TdGF0ZTEUMBIGA1UEChMLQmVzdCBDQSBMdGQxNzA1BgNVBAsTLk..DEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxFD..AMTC0Jlc3QgQ0EgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCg..Tz2mr7SZiAMfQyuvBjM9OiJjRazXBZ1BjP5CE/Wm/Rr500PRK+Lh9x5eJ../ANBE0sTK0ZsDGMak2m1g7oruI3dY3VHqIxFTz0Ta1d+NAjwnLe4nOb7/..k05ShhBrJGBKKxb8n104o/5p8HAsZPdzbFMIyNjJzBM2o5y5A13wiLitE..fyYkQzaxCw0AwzlkVHiIyCuaF4wj571pSzkv6sv+4IDMbT/XpCo8L6wTa..sh+etLD6FtTjYbbrvZ8RQM1tlKdoMHg2qxraAV++HNBYmNWs0duEdjUbJ..XI9TtnS4o1Ckj7POfljiQIDAQABo4HnMIHkMB0GA1UdDgQWBBQ8urMCRL..5AkIp9NJHJw5TCBtAYDVR0jBIGsMIGpgBQ8urMCRLYYMHUKU5AkIp9NJH..aSBijCBhzELMAkGA1UEBhMCR0IxEzARBgNVBAgTClNvbWUtU3RhdGUxFD..AoTC0Jlc3QgQ0EgTHRkMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcm..ENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRQwEgYDVQQDEwtCZXN0IENBIE..DAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQC1uYBcsSncwA..DCsQer772C2ucpXxQUE/C0pWWm6gDkwd5D0DSMDJRqV/weoZ4wC6B73f5..bLhGYHaXJeSD6KrXcoOwLdSaGmJYslLKZB3ZIDEp0wYTGhgteb6JFiTtn..sf2xdrYfPCiIB7gBMAV7Gzdc4VspS6ljrAhbiiawdBiQlQmsBeFz9JkF4..b3l8BoGN+qMa56YIt8una2gY4l2O//on88r5IWJlm1L0oA8e4fR2yrBHX..adsGeFKkyNrwGi/7vQMfXdGsRrXNGRGnX+vWDZ3/zWI0joDtCkNnqEpVn..HoX-----END CERTIFICATE-----kind: Secretmetadata:name: ca-certsnamespace: px-backup -
Pass the secret name to the chart using
--set caCertsSecretName=<SECRET_NAME>flag.
-
-
Expose Portworx Backup user interface on openshift routes and access using
httpandhttps:- Create a single route with hostname and path
/and point it to thepx-central-uiservice. - Access Portworx Backup UI using route endpoint.
noteKeycloak authentication and Grafana UI are accessible on the same endpoint on different paths:
/authand/grafana. - Create a single route with hostname and path
Portworx Enterprise
The configuration to Portworx Enterprise depends on how you deployed it. For more information, refer to Certificates as Kubernetes Secrets.