Running wiremock in K8S to act as our service virtualization platform. Architecture is:
Custom Proxy as single endpoint to calling service. This proxy forwards to individual wiremock instances. each responsible for virtualizing a specific remote service (we cannot have one wiremock responsible for 2 remote services due to #1783).
We run this within a single K8S service/pod - our custom proxy container and 2 wiremock containers. Since it is in a single pod each container needs it's own port - we cannot use 8080 for both wiremock containers as they will conflict.
We run one wiremock container on port 8080 and wish to run the other on port 8081 (or anything else really, doesn't matter).
We pass an Args to the second wiremock (--port 8081). Container fails to start with
Exception in thread "main" joptsimple.UnrecognizedOptionException: port 8081 is not a recognized option at joptsimple.OptionException.unrecognizedOption(OptionException.java:108) at joptsimple.OptionParser.handleLongOptionToken(OptionParser.java:510) at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:56) at joptsimple.OptionParser.parse(OptionParser.java:396) at com.github.tomakehurst.wiremock.standalone.CommandLineOptions.<init>(CommandLineOptions.java:342) at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.run(WireMockServerRunner.java:49) at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.main(WireMockServerRunner.java:133)In K8S it's my understanding that the "args" are passed to the ENTRYPOINT in the underlying docker container.
Alternative ARGS (e.g. --verbose) appear to work fine so it seems that "port" specifically has an issue somehow.
How should we tell the K8S docker container to run on a different port if the "--port XXXX" command appears to be invalid? Is there a different way to invoke this behaviour in K8S?