io.fabric8.kubernetes.client.dsl.ScalableResource Java Examples

The following examples show how to use io.fabric8.kubernetes.client.dsl.ScalableResource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KubernetesAppDeployer.java    From spring-cloud-deployer-kubernetes with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #2
Source File: JobOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
@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);
  }
}
 
Example #3
Source File: DeploymentConfigOperatorTest.java    From strimzi-kafka-operator with Apache License 2.0 4 votes vote down vote up
@Override
protected Class<ScalableResource> resourceType() {
    return ScalableResource.class;
}
 
Example #4
Source File: JobOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
public ScalableResource<Job, DoneableJob> fromServer() {
  return new JobOperationsImpl(context.withReloadingFromServer(true));
}
 
Example #5
Source File: ExtensionsAPIGroupClient.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
@Deprecated
public MixedOperation<Job, JobList, DoneableJob, ScalableResource<Job, DoneableJob>> jobs() {
  return new JobOperationsImpl(httpClient, getConfiguration());
}
 
Example #6
Source File: BatchAPIGroupClient.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
public MixedOperation<Job, JobList, DoneableJob, ScalableResource<Job, DoneableJob>> jobs() {
  return new JobOperationsImpl(httpClient, getConfiguration());
}