public class Controller extends Object
Constructor and Description |
---|
Controller() |
Controller(KubernetesClient kubernetes) |
Modifier and Type | Method and Description |
---|---|
String |
apply(File file) |
void |
apply(Object dto,
String sourceName)
Applies the given DTOs onto the Kubernetes master
|
void |
applyBuildConfig(io.fabric8.openshift.api.model.BuildConfig entity,
String sourceName) |
void |
applyDeploymentConfig(io.fabric8.openshift.api.model.DeploymentConfig entity,
String sourceName) |
void |
applyEntity(Object dto,
String sourceName)
Applies the given DTOs onto the Kubernetes master
|
void |
applyImageStream(io.fabric8.openshift.api.model.ImageStream entity,
String sourceName) |
String |
applyJson(byte[] json)
Applies the given JSON to the underlying REST APIs in a single operation without needing to explicitly parse first.
|
String |
applyJson(File json)
Applies the given JSON to the underlying REST APIs in a single operation without needing to explicitly parse first.
|
String |
applyJson(InputStream json)
Applies the given JSON to the underlying REST APIs in a single operation without needing to explicitly parse first.
|
String |
applyJson(String json)
Applies the given JSON to the underlying REST APIs in a single operation without needing to explicitly parse first.
|
void |
applyList(io.fabric8.kubernetes.api.model.KubernetesList list,
String sourceName) |
void |
applyNamespace(io.fabric8.kubernetes.api.model.Namespace entity) |
void |
applyOAuthClient(io.fabric8.openshift.api.model.OAuthClient entity,
String sourceName) |
void |
applyPod(io.fabric8.kubernetes.api.model.Pod pod,
String sourceName) |
void |
applyReplicationController(io.fabric8.kubernetes.api.model.ReplicationController replicationController,
String sourceName) |
void |
applyRoute(io.fabric8.openshift.api.model.Route entity,
String sourceName) |
void |
applyService(io.fabric8.kubernetes.api.model.Service service,
String sourceName) |
Object |
applyTemplate(io.fabric8.openshift.api.model.template.Template entity,
String sourceName)
Creates/updates the template and processes it returning the processed DTOs
|
String |
applyYaml(File yaml)
Applies the given YAML to the underlying REST APIs in a single operation without needing to explicitly parse first.
|
String |
applyYaml(String yaml)
Applies the given YAML to the underlying REST APIs in a single operation without needing to explicitly parse first.
|
protected void |
doCreateOAuthClient(io.fabric8.openshift.api.model.OAuthClient entity,
String sourceName) |
protected void |
doCreatePod(io.fabric8.kubernetes.api.model.Pod pod,
String namespace,
String sourceName) |
protected void |
doCreateReplicationController(io.fabric8.kubernetes.api.model.ReplicationController replicationController,
String namespace,
String sourceName) |
protected void |
doCreateService(io.fabric8.kubernetes.api.model.Service service,
String namespace,
String sourceName) |
protected void |
doCreateTemplate(io.fabric8.openshift.api.model.template.Template entity,
String namespace,
String sourceName) |
String |
getNamespace() |
boolean |
isAllowCreate()
Returns true if this controller allows new resources to be created in the given namespace
|
boolean |
isIgnoreRunningOAuthClients() |
boolean |
isIgnoreServiceMode()
If enabled then all services are ignored to avoid them being recreated.
|
boolean |
isProcessTemplatesLocally() |
boolean |
isRecreateMode()
If enabled then updates are performed by deleting the resource first then creating it
|
protected boolean |
isRunning(io.fabric8.kubernetes.api.model.HasMetadata entity) |
boolean |
isServicesOnlyMode()
If enabled then only services are created/updated to allow services to be created/updated across
a number of apps before any pods/replication controllers are updated
|
boolean |
isThrowExceptionOnError() |
protected void |
onApplyError(String message,
Exception e)
Logs an error applying some JSON to Kubernetes and optionally throws an exception
|
protected void |
printSummary(Object kubeResource) |
Object |
processTemplate(io.fabric8.openshift.api.model.template.Template entity,
String sourceName) |
void |
setAllowCreate(boolean allowCreate) |
void |
setIgnoreRunningOAuthClients(boolean ignoreRunningOAuthClients) |
void |
setIgnoreServiceMode(boolean ignoreServiceMode) |
void |
setNamespace(String namespace) |
void |
setProcessTemplatesLocally(boolean processTemplatesLocally) |
void |
setRecreateMode(boolean recreateMode) |
void |
setServicesOnlyMode(boolean servicesOnlyMode) |
void |
setThrowExceptionOnError(boolean throwExceptionOnError) |
protected void |
validatePodSpec(io.fabric8.kubernetes.api.model.PodSpec podSpec,
String namespace)
Lets verify that any dependencies are available; such as volumes or secrets
|
public Controller()
public Controller(KubernetesClient kubernetes)
public String applyJson(byte[] json) throws Exception
Exception
public String applyJson(String json) throws Exception
Exception
public String applyJson(File json) throws Exception
Exception
public String applyYaml(String yaml) throws Exception
Exception
public String applyYaml(File yaml) throws Exception
Exception
public String applyJson(InputStream json) throws Exception
Exception
public void apply(Object dto, String sourceName) throws Exception
Exception
public void applyEntity(Object dto, String sourceName) throws Exception
Exception
public void applyOAuthClient(io.fabric8.openshift.api.model.OAuthClient entity, String sourceName)
protected void doCreateOAuthClient(io.fabric8.openshift.api.model.OAuthClient entity, String sourceName)
public Object applyTemplate(io.fabric8.openshift.api.model.template.Template entity, String sourceName) throws Exception
Exception
protected void doCreateTemplate(io.fabric8.openshift.api.model.template.Template entity, String namespace, String sourceName)
public Object processTemplate(io.fabric8.openshift.api.model.template.Template entity, String sourceName)
protected void printSummary(Object kubeResource) throws IOException
IOException
public void applyRoute(io.fabric8.openshift.api.model.Route entity, String sourceName)
public void applyBuildConfig(io.fabric8.openshift.api.model.BuildConfig entity, String sourceName)
public void applyDeploymentConfig(io.fabric8.openshift.api.model.DeploymentConfig entity, String sourceName)
public void applyImageStream(io.fabric8.openshift.api.model.ImageStream entity, String sourceName)
public void applyList(io.fabric8.kubernetes.api.model.KubernetesList list, String sourceName) throws Exception
Exception
public void applyService(io.fabric8.kubernetes.api.model.Service service, String sourceName) throws Exception
Exception
protected void doCreateService(io.fabric8.kubernetes.api.model.Service service, String namespace, String sourceName)
public void applyNamespace(io.fabric8.kubernetes.api.model.Namespace entity)
public void applyReplicationController(io.fabric8.kubernetes.api.model.ReplicationController replicationController, String sourceName) throws Exception
Exception
protected void doCreateReplicationController(io.fabric8.kubernetes.api.model.ReplicationController replicationController, String namespace, String sourceName)
protected void validatePodSpec(io.fabric8.kubernetes.api.model.PodSpec podSpec, String namespace)
public void applyPod(io.fabric8.kubernetes.api.model.Pod pod, String sourceName) throws Exception
Exception
protected void doCreatePod(io.fabric8.kubernetes.api.model.Pod pod, String namespace, String sourceName)
public String getNamespace()
public void setNamespace(String namespace)
public boolean isThrowExceptionOnError()
public void setThrowExceptionOnError(boolean throwExceptionOnError)
public boolean isProcessTemplatesLocally()
public void setProcessTemplatesLocally(boolean processTemplatesLocally)
protected boolean isRunning(io.fabric8.kubernetes.api.model.HasMetadata entity)
protected void onApplyError(String message, Exception e)
public boolean isAllowCreate()
public void setAllowCreate(boolean allowCreate)
public boolean isRecreateMode()
public void setRecreateMode(boolean recreateMode)
public void setServicesOnlyMode(boolean servicesOnlyMode)
public boolean isServicesOnlyMode()
public boolean isIgnoreServiceMode()
public void setIgnoreServiceMode(boolean ignoreServiceMode)
public boolean isIgnoreRunningOAuthClients()
public void setIgnoreRunningOAuthClients(boolean ignoreRunningOAuthClients)
Copyright © 2011–2015 Red Hat. All rights reserved.