Updating database CA certificates for a Cloudera Data Engineering Virtual Cluster

Update the CA certificates that Cloudera Data Engineering Virtual Clusters use to connect to their databases securely.

You can update the CA certificates without recreating the Virtual Cluster or performing an upgrade. To do this, call the PATCH update app instance API with the config.chartValueOverrides parameter. You can set the certificate for the Runtime API server, Airflow, and the Airflow API server all at once, or one at a time. You can also remove a manually set certificate.

The config.chartValueOverrides parameter is an object in the request body of the update app instance API. For updates, it only accepts the base-64 encoded database CA certificate values of the dex-app chart.

Table 1. Override keys, their respective components, and Kubernetes secrets
Override key Component Kubernetes secret updated
dexapp.api.db.caCert Runtime API server [***VC-ID***]-api-db-ca-cert
airflow.db.caCert Airflow [***VC-ID***]-airflow-db-ca-cert
airflowapi.db.caCert Airflow API server [***VC-ID***]-airflowapi-airflowapi-db-ca-cert

For more information on Updating database CA certificates for a Cloudera Data Engineering Virtual Cluster using the CLI method, see Updating database CA certificates for a Cloudera Data Engineering Virtual Cluster using the CLI.

  • You must have the required permissions to manage the Cloudera Data Engineering Service and Virtual Cluster.
  • cdpcurl must be installed and configured.
  • You must have the correct CA certificate bundle in PEM format for your database.
  1. Download the CA certificate bundle for your database.
  2. Base64-encode the bundle as a single line.
  3. Send the PATCH [***BASE-URL***]/dex/api/v1/cluster/[***CLUSTER-ID***]/instance/[***VC-ID***] request with the config.chartValueOverrides payload.

    Provide the following payload:

    {
      "config": {
        "chartValueOverrides": {
          "dex-app": {
            "dexapp.api.db.caCert": "[***BASE64-ENCODED-PEM-CA-BUNDLE***]",
            "airflow.db.caCert": "[***BASE64-ENCODED-PEM-CA-BUNDLE***]",
            "airflowapi.db.caCert": "[***BASE64-ENCODED-PEM-CA-BUNDLE***]"
          }
        }
      }

    Example:

    cdpcurl -X PATCH -f string -d '{
      "config": {
        "chartValueOverrides": {
          "dex-app": {
            "dexapp.api.db.caCert": "[***BASE64-ENCODED-PEM-CA-BUNDLE***]",
            "airflow.db.caCert": "[***BASE64-ENCODED-PEM-CA-BUNDLE***]",
            "airflowapi.db.caCert": "[***BASE64-ENCODED-PEM-CA-BUNDLE***]"
          }
        }
      }
    }' "[***BASE-URL***]/dex/api/v1/cluster/[***CLUSTER-ID***]/instance/[***VC-ID***]"

    The following environment variables are included in the command:

    • BASE-URL - You can obtain the BASE-URL by copying the console URL up to the first forward slash (/).

      Example for the console URL:

      https://console.us-west-1.cdp.cloudera.com/dex/home

      An example for the BASE-URL, which changes according to the region:

      https://console.us-west-1.cdp.cloudera.com
    • CLUSTER-ID - The ID of the Cloudera Data Engineering Service. For example cluster-abc123

      To obtain the cluster ID, log in to the Cloudera Data Engineering UI and go to Administration in the left-navigation menu. Select the respective Service, then click on the Service Details icon, and copy the CLUSTER ID.

    • VC-ID - The ID of the Virtual Cluster. For example: dex-app-xyz789

      To obtain the VC ID, log in to the Cloudera Data Engineering UI and go to Administration in the left-navigation menu. Select the respective service and then the respective VC. Click on the Virtual Cluster Details icon, and copy the VC-ID.

  4. Perform the following checks:
    1. Ensure that the overrides were saved by running the following command:
      cdpcurl -X GET -f string \
      "[***BASE-URL***]/dex/api/v1/cluster/[***CLUSTER-ID***]/instance/[***VC-ID***]" \
        | jq .config.chartValueOverrides
      
    2. Ensure that the affected pods restarted and are running.
    3. Look at the Virtual Cluster event log for the update entries.
  5. Optional: To remove a manually set override, send the same PATCH request with an empty string ("") for the key you want to remove.