Skip to content
Permalink
Browse files

Add Kubernetes Compute Cluster (#1165)

  • Loading branch information...
pschorf authored and dposada committed Jul 10, 2019
1 parent dc9ac0e commit 73193f8ad4f4f6a7a7d4812b4559fab236aac5d0
@@ -0,0 +1,29 @@
package com.twosigma.cook.kubernetes;

import com.google.common.reflect.TypeToken;
import io.kubernetes.client.ApiClient;
import io.kubernetes.client.ApiException;
import io.kubernetes.client.apis.CoreV1Api;
import io.kubernetes.client.models.V1Node;
import io.kubernetes.client.models.V1Pod;
import io.kubernetes.client.util.Watch;

public class WatchHelper {

public static Watch<V1Pod> createPodWatch(ApiClient apiClient, String resourceVersion) throws ApiException {
CoreV1Api api = new CoreV1Api(apiClient);
return Watch.createWatch(apiClient,
api.listPodForAllNamespacesCall(null, null, null, null, null, null,
resourceVersion, null, true, null, null),
new TypeToken<Watch.Response<V1Pod>>() {}.getType());
}

public static Watch<V1Node> createNodeWatch(ApiClient apiClient, String resourceVersion) throws ApiException {
CoreV1Api api = new CoreV1Api(apiClient);
return Watch.createWatch(apiClient,
api.listNodeCall(null, null, null, null, null,
null, resourceVersion, null, true, null,
null),
new TypeToken<Watch.Response<V1Node>>() {}.getType());
}
}
@@ -113,7 +113,9 @@
[org.apache.curator/curator-test "2.7.1"]

;; Dependency management
[mount "0.1.12"]]
[mount "0.1.12"]

[io.kubernetes/client-java "4.0.0"]]

:repositories {"maven2" {:url "https://files.couchbase.com/maven2/"}
"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}

0 comments on commit 73193f8

Please sign in to comment.
You can’t perform that action at this time.