public final class KubernetesHelper extends Object
Modifier and Type | Field and Description |
---|---|
protected static SimpleDateFormat |
dateTimeFormat |
static String |
DEFAULT_DOCKER_HOST |
static String |
DEFAULT_PROTO |
static String |
defaultApiVersion |
static String |
defaultOsApiVersion |
static int |
INTORSTRING_KIND_INT |
static int |
INTORSTRING_KIND_STRING |
Constructor and Description |
---|
KubernetesHelper() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addObjectsToItemArray(List destinationList,
Object object) |
protected static void |
appendSummaryText(StringBuilder buffer,
io.fabric8.kubernetes.api.model.PodSpec podSpec) |
protected static void |
appendSummaryText(StringBuilder buffer,
io.fabric8.kubernetes.api.model.PodTemplateSpec podTemplateSpec) |
protected static void |
appendText(StringBuilder buffer,
String text) |
static io.fabric8.kubernetes.api.model.KubernetesList |
asKubernetesList(Object dto)
Converts the DTO loaded from JSON to a
KubernetesList assuming its not a Template |
static Object |
combineJson(Object... objects)
Combines the JSON objects into a config object
|
static String |
containerNameToPodId(String containerName)
Returns the pod id for the given container id
|
static io.fabric8.kubernetes.api.model.IntOrString |
createIntOrString(int intVal)
Creates an IntOrString from the given string which could be a number or a name
|
static io.fabric8.kubernetes.api.model.IntOrString |
createIntOrString(String nameOrNumber)
Creates an IntOrString from the given string which could be a number or a name
|
static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Service> |
createNamespaceServiceFilter(String namespace)
Creates a filter on a service if it matches the given namespace
|
static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> |
createPodAnnotationFilter(Map<String,String> annotationSelector)
Creates a filter on a pod annotations using the given set of attribute values
|
static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> |
createPodFilter(Map<String,String> labelSelector)
Creates a filter on a pod using the given set of labels
|
static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> |
createPodFilter(String textFilter)
Creates a filter on a pod using the given text string
|
static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.ReplicationController> |
createReplicationControllerFilter(Map<String,String> labelSelector)
Creates a filter on a replicationController using the given text string
|
static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.ReplicationController> |
createReplicationControllerFilter(String textFilter)
Creates a filter on a replicationController using the given text string
|
static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Service> |
createServiceFilter(Map<String,String> labelSelector)
Creates a filter on a service using the given text string
|
static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Service> |
createServiceFilter(String textFilter)
Creates a filter on a service using the given text string
|
static boolean |
filterLabels(Map<String,String> filterLabels,
Map<String,String> labels)
Returns true if the given filterLabels matches the actual labels
|
static boolean |
filterMatchesIdOrLabels(String textFilter,
String id,
Map<String,String> labels)
Returns true if the given textFilter matches either the id or the labels
|
static io.fabric8.kubernetes.api.model.ContainerPort |
findContainerPort(io.fabric8.kubernetes.api.model.Pod pod,
Integer portNumber)
Returns the port for the given port number on the pod
|
static io.fabric8.kubernetes.api.model.ContainerPort |
findContainerPortByName(io.fabric8.kubernetes.api.model.Pod pod,
String name)
Returns the port for the given port name
|
static io.fabric8.kubernetes.api.model.ContainerPort |
findContainerPortByNumberOrName(io.fabric8.kubernetes.api.model.Pod pod,
String numberOrName)
Returns the port for the given port number or name
|
protected static io.fabric8.kubernetes.api.model.KubernetesList |
findOrCreateList(Object[] objects) |
protected static Map<String,Object> |
getAdditionalPropertyMap(Map<String,Object> additionalProperties,
String name) |
protected static String |
getAdditionalPropertyText(Map<String,Object> additionalProperties,
String name) |
static Set<Integer> |
getContainerPorts(io.fabric8.kubernetes.api.model.Service service)
Returns the container port number for the given service
|
static Set<String> |
getContainerPortsStrings(io.fabric8.kubernetes.api.model.Service service)
Returns the container port number for the given service
|
static List<io.fabric8.kubernetes.api.model.Container> |
getContainers(io.fabric8.kubernetes.api.model.Pod pod)
Returns all the containers from the given pod
|
static List<io.fabric8.kubernetes.api.model.Container> |
getContainers(io.fabric8.kubernetes.api.model.PodSpec podSpec) |
static List<io.fabric8.kubernetes.api.model.Container> |
getContainers(io.fabric8.kubernetes.api.model.PodTemplateSpec podTemplateSpec) |
static List<io.fabric8.kubernetes.api.model.Container> |
getContainers(io.fabric8.kubernetes.api.model.ReplicationController replicationController)
Returns all the containers from the given Replication Controller
|
static List<io.fabric8.kubernetes.api.model.Container> |
getContainers(io.fabric8.kubernetes.api.model.ReplicationControllerSpec replicationControllerSpec)
Returns all the containers from the given Replication Controller's replicationControllerSpec
|
static Map<String,io.fabric8.kubernetes.api.model.ContainerStatus> |
getCurrentContainers(io.fabric8.kubernetes.api.model.Pod pod)
Returns all the current containers from the given currentState
|
static Map<String,io.fabric8.kubernetes.api.model.ContainerStatus> |
getCurrentContainers(io.fabric8.kubernetes.api.model.PodStatus podStatus)
Returns all the current containers from the given podStatus
|
static List<io.fabric8.kubernetes.api.model.Container> |
getCurrentContainers(io.fabric8.kubernetes.api.model.ReplicationController replicationController)
Returns all the containers from the given Replication Controller
|
static String |
getDockerIp() |
static Map<String,io.fabric8.kubernetes.api.model.Pod> |
getFilteredPodMap(Kubernetes kubernetes,
io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> filter) |
static Map<String,io.fabric8.kubernetes.api.model.Pod> |
getFilteredPodMap(Kubernetes kubernetes,
String namespace,
io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> filter) |
static String |
getHost(io.fabric8.kubernetes.api.model.Pod pod)
Returns the host of the pod
|
static String |
getKind(io.fabric8.kubernetes.api.model.HasMetadata entity)
Returns the kind of the entity
|
static Map<String,String> |
getLabels(io.fabric8.kubernetes.api.model.HasMetadata entity) |
static Map<String,String> |
getLabels(io.fabric8.kubernetes.api.model.ObjectMeta metadata)
Returns the labels of the given metadata object or an empty map if the metadata or labels are null
|
protected static Map<String,Object> |
getMetadata(Map<String,Object> additionalProperties,
boolean create) |
static String |
getName(io.fabric8.kubernetes.api.model.HasMetadata entity) |
static String |
getName(io.fabric8.kubernetes.api.model.ObjectMeta entity) |
static String |
getNamespace(io.fabric8.kubernetes.api.model.HasMetadata entity) |
static String |
getNamespace(io.fabric8.kubernetes.api.model.ObjectMeta entity) |
static String |
getObjectId(Object object)
Returns the ID of the given object
|
static Map<String,String> |
getOrCreateAnnotations(io.fabric8.kubernetes.api.model.HasMetadata entity) |
static Map<String,String> |
getOrCreateLabels(io.fabric8.kubernetes.api.model.HasMetadata entity) |
static io.fabric8.kubernetes.api.model.ObjectMeta |
getOrCreateMetadata(io.fabric8.kubernetes.api.model.HasMetadata entity) |
static io.fabric8.kubernetes.api.model.ServiceSpec |
getOrCreateSpec(io.fabric8.kubernetes.api.model.Service entity) |
static Map<String,io.fabric8.kubernetes.api.model.Pod> |
getPodMap(Kubernetes kubernetes) |
static Map<String,io.fabric8.kubernetes.api.model.Pod> |
getPodMap(Kubernetes kubernetes,
String namespace) |
static List<io.fabric8.kubernetes.api.model.Pod> |
getPodsForReplicationController(io.fabric8.kubernetes.api.model.ReplicationController replicationController,
Iterable<io.fabric8.kubernetes.api.model.Pod> pods)
Returns the pods for the given replication controller
|
static List<io.fabric8.kubernetes.api.model.Pod> |
getPodsForService(io.fabric8.kubernetes.api.model.Service service,
Iterable<io.fabric8.kubernetes.api.model.Pod> pods)
Returns the pods for the given service
|
static PodStatusType |
getPodStatus(io.fabric8.kubernetes.api.model.Pod pod) |
static String |
getPodStatusText(io.fabric8.kubernetes.api.model.Pod pod) |
static String |
getPortalIP(io.fabric8.kubernetes.api.model.Service entity) |
static Set<Integer> |
getPorts(io.fabric8.kubernetes.api.model.Service entity) |
static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> |
getReplicationControllerMap(Kubernetes kubernetes) |
static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> |
getReplicationControllerMap(Kubernetes kubernetes,
String namespace) |
static String |
getResourceVersion(io.fabric8.kubernetes.api.model.HasMetadata entity)
Returns the resource version for the entity or null if it does not have one
|
static Map<String,io.fabric8.kubernetes.api.model.Pod> |
getSelectedPodMap(Kubernetes kubernetes,
String selector) |
static Map<String,io.fabric8.kubernetes.api.model.Pod> |
getSelectedPodMap(Kubernetes kubernetes,
String namespace,
String selector) |
static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> |
getSelectedReplicationControllerMap(Kubernetes kubernetes,
String selector) |
static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> |
getSelectedReplicationControllerMap(Kubernetes kubernetes,
String namespace,
String selector) |
static Map<String,String> |
getSelector(io.fabric8.kubernetes.api.model.Service entity) |
static Map<String,io.fabric8.kubernetes.api.model.Service> |
getServiceMap(Kubernetes kubernetes) |
static Map<String,io.fabric8.kubernetes.api.model.Service> |
getServiceMap(Kubernetes kubernetes,
String namespace) |
static String |
getServiceURL(io.fabric8.kubernetes.api.model.Service service)
Returns the URL to access the service; using the service portalIP and port
|
static String |
getStatusText(io.fabric8.kubernetes.api.model.PodStatus podStatus) |
static boolean |
hasResourceVersion(io.fabric8.kubernetes.api.model.HasMetadata entity)
Returns true if this entity has a valid non blank resourceVersion in its metadata
|
static Integer |
intOrStringToInteger(io.fabric8.kubernetes.api.model.IntOrString intOrStringValue,
String message)
Returns the IntOrString converted to an Integer value or throws an exception with the given message
|
static boolean |
isPodRunning(io.fabric8.kubernetes.api.model.Pod pod)
Returns true if the pod is running
|
static boolean |
isPureKubernetes(io.fabric8.kubernetes.api.model.HasMetadata item)
Returns true if this object is a pure kubernetes DTO
|
static boolean |
isServiceSsl(String host,
int port,
boolean trustAllCerts) |
static Object |
loadJson(byte[] json)
Returns the given json data as a DTO such as
Pod , ReplicationController or
Service
from the Kubernetes REST API |
static Object |
loadJson(File file)
Returns the given json data as a DTO such as
Pod , ReplicationController or
Service
from the Kubernetes REST API |
static Object |
loadJson(InputStream in)
Returns the given json data as a DTO such as
Pod , ReplicationController or
Service
from the Kubernetes REST API |
static Object |
loadJson(String json) |
static <T> T |
loadYaml(byte[] data,
Class<T> clazz)
Loads the YAML file for the given DTO class
|
static <T> T |
loadYaml(File file,
Class<T> clazz)
Loads the YAML file for the given DTO class
|
static <T> T |
loadYaml(InputStream in,
Class<T> clazz)
Loads the YAML file for the given DTO class
|
static List<String> |
lookupServiceEndpointsInDns(String serviceName)
Looks up the service endpoints in DNS.
|
static Set<String> |
lookupServiceInDns(String serviceName)
Looks up the service in DNS.
|
static void |
moveServicesToFrontOfArray(List<io.fabric8.kubernetes.api.model.HasMetadata> list)
Lets move all Service resources before any other to avoid ordering issues creating things
|
static Date |
parseDate(String text) |
protected static void |
removeDuplicates(List<io.fabric8.kubernetes.api.model.HasMetadata> itemArray)
Remove any duplicate resources using the kind and id
|
static void |
removeEmptyPods(io.fabric8.kubernetes.api.model.PodList podSchema)
Removes empty pods returned by Kubernetes
|
static String |
resolveDockerHost() |
static void |
saveJson(File json,
Object object)
Saves the json object to the given file
|
static String |
serviceToHost(String id) |
static String |
serviceToPort(String id) |
static String |
serviceToProtocol(String id,
String servicePort) |
static void |
setName(io.fabric8.kubernetes.api.model.HasMetadata entity,
String name) |
static void |
setName(io.fabric8.kubernetes.api.model.HasMetadata entity,
String namespace,
String name) |
static void |
setNamespace(io.fabric8.kubernetes.api.model.HasMetadata entity,
String namespace) |
static void |
setSelector(io.fabric8.kubernetes.api.model.Service entity,
Map<String,String> labels) |
static String |
summaryText(io.fabric8.kubernetes.api.model.ContainerState entity)
Returns a short summary text message for the given kubernetes resource
|
static String |
summaryText(io.fabric8.openshift.api.model.DeploymentConfig entity)
Returns a short summary text message for the given kubernetes resource
|
static String |
summaryText(io.fabric8.openshift.api.model.OAuthClient entity)
Returns a short summary text message for the given kubernetes resource
|
static String |
summaryText(Object object)
Returns a short summary text message for the given kubernetes resource
|
static String |
summaryText(io.fabric8.kubernetes.api.model.Pod entity)
Returns a short summary text message for the given kubernetes resource
|
static String |
summaryText(io.fabric8.kubernetes.api.model.ReplicationController entity)
Returns a short summary text message for the given kubernetes resource
|
static String |
summaryText(io.fabric8.openshift.api.model.Route entity)
Returns a short summary text message for the given kubernetes resource
|
static String |
summaryText(io.fabric8.kubernetes.api.model.Service entity)
Returns a short summary text message for the given kubernetes resource
|
static String |
summaryText(io.fabric8.openshift.api.model.Template entity)
Returns a short summary text message for the given kubernetes resource
|
static String |
toEnvVariable(String str) |
protected static Map<String,io.fabric8.kubernetes.api.model.Pod> |
toFilteredPodMap(io.fabric8.kubernetes.api.model.PodList podSchema,
io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> filter) |
protected static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> |
toFilteredReplicationControllerMap(io.fabric8.kubernetes.api.model.ReplicationControllerList replicationControllerSchema,
io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.ReplicationController> filter) |
static Map<String,io.fabric8.kubernetes.api.model.Service> |
toFilteredServiceMap(io.fabric8.kubernetes.api.model.ServiceList serviceList,
io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Service> filter) |
static List<io.fabric8.kubernetes.api.model.HasMetadata> |
toItemList(Object entity)
Loads the Kubernetes JSON and converts it to a list of entities
|
static String |
toJson(Object dto) |
static Map<String,String> |
toLabelsMap(String labels) |
static String |
toLabelsString(Map<String,String> labelMap)
Returns a string for the labels using "," to separate values
|
protected static Integer |
toOptionalNumber(String text)
Returns the number if it can be parsed or null
|
static Map<String,io.fabric8.kubernetes.api.model.Pod> |
toPodMap(List<io.fabric8.kubernetes.api.model.Pod> pods)
Returns a map indexed by pod id of the pods
|
static Map<String,io.fabric8.kubernetes.api.model.Pod> |
toPodMap(io.fabric8.kubernetes.api.model.PodList podSchema)
Returns a map indexed by pod id of the pods
|
static String |
toPositiveNonZeroText(Integer port)
For positive non-zero values return the text of the number or return blank
|
static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> |
toReplicationControllerMap(List<io.fabric8.kubernetes.api.model.ReplicationController> replicationControllers)
Returns a map indexed by replicationController id of the replicationControllers
|
static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> |
toReplicationControllerMap(io.fabric8.kubernetes.api.model.ReplicationControllerList replicationControllerSchema)
Returns a map indexed by replicationController id of the replicationControllers
|
static Map<String,io.fabric8.kubernetes.api.model.Service> |
toServiceMap(List<io.fabric8.kubernetes.api.model.Service> services)
Returns a map indexed by service id of the services
|
static Map<String,io.fabric8.kubernetes.api.model.Service> |
toServiceMap(io.fabric8.kubernetes.api.model.ServiceList serviceSchema)
Returns a map indexed by service id of the services
|
static String |
validateKubernetesId(String currentValue,
String description)
Validates that the given value is valid according to the kubernetes ID parsing rules, throwing an exception if not.
|
static io.fabric8.kubernetes.api.model.Secret |
validateSecretExists(KubernetesClient kubernetes,
String namespace,
String secretName) |
public static final int INTORSTRING_KIND_INT
public static final int INTORSTRING_KIND_STRING
public static final String DEFAULT_DOCKER_HOST
protected static SimpleDateFormat dateTimeFormat
public static final String defaultApiVersion
public static final String defaultOsApiVersion
public static final String DEFAULT_PROTO
public static io.fabric8.kubernetes.api.model.ObjectMeta getOrCreateMetadata(io.fabric8.kubernetes.api.model.HasMetadata entity)
public static String getResourceVersion(io.fabric8.kubernetes.api.model.HasMetadata entity)
public static boolean hasResourceVersion(io.fabric8.kubernetes.api.model.HasMetadata entity)
public static String getName(io.fabric8.kubernetes.api.model.ObjectMeta entity)
public static String getKind(io.fabric8.kubernetes.api.model.HasMetadata entity)
public static String getName(io.fabric8.kubernetes.api.model.HasMetadata entity)
public static void setName(io.fabric8.kubernetes.api.model.HasMetadata entity, String name)
public static void setName(io.fabric8.kubernetes.api.model.HasMetadata entity, String namespace, String name)
public static void setNamespace(io.fabric8.kubernetes.api.model.HasMetadata entity, String namespace)
public static String getNamespace(io.fabric8.kubernetes.api.model.ObjectMeta entity)
public static String getNamespace(io.fabric8.kubernetes.api.model.HasMetadata entity)
public static Map<String,String> getOrCreateAnnotations(io.fabric8.kubernetes.api.model.HasMetadata entity)
public static Map<String,String> getOrCreateLabels(io.fabric8.kubernetes.api.model.HasMetadata entity)
public static Map<String,String> getLabels(io.fabric8.kubernetes.api.model.ObjectMeta metadata)
public static Map<String,String> getLabels(io.fabric8.kubernetes.api.model.HasMetadata entity)
public static io.fabric8.kubernetes.api.model.ServiceSpec getOrCreateSpec(io.fabric8.kubernetes.api.model.Service entity)
public static String getPortalIP(io.fabric8.kubernetes.api.model.Service entity)
public static Map<String,String> getSelector(io.fabric8.kubernetes.api.model.Service entity)
public static void setSelector(io.fabric8.kubernetes.api.model.Service entity, Map<String,String> labels)
protected static String getAdditionalPropertyText(Map<String,Object> additionalProperties, String name)
protected static Map<String,Object> getMetadata(Map<String,Object> additionalProperties, boolean create)
protected static Map<String,Object> getAdditionalPropertyMap(Map<String,Object> additionalProperties, String name)
public static String getDockerIp()
public static String resolveDockerHost()
public static String toJson(Object dto) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
public static Object loadJson(File file) throws IOException
Pod
, ReplicationController
or
Service
from the Kubernetes REST APIIOException
public static Object loadJson(InputStream in) throws IOException
Pod
, ReplicationController
or
Service
from the Kubernetes REST APIIOException
public static Object loadJson(String json) throws IOException
IOException
public static Object loadJson(byte[] json) throws IOException
Pod
, ReplicationController
or
Service
from the Kubernetes REST APIIOException
public static <T> T loadYaml(InputStream in, Class<T> clazz) throws IOException
IOException
public static <T> T loadYaml(File file, Class<T> clazz) throws IOException
IOException
public static <T> T loadYaml(byte[] data, Class<T> clazz) throws IOException
IOException
public static List<io.fabric8.kubernetes.api.model.HasMetadata> toItemList(Object entity) throws IOException
IOException
public static void saveJson(File json, Object object) throws IOException
IOException
public static Map<String,io.fabric8.kubernetes.api.model.Pod> toPodMap(io.fabric8.kubernetes.api.model.PodList podSchema)
protected static Map<String,io.fabric8.kubernetes.api.model.Pod> toFilteredPodMap(io.fabric8.kubernetes.api.model.PodList podSchema, io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> filter)
public static Map<String,io.fabric8.kubernetes.api.model.Pod> toPodMap(List<io.fabric8.kubernetes.api.model.Pod> pods)
public static Map<String,io.fabric8.kubernetes.api.model.Service> toServiceMap(io.fabric8.kubernetes.api.model.ServiceList serviceSchema)
public static Map<String,io.fabric8.kubernetes.api.model.Service> toServiceMap(List<io.fabric8.kubernetes.api.model.Service> services)
public static Map<String,io.fabric8.kubernetes.api.model.Service> toFilteredServiceMap(io.fabric8.kubernetes.api.model.ServiceList serviceList, io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Service> filter)
public static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> toReplicationControllerMap(io.fabric8.kubernetes.api.model.ReplicationControllerList replicationControllerSchema)
protected static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> toFilteredReplicationControllerMap(io.fabric8.kubernetes.api.model.ReplicationControllerList replicationControllerSchema, io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.ReplicationController> filter)
public static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> toReplicationControllerMap(List<io.fabric8.kubernetes.api.model.ReplicationController> replicationControllers)
public static Map<String,io.fabric8.kubernetes.api.model.Pod> getPodMap(Kubernetes kubernetes)
public static Map<String,io.fabric8.kubernetes.api.model.Pod> getPodMap(Kubernetes kubernetes, String namespace)
public static Map<String,io.fabric8.kubernetes.api.model.Pod> getSelectedPodMap(Kubernetes kubernetes, String selector)
public static Map<String,io.fabric8.kubernetes.api.model.Pod> getSelectedPodMap(Kubernetes kubernetes, String namespace, String selector)
public static Map<String,io.fabric8.kubernetes.api.model.Pod> getFilteredPodMap(Kubernetes kubernetes, io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> filter)
public static Map<String,io.fabric8.kubernetes.api.model.Pod> getFilteredPodMap(Kubernetes kubernetes, String namespace, io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> filter)
public static Map<String,io.fabric8.kubernetes.api.model.Service> getServiceMap(Kubernetes kubernetes)
public static Map<String,io.fabric8.kubernetes.api.model.Service> getServiceMap(Kubernetes kubernetes, String namespace)
public static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> getReplicationControllerMap(Kubernetes kubernetes)
public static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> getReplicationControllerMap(Kubernetes kubernetes, String namespace)
public static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> getSelectedReplicationControllerMap(Kubernetes kubernetes, String selector)
public static Map<String,io.fabric8.kubernetes.api.model.ReplicationController> getSelectedReplicationControllerMap(Kubernetes kubernetes, String namespace, String selector)
public static void removeEmptyPods(io.fabric8.kubernetes.api.model.PodList podSchema)
public static String containerNameToPodId(String containerName)
public static String toLabelsString(Map<String,String> labelMap)
public static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> createPodFilter(String textFilter)
public static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> createPodFilter(Map<String,String> labelSelector)
public static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Pod> createPodAnnotationFilter(Map<String,String> annotationSelector)
public static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Service> createServiceFilter(String textFilter)
public static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Service> createNamespaceServiceFilter(String namespace)
public static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.Service> createServiceFilter(Map<String,String> labelSelector)
public static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.ReplicationController> createReplicationControllerFilter(String textFilter)
public static io.fabric8.utils.Filter<io.fabric8.kubernetes.api.model.ReplicationController> createReplicationControllerFilter(Map<String,String> labelSelector)
public static boolean filterMatchesIdOrLabels(String textFilter, String id, Map<String,String> labels)
public static boolean filterLabels(Map<String,String> filterLabels, Map<String,String> labels)
public static String toPositiveNonZeroText(Integer port)
public static List<io.fabric8.kubernetes.api.model.Container> getContainers(io.fabric8.kubernetes.api.model.Pod pod)
public static List<io.fabric8.kubernetes.api.model.Container> getContainers(io.fabric8.kubernetes.api.model.ReplicationController replicationController)
public static List<io.fabric8.kubernetes.api.model.Container> getContainers(io.fabric8.kubernetes.api.model.ReplicationControllerSpec replicationControllerSpec)
public static List<io.fabric8.kubernetes.api.model.Container> getContainers(io.fabric8.kubernetes.api.model.PodSpec podSpec)
public static List<io.fabric8.kubernetes.api.model.Container> getContainers(io.fabric8.kubernetes.api.model.PodTemplateSpec podTemplateSpec)
public static List<io.fabric8.kubernetes.api.model.Container> getCurrentContainers(io.fabric8.kubernetes.api.model.ReplicationController replicationController)
public static Map<String,io.fabric8.kubernetes.api.model.ContainerStatus> getCurrentContainers(io.fabric8.kubernetes.api.model.Pod pod)
public static Map<String,io.fabric8.kubernetes.api.model.ContainerStatus> getCurrentContainers(io.fabric8.kubernetes.api.model.PodStatus podStatus)
public static String getHost(io.fabric8.kubernetes.api.model.Pod pod)
public static Set<Integer> getContainerPorts(io.fabric8.kubernetes.api.model.Service service)
public static Integer intOrStringToInteger(io.fabric8.kubernetes.api.model.IntOrString intOrStringValue, String message)
public static Set<String> getContainerPortsStrings(io.fabric8.kubernetes.api.model.Service service)
public static Object combineJson(Object... objects) throws IOException
IOException
public static void moveServicesToFrontOfArray(List<io.fabric8.kubernetes.api.model.HasMetadata> list)
protected static void removeDuplicates(List<io.fabric8.kubernetes.api.model.HasMetadata> itemArray)
protected static void addObjectsToItemArray(List destinationList, Object object) throws IOException
IOException
protected static io.fabric8.kubernetes.api.model.KubernetesList findOrCreateList(Object[] objects)
public static String getServiceURL(io.fabric8.kubernetes.api.model.Service service)
public static io.fabric8.kubernetes.api.model.ContainerPort findContainerPort(io.fabric8.kubernetes.api.model.Pod pod, Integer portNumber)
public static io.fabric8.kubernetes.api.model.ContainerPort findContainerPortByName(io.fabric8.kubernetes.api.model.Pod pod, String name)
public static io.fabric8.kubernetes.api.model.ContainerPort findContainerPortByNumberOrName(io.fabric8.kubernetes.api.model.Pod pod, String numberOrName)
protected static Integer toOptionalNumber(String text)
public static PodStatusType getPodStatus(io.fabric8.kubernetes.api.model.Pod pod)
public static boolean isPodRunning(io.fabric8.kubernetes.api.model.Pod pod)
public static String getPodStatusText(io.fabric8.kubernetes.api.model.Pod pod)
public static List<io.fabric8.kubernetes.api.model.Pod> getPodsForReplicationController(io.fabric8.kubernetes.api.model.ReplicationController replicationController, Iterable<io.fabric8.kubernetes.api.model.Pod> pods)
public static List<io.fabric8.kubernetes.api.model.Pod> getPodsForService(io.fabric8.kubernetes.api.model.Service service, Iterable<io.fabric8.kubernetes.api.model.Pod> pods)
public static List<String> lookupServiceEndpointsInDns(String serviceName) throws IllegalArgumentException, UnknownHostException
public static Set<String> lookupServiceInDns(String serviceName) throws IllegalArgumentException, UnknownHostException
public static boolean isServiceSsl(String host, int port, boolean trustAllCerts)
public static String validateKubernetesId(String currentValue, String description) throws IllegalArgumentException
IllegalArgumentException
public static String summaryText(Object object)
public static String summaryText(io.fabric8.openshift.api.model.Route entity)
public static String summaryText(io.fabric8.kubernetes.api.model.ContainerState entity)
public static String summaryText(io.fabric8.openshift.api.model.Template entity)
public static String summaryText(io.fabric8.openshift.api.model.OAuthClient entity)
public static String summaryText(io.fabric8.kubernetes.api.model.Service entity)
public static String summaryText(io.fabric8.kubernetes.api.model.ReplicationController entity)
public static String summaryText(io.fabric8.openshift.api.model.DeploymentConfig entity)
public static String summaryText(io.fabric8.kubernetes.api.model.Pod entity)
protected static void appendSummaryText(StringBuilder buffer, io.fabric8.kubernetes.api.model.PodTemplateSpec podTemplateSpec)
protected static void appendSummaryText(StringBuilder buffer, io.fabric8.kubernetes.api.model.PodSpec podSpec)
protected static void appendText(StringBuilder buffer, String text)
public static io.fabric8.kubernetes.api.model.IntOrString createIntOrString(int intVal)
public static io.fabric8.kubernetes.api.model.IntOrString createIntOrString(String nameOrNumber)
public static String getStatusText(io.fabric8.kubernetes.api.model.PodStatus podStatus)
public static io.fabric8.kubernetes.api.model.Secret validateSecretExists(KubernetesClient kubernetes, String namespace, String secretName)
public static io.fabric8.kubernetes.api.model.KubernetesList asKubernetesList(Object dto) throws IOException
KubernetesList
assuming its not a Template
IOException
public static boolean isPureKubernetes(io.fabric8.kubernetes.api.model.HasMetadata item)
Copyright © 2011–2015 Red Hat. All rights reserved.