use of io.fabric8.kubernetes.api.model in project ballerina by ballerina-lang.
the class DefaultBallerinaDockerClient method getDockerClient.
/**
* Creates a {@link DockerClient} from the given Docker host URL.
*
* @param env The URL of the Docker host. If this is null, a {@link DockerClient} pointed to the local Docker
* daemon will be created.
* @return {@link DockerClient} object.
*/
private DockerClient getDockerClient(String env) {
DockerClient client;
if (env == null) {
env = LOCAL_DOCKER_DAEMON_SOCKET;
}
Config dockerClientConfig = new ConfigBuilder().withDockerUrl(env).build();
client = new io.fabric8.docker.client.DefaultDockerClient(dockerClientConfig);
return client;
}
use of io.fabric8.kubernetes.api.model in project fabric8 by fabric8io.
the class WatchPodsExample method main.
public static void main(String... args) throws Exception {
KubernetesClient client = new DefaultKubernetesClient();
client.pods().watch(new io.fabric8.kubernetes.client.Watcher<Pod>() {
@Override
public void eventReceived(Action action, Pod pod) {
System.out.println(action + ": " + pod);
}
@Override
public void onClose(KubernetesClientException e) {
System.out.println("Closed: " + e);
}
});
client.close();
}
Aggregations