Prerequisites for using API key
To enable using API keys, you must manually configure the Knox service in the Cloudera Base cluster. This includes installing and configuring Knox and setting up the Cloudera AI Inference service instance in the Cloudera AI Control Plane.
The Knox API key support is available only on Cloudera Runtime 7.1.9 SP2 and 7.3.2 versions.
-
Install the Cloudera Base cluster Knox.
For instructions on installing Cloudera Base cluster Knox, see Installing Apache Knox.
-
Validate the API key by reusing the
cdp_proxy_tokentopology, and adding theAPIKEYservice to the existing Knox topology.- In the Cloudera Manager, select your cluster.
- Open the Knox service.
- Select the Configuration tab.
-
Search for
gateway_descriptor_cdp_proxy_api. -
Add the APIKEY service with the following setting:
KNOX-AUTH-SERVICE:preauth.auth.header.actor.id.name=x-cdp-actor-username KNOX-AUTH-SERVICE:preauth.auth.header.actor.groups.prefix=x-cdp-actor-groups KNOX-AUTH-SERVICE:preauth.group.filter.pattern=[^\s]+ KNOX-AUTH-SERVICE:ignore.additional.path=true
-
Generate the API key.
-
Option 1 - To reuse the
cdp-proxy-apitopology, add the APIKEY service to a Knox topology.- In the Cloudera Manager, select your cluster.
- Open the Knox service.
- Select the Configuration tab.
- Search for
gateway_descriptor_cdp_proxy_api. - Add the APIKEY service with the following setting:
APIKEY:apikey.knox.token.exp.server-managed=true - Configure
gateway_api_authentication_providerto use your LDAP service.- In the Cloudera Manager, open the Knox service.
- Go to the Configuration tab.
- Search for
gateway_api_authentication_provider. - Edit this property and configure it to use your LDAP
authentication provider for the
cdp-proxy-apitopology. For instructions, see Configure Apache Knox authentication for AD/LDAP. - Retrieve the correct values for your environment:
- Open Cloudera Manager
- Select Administration from the left navigation pane.
- Open Settings and search for External Authentication. All the required details are displayed. After applying the changes, navigate to Knox and refresh the service.
-
Option 2 - Add a custom topology.
- Configure the API key service by using the
cdp-proxy-apiKnox topology. That is the default option. - To use a different topology, add a custom descriptor to
Knox.
For instructions on adding a custom topology, see Add a custom descriptor to Apache Knox.
- In the custom topology’s descriptor add the APIKEY
service by
adding:
APIKEY:apikey.knox.token.exp.server-managed=trueIn the topology descriptor you can either refer to a configured LDAP provider, or add your own provider. For instructions, see Add a new shared provider configuration.
- In the custom topology’s descriptor add the APIKEY
service by
adding:
- Configure Cloudera AI Inference service.
If you are using a custom Knox topology, provide its custom name when installing the Cloudera AI Inference service. Specify the custom topology name in the UI or include it in the CLI payload during installation.
Figure 1. Configuring Knox and Ranger details in Cloudera AI Inference service Advanced configuration
- Configure the API key service by using the
-
Option 1 - To reuse the
