io.fabric8.kubernetes.api.model.apps.DoneableDeployment#io.fabric8.kubernetes.client.dsl.ScalableResource源码实例Demo

下面列出了io.fabric8.kubernetes.api.model.apps.DoneableDeployment#io.fabric8.kubernetes.client.dsl.ScalableResource 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
public void scale(AppScaleRequest appScaleRequest) {
	String deploymentId = appScaleRequest.getDeploymentId();
	logger.debug(String.format("Scale app: %s to: %s", deploymentId, appScaleRequest.getCount()));

	ScalableResource scalableResource = this.client.apps().deployments().withName(deploymentId);
	if (scalableResource.get() == null) {
		scalableResource = this.client.apps().statefulSets().withName(deploymentId);
	}
	if (scalableResource.get() == null) {
		throw new IllegalStateException(String.format("App '%s' is not deployed", deploymentId));
	}
	scalableResource.scale(appScaleRequest.getCount(), true);
}
 
源代码2 项目: kubernetes-client   文件: JobOperationsImpl.java
@Override
public ScalableResource<Job, DoneableJob> load(InputStream is) {
  try {
    Job item = unmarshal(is, Job.class);
    return new JobOperationsImpl(context.withItem(item));
  } catch (Throwable t) {
    throw KubernetesClientException.launderThrowable(t);
  }
}
 
@Override
protected Class<ScalableResource> resourceType() {
    return ScalableResource.class;
}
 
源代码4 项目: kubernetes-client   文件: JobOperationsImpl.java
@Override
public ScalableResource<Job, DoneableJob> fromServer() {
  return new JobOperationsImpl(context.withReloadingFromServer(true));
}
 
@Override
@Deprecated
public MixedOperation<Job, JobList, DoneableJob, ScalableResource<Job, DoneableJob>> jobs() {
  return new JobOperationsImpl(httpClient, getConfiguration());
}
 
源代码6 项目: kubernetes-client   文件: BatchAPIGroupClient.java
@Override
public MixedOperation<Job, JobList, DoneableJob, ScalableResource<Job, DoneableJob>> jobs() {
  return new JobOperationsImpl(httpClient, getConfiguration());
}