Creating custom-bai-secret

You create custom-bai-secret by creating and running a custom-bai-secret.yaml file.

Before you begin

Because the default value of the management password is randomly generated, you need to retrieve it to be able to use the management API. You can use a similar procedure also if you need to retrieve the username and password because you or somebody else customized them earlier by using custom-bai-secret.
export NAMESPACE=<namespace>

export INSIGHTS_ENGINE_CR=$(kubectl get insightsengine --no-headers --ignore-not-found -n $NAMESPACE |awk '{print $1}')

export MANAGEMENT_AUTH_SECRET=$(kubectl get insightsengine ${INSIGHTS_ENGINE_CR} -n ${NAMESPACE} -o jsonpath='{.status.components.management.endpoints[?(@.scope=="External")].authentication.secret.secretName}') export MANAGEMENT_USERNAME=$(kubectl get secret ${MANAGEMENT_AUTH_SECRET} -n ${NAMESPACE} -o jsonpath='{.data.username}' | base64 -d) export MANAGEMENT_PASSWORD=$(kubectl get secret ${MANAGEMENT_AUTH_SECRET} -n ${NAMESPACE} -o jsonpath='{.data.password}' | base64 -d)

About this task

In your custom-bai-secret.yaml file, you do not need to list all the keys. You can choose to list only the keys for which you want a custom value.

Procedure

  1. Create a custom-bai-secret.yaml file.
    apiVersion: v1
    kind: Secret
    metadata:
      name: custom-bai-secret
    # Credentials
    stringData:
      # Management Service secrets
      management-username: <username to authenticate against the management REST API>
      management-password: <password to authenticate against the management REST API> 
      
    
  2. From that YAML file, create the secret by running the kubectl create command.
    kubectl create -f custom-bai-secret.yaml -n <namespace>