I am using the Fabric8 Java library to access the Kubernetes API within an actor system. I am concerned about connection leaks and want to understand how the client connections are closed underneath after a REST call is made
Here is the code that initializes the client:
config = new ConfigBuilder()
.withMasterUrl(apiServer)
.withOauthToken(token)
.withTrustCerts(true)
.build();
client = new DefaultKubernetesClient(config);
This client is then passed on to various actors, how should I be closing these connections in the actors so that connections don't leak or are abandoned hen a certain actor dies?
The client object has a close method on it.
So, it should be something like client.close().
ReST is the underlying protocol. There's no persistent connection to the server when you create the client. It's only there to help keep configuration together for the calls.