(Recommended) Secure approach for passing a token to configure SQL AI Assistant in Cloudera Data Warehouse

In this approach, you use Kubernetes' method of distributing secrets. You first encode the credentials and then add the encoded bit as a data item in the HUE_AI_INTERFACE_TOKEN property. The token becomes available in the Hue pod as an environment variable.

  1. Use a base64 encoding tool to convert your token to a base-64 representation by running the following command:
    echo -n '[***MY-TOKEN***]' | base64
    Replace [***MY-TOKEN***] with the token value you want to encode.
  2. Open a terminal session and run the following command to add the encoded secret:
    kubectl edit secret hue-secret -n [***VIRTUAL-WAREHOUSE-NAMESPACE***]
    Replace [***VIRTUAL-WAREHOUSE-NAMESPACE***] with the actual Virtual Warehouse ID (same as the namespace) in which you want to add the secret.
  3. Add the encoded value returned for your token in the HUE_AI_INTERFACE_TOKEN property as follows:
    ...
    apiVersion: v1
    data:
      HADOOP_CREDSTORE_PASSWORD: [***ENCODED-HADOOP-CREDSTORE-PASSWORD***]
      HUE_AI_INTERFACE_TOKEN: [***ENCODED-TOKEN-VALUE***]
    kind: Secret
    Replace [***ENCODED-TOKEN-VALUE***] with the actual encoded value returned for your token.