Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Add Kubernetes Compute Cluster #1165

Merged
merged 4 commits into from Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions scheduler/java/com/twosigma/cook/kubernetes/WatchHelper.java
@@ -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());
}
}
4 changes: 3 additions & 1 deletion scheduler/project.clj
Expand Up @@ -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/"}
Expand Down