Appendix C. Client Configuration using Port Forwarding
If a router is not available, you may be able to set up port forwarding so that heketi-cli can communicate with the Heketi service. Execute the following commands for port forwarding:
- Obtain the Heketi service pod name by running the following command:
oc get pods
# oc get pods
Copy to Clipboard Copied! - To forward the port on your local system to the pod, execute the following command on another terminal of your local system:
oc port-forward <heketi pod name> 8080:8080
# oc port-forward <heketi pod name> 8080:8080
Copy to Clipboard Copied! - On the original terminal execute the following command to test the communication with the server:
curl http://localhost:8080/hello
# curl http://localhost:8080/hello
Copy to Clipboard Copied! This will forward the local port 8080 to the pod port 8080. - Setup the Heketi server environment variable by running the following command:
export HEKETI_CLI_SERVER=http://localhost:8080
# export HEKETI_CLI_SERVER=http://localhost:8080
Copy to Clipboard Copied! - Get information from Heketi by running the following command:
heketi-cli topology info
# heketi-cli topology info
Copy to Clipboard Copied!