Access and Test aapm-service Locally
4 min
kubectl port forward temporarily exposes the service on the server's own 127 0 0 1 address to access it from your own computer, an additional ssh tunnel is required start a persistent port forward on the server without nohup & disown commands, this process terminates when the ssh session closes or the connection drops nohup kubectl port forward svc/aapm service 8443 8443 n kron pam aapm > /tmp/pf aapm service log 2>&1 < /dev/null & disown sleep 2 ss tlnp | grep 8443 open an ssh tunnel from your own machine ssh n l 8443 127 0 0 1 8443 \<user>@\<server ip> on windows, if ssh/sshpass is unavailable, putty's plink exe can be used instead plink exe ssh batch pw \<password> n l 8443 127 0 0 1 8443 \<user>@\<server ip> send a test request with curl command curl x post http //localhost 8443/vault \\ h "content type application/json" \\ d '{ "accountname" "\<account name>", "accountpath" "\<account path>", "token" "\<kron pam token>" }' with python import requests url = "http //localhost 8443/vault" headers = {"content type" "application/json"} payload = { "accountname" "\<account name>", "accountpath" "\<account path>", "token" "\<kron pam token>" } try response = requests post(url, headers=headers, json=payload) print(f"status code {response status code}") print(f"response body {response text}") except requests exceptions requestexception as e print(f"an error occurred {e}") success criteria status code 200 and a "password" field in the response body