I want to execute a POST
request with custom headers over HTTPS from a pod in our kubernetes cluster, which is running openjdk11-jre with alpine as base image (adoptopenjdk/openjdk11:jre-11.0.11_9-alpine
to be exact).
With this image curl
or wget
are not available and nc
doesn't support HTTPS. I already tried to achieve something with jrunscript
which comes with the jre but was only able to send a GET
with cat('https://example.com')
.
Of course one way would be to copy an executable or a compiled Java class into the pod, over which I could send the request but I'd prefer a one-liner that is ready to go.
openssl
available? Then you can doopenssl s_client
. Etc. Otherwise you need some Java.jar
file copied into it. So it's just the plain Alpine image with a JRE (just added the versions). I currently didn't find any program that would fit but often people here find clever ways to utilize existing programs for some command line magic :)