Pravega client requires certain OS environment variables to be set. This can be done through Shell, or they can be defined in the Python script as shown in the following examples:
os.environ['pravega_client_auth_keycloak'] = <Name of the keycloak Json file for the project>
Note: To retrieve Keycloak JSON for a specific project/scope, run the following command on SDP account using project/scope name as the command line argument:
# kubectl get secret <project/scope name>-ext-pravega -n <project/scope name> -o jsonpath=”{.data.keycloak\.json}” | base64 -d > <Project Name Keycloak secret>.json
os.environ['pravega_client_tls_cert_path'] = <Name of the SDP cert file>
os.environ['pravega_client_auth_method'] = “Bearer” (SDP supports only the bearer method.)
Other parameter values that are needed by Pravega client from SDP are:
- PRAVEGA_CONTROLLER_URI—Fully qualified name for Pravega Controller, for example: “pravega-controller.sdp.faredge1.lab:443”
- PRAVEGA_STREAM—Name of the Pravega stream to write to
- PRAVEGA_SCOPE—Scope (Project) of the stream
- ROUTING_KEY (optional)—<Name of the routing key>: any identifying text to tag messages