use of io.kubernetes.client.openapi.apis.BatchV1Api in project cdap by caskdata.
the class KubeTwillRunnerService method start.
@Override
public void start() {
try {
apiClient = Config.defaultClient();
coreV1Api = new CoreV1Api(apiClient);
batchV1Api = new BatchV1Api(apiClient);
monitorScheduler = Executors.newSingleThreadScheduledExecutor(Threads.createDaemonThreadFactory("kube-monitor-executor"));
resourceWatchers.values().forEach(watcher -> {
watcher.addListener(new AppResourceChangeListener<>());
watcher.start();
});
// start job cleaner service
jobCleanerService = Executors.newSingleThreadScheduledExecutor(Threads.createDaemonThreadFactory("kube-job-cleaner"));
jobCleanerService.scheduleAtFixedRate(new KubeJobCleaner(batchV1Api, kubeNamespace, selector, jobCleanBatchSize), 10, jobCleanupIntervalMins, TimeUnit.MINUTES);
} catch (IOException e) {
throw new IllegalStateException("Unable to get Kubernetes API Client", e);
}
}
Aggregations