Add a custom topology in the deployed Apache Knox Gateway

How to add a custom service to a custom topology in Knox proxy via Cloudera Manager.

In this example, we are going to add a custom service (MY_SERVICE) in custom-topology with the following attributes:

  • ProviderConfigRef: a string representing a reference of an existing share-provider. We will use the pre-configured pam provider.
  • Version: the service’s version, e.g. 1.0.0.
  • URL: the service URL, e.g. https://sampleHost:1234.
  • Service parameter: a sample service parameter, e.g. myValue.
  1. From Cloudera Manager > Knox > Configuration, add a new entry in Knox Gateway Advanced Configuration Snippet (Safety Valve) for conf/cdp-resources.xml as follows:
    Name = custom-topology
    Value =providerConfigRef=pam#
    MY_SERVICE:version=1.0.0#
    MY_SERVICE:url=https://sampleHost:1234#
    MY_SERVICE:myCustomServiceParameter=myValue
    Description = This is a custom topology with one service called MY_SERVICE
  2. Save your changes.
  3. The ‘Refresh needed’ stale configuration indicator appears; click it and wait until the refresh process finishes.
  4. Validate that the operation was successful by going to the following URL: https://$KNOX_GATEWAY_HOST:$PORT/$GATEWAY_PATH/admin/api/v1/topologies/cdp-proxy.