public class KubernetesUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENV_KUBERNETES_SERVICE_HOST |
Constructor and Description |
---|
KubernetesUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
computeLabelSelector(java.util.Map<java.lang.String,java.lang.String> labels)
Determines the value of a Kubernetes labelSelector filter based on the passed labels.
|
static io.reactivex.Flowable<java.lang.String> |
computePodLabelSelector(KubernetesClient client,
java.util.List<java.lang.String> podLabelKeys,
java.lang.String namespace,
java.util.Map<java.lang.String,java.lang.String> labels) |
static io.micronaut.context.env.PropertySource |
configMapAsPropertySource(ConfigMap configMap)
Converts a
ConfigMap into a PropertySource . |
static io.reactivex.functions.Predicate<KubernetesObject> |
getExcludesFilter(java.util.Collection<java.lang.String> excludes) |
static io.reactivex.functions.Predicate<KubernetesObject> |
getIncludesFilter(java.util.Collection<java.lang.String> includes) |
static io.reactivex.functions.Predicate<KubernetesObject> |
getLabelsFilter(java.util.Map<java.lang.String,java.lang.String> labels) |
static io.micronaut.context.env.PropertySource |
secretAsPropertySource(Secret secret) |
public static final java.lang.String ENV_KUBERNETES_SERVICE_HOST
public static io.micronaut.context.env.PropertySource configMapAsPropertySource(ConfigMap configMap)
ConfigMap
into a PropertySource
.configMap
- the ConfigMappublic static java.lang.String computeLabelSelector(java.util.Map<java.lang.String,java.lang.String> labels)
labels
- the labelspublic static io.micronaut.context.env.PropertySource secretAsPropertySource(Secret secret)
secret
- The Secret
to transformPropertySource
.public static io.reactivex.functions.Predicate<KubernetesObject> getIncludesFilter(java.util.Collection<java.lang.String> includes)
includes
- the objects to includePredicate
based on a collection of object names to includepublic static io.reactivex.functions.Predicate<KubernetesObject> getExcludesFilter(java.util.Collection<java.lang.String> excludes)
excludes
- the objects to excludesPredicate
based on a collection of object names to excludespublic static io.reactivex.functions.Predicate<KubernetesObject> getLabelsFilter(java.util.Map<java.lang.String,java.lang.String> labels)
labels
- the labels to includePredicate
based on labels the kubernetes objects has to match to return truepublic static io.reactivex.Flowable<java.lang.String> computePodLabelSelector(KubernetesClient client, java.util.List<java.lang.String> podLabelKeys, java.lang.String namespace, java.util.Map<java.lang.String,java.lang.String> labels)
client
- the KubernetesClient
podLabelKeys
- the list of labels inside a podnamespace
- in the configurationlabels
- the labels