Copying secrets and configmaps to tethered projects in Watson Query

Watson Query uses zenExtension to copy secrets and configmaps to tethered projects. After you create or modify the ca-connection-certs secret or the krb5-conf-files configmap, use this feature to copy them to tethered projects.

Before you begin

Who needs to complete this task?
To complete this task, you must be an administrator of the project (namespace) where Cloud Pak for Data is installed.

Procedure

Complete the following tasks:

  1. Add the krb5.conf configmap or ca-connection-certs secret to zenExtension.
  2. Trigger a refresh of the secret and configmap.

Add the krb5.conf configmap or ca-connection-certs secret to zenExtension

  1. Run the following command to modify the zenextension CR:
    oc -n ${PROJECT_CPD_INST_OPERANDS} edit zenextension dv-rescopy-extension
  2. Modify the details section to add the new configmap or secret:
           
              "details": {
                "configmap_list":  [
                      "krb5-config-files",
                      "cpd-dv-aux-ckpt-cm",
                      "dv-aux-br-cm"
                 ],
    
                "secret_list":  [
                      "ca-connection-cert"
                 ]
              }
  3. Note:
    You must use the following names in the zenextension CR:

Refresh the secret or configmap

Run the following command to trigger a refresh of the secret or configmap. This command idempotent. You must run it every time you update the ca-connection-certs secret or the krb5-config-files configmap.

Run this command from the CLI on the cluster.

last_update_ts=$(oc -n ${PROJECT_CPD_INST_OPERANDS} get zenextension/dv-rescopy-extension -o jsonpath='{.spec.extensions}' | jq '.[0].last_update_ts' | tr -d '"')
new_timestamp=$(date -u '+%Y%m%d%H%M%S')
oc  -n ${PROJECT_CPD_INST_OPERANDS} get zenextension/dv-rescopy-extension -o yaml > dv-rescopy-extension$last_update_ts.yaml
sed -i "s/${last_update_ts}/${new_timestamp}/" dv-rescopy-extension$last_update_ts.yaml
oc apply -f dv-rescopy-extension$last_update_ts.yaml
rm -f dv-rescopy-extension$last_update_ts.yaml