public class ReplicationController extends KubernetesResource implements IReplicationController
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ENV |
protected static String |
IMAGE |
protected static String |
SERVICEACCOUNTNAME |
protected static String |
SPEC_REPLICAS |
protected static String |
SPEC_SELECTOR |
static String |
SPEC_TEMPLATE_CONTAINERS |
protected static String |
SPEC_TEMPLATE_LABELS |
protected static String |
STATUS_REPLICA |
protected static String |
VOLUMES |
DEPLOYMENT_PHASEANNOTATIONS, APIVERSION, CREATION_TIMESTAMP, FROM, KIND, LABELS, METADATA, METADATA_NAME, METADATA_NAMESPACE, METADATA_RESOURCE_VERSION, METADATA_UID, NAME, NAMESPACE, OBJECTS, PORTS, PROTOCOL, RESOURCE_VERSION, TYPE, VALUE| Constructor and Description |
|---|
ReplicationController(org.jboss.dmr.ModelNode node,
IClient client,
Map<String,String[]> propertyKeys) |
| Modifier and Type | Method and Description |
|---|---|
IContainer |
addContainer(DockerImageURI tag,
Set<IPort> containerPorts,
Map<String,String> envVars)
Add a container to the pod that will be spun up as part of this deployment,
defaulting the name to the image name
|
IContainer |
addContainer(String name)
Add a container with the given name
|
IContainer |
addContainer(String name,
DockerImageURI tag,
Set<IPort> containerPorts,
Map<String,String> envVars,
List<String> emptyDirVolumes)
Add a container to the pod that will be spun up as part of this deployment.
|
void |
addTemplateLabel(String key,
String value)
Add or update a label to the template spec;
|
void |
addVolume(IVolumeSource volumeSource)
Adds a volume to the pod spec.
|
<T extends IVolumeSource> |
addVolume(String volumetype,
String name)
Add a volume source of the given type with the given name.
|
IContainer |
getContainer(String name)
Retrieve a container by name or null if it is not found
|
Collection<IContainer> |
getContainers()
Retrieve the containers defined in spec
|
int |
getCurrentReplicaCount()
Returns the current number of replicas
|
int |
getDesiredReplicaCount()
Returns the desired number of replicas
|
Collection<IEnvironmentVariable> |
getEnvironmentVariables()
Return the list of env vars of the first container
|
Collection<IEnvironmentVariable> |
getEnvironmentVariables(String containerName)
Return the list of env vars for the given container or an empty list if the
container is not found
|
Collection<String> |
getImages()
Retrieves the list of images deployed in the pod containers from this
controller
|
int |
getReplicas() |
Map<String,String> |
getReplicaSelector()
Returns the selector used by the controller
|
String |
getServiceAccountName()
Retrieves the service account used by the controller
|
Map<String,String> |
getTemplateLabels()
Returns the labels for the template in this replication controller
|
Set<IVolumeSource> |
getVolumes()
The volumes associated with the pod spec
|
void |
removeEnvironmentVariable(String name)
Removes an environment variable with the given name.
|
void |
removeEnvironmentVariable(String containerName,
String name)
Removes an environment variable with the given name and value on the given
container.
|
void |
setContainers(Collection<IContainer> containers) |
void |
setDesiredReplicaCount(int count)
Sets a new desired number of replicas
|
void |
setEnvironmentVariable(String name,
String value)
Set an environment variable to the given name and value on the first
container in the list of containers
|
void |
setEnvironmentVariable(String containerName,
String name,
String value)
Set an environment variable to the given name and value on the given
container.
|
void |
setReplicas(int count) |
void |
setReplicaSelector(Map<String,String> selector)
Set the selector using the map of values
|
void |
setReplicaSelector(String key,
String value) |
void |
setServiceAccountName(String serviceAccountName)
Sets the service account to run this replication controller under.
|
void |
setVolumes(Set<IVolumeSource> volumeSources)
Sets the volumes associated with the pod spec.
|
accept, addLabel, asBoolean, asBoolean, asInt, asInt, asMap, asSet, asString, asString, equals, get, get, getAnnotation, getAnnotations, getApiVersion, getCapabilities, getCapability, getClient, getCreationTimeStamp, getEnvMap, getKind, getLabels, getMetadata, getModifiableCapabilities, getName, getNamespace, getNamespaceName, getNode, getPath, getProject, getPropertyKeys, getResourceVersion, has, hashCode, isAnnotatedWith, refresh, removeAnnotation, set, set, set, set, set, set, set, set, set, setAnnotation, setEnvMap, setName, setNamespace, setNode, supports, toJson, toJson, toPrettyString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddLabel, getAnnotation, getAnnotations, getCapabilities, getCreationTimeStamp, getLabels, getMetadata, getName, getNamespace, getNamespaceName, getProject, getResourceVersion, isAnnotatedWith, removeAnnotation, setAnnotationaccept, getCapability, supportsgetApiVersiontoJson, toJsonpublic static final String SPEC_TEMPLATE_CONTAINERS
protected static final String SPEC_TEMPLATE_LABELS
protected static final String VOLUMES
protected static final String SPEC_REPLICAS
protected static final String SPEC_SELECTOR
protected static final String STATUS_REPLICA
protected static final String SERVICEACCOUNTNAME
protected static final String IMAGE
protected static final String ENV
public void setEnvironmentVariable(String name, String value)
IReplicationControllersetEnvironmentVariable in interface IReplicationControllerpublic void setEnvironmentVariable(String containerName, String name, String value)
IReplicationControllersetEnvironmentVariable in interface IReplicationControllerpublic void removeEnvironmentVariable(String name)
IReplicationControllerremoveEnvironmentVariable in interface IReplicationControllerpublic void removeEnvironmentVariable(String containerName, String name)
IReplicationControllerremoveEnvironmentVariable in interface IReplicationControllerpublic Collection<IEnvironmentVariable> getEnvironmentVariables()
IReplicationControllergetEnvironmentVariables in interface IReplicationControllerpublic Collection<IEnvironmentVariable> getEnvironmentVariables(String containerName)
IReplicationControllergetEnvironmentVariables in interface IReplicationControllerpublic int getDesiredReplicaCount()
IReplicationControllergetDesiredReplicaCount in interface IReplicationControllerpublic int getReplicas()
getReplicas in interface IReplicationControllerpublic void setDesiredReplicaCount(int count)
IReplicationControllersetDesiredReplicaCount in interface IReplicationControllerpublic void setReplicas(int count)
setReplicas in interface IReplicationControllerpublic Map<String,String> getReplicaSelector()
IReplicationControllergetReplicaSelector in interface IReplicationControllerpublic void setReplicaSelector(String key, String value)
setReplicaSelector in interface IReplicationControllerpublic void setReplicaSelector(Map<String,String> selector)
IReplicationControllersetReplicaSelector in interface IReplicationControllerpublic int getCurrentReplicaCount()
IReplicationControllergetCurrentReplicaCount in interface IReplicationControllerpublic Collection<String> getImages()
IReplicationControllergetImages in interface IReplicationControllerpublic IContainer getContainer(String name)
IReplicationControllergetContainer in interface IReplicationControllerpublic Collection<IContainer> getContainers()
IReplicationControllergetContainers in interface IReplicationControllerpublic Map<String,String> getTemplateLabels()
IReplicationControllergetTemplateLabels in interface IReplicationControllerpublic void addTemplateLabel(String key, String value)
IReplicationControlleraddTemplateLabel in interface IReplicationControllerpublic IContainer addContainer(DockerImageURI tag, Set<IPort> containerPorts, Map<String,String> envVars)
IReplicationControlleraddContainer in interface IReplicationControllertag - the docker uricontainerPorts - the container portspublic IContainer addContainer(String name, DockerImageURI tag, Set<IPort> containerPorts, Map<String,String> envVars, List<String> emptyDirVolumes)
IReplicationControlleraddContainer in interface IReplicationControllername - the name of the containertag - the docker uricontainerPorts - the container portsemptyDirVolumes - the set of emptyDir volumes to add to the configpublic IContainer addContainer(String name)
IReplicationControlleraddContainer in interface IReplicationControllerpublic void setContainers(Collection<IContainer> containers)
setContainers in interface IReplicationControllerpublic Set<IVolumeSource> getVolumes()
IReplicationControllergetVolumes in interface IReplicationControllerpublic void setVolumes(Set<IVolumeSource> volumeSources)
IReplicationControllersetVolumes in interface IReplicationControllervolumeSources - The volumes to assign to the pod spec.public void addVolume(IVolumeSource volumeSource)
IReplicationControlleraddVolume in interface IReplicationControllervolumeSource - The volume to add to the pod specpublic <T extends IVolumeSource> T addVolume(String volumetype, String name)
IReplicationControlleraddVolume in interface IReplicationControllerpublic void setServiceAccountName(String serviceAccountName)
IReplicationControllersetServiceAccountName in interface IReplicationControllerpublic String getServiceAccountName()
IReplicationControllergetServiceAccountName in interface IReplicationControllerCopyright © 2019 Red Hat, Inc. All Rights Reserved.