public class KubernetesLocation extends AbstractLocation implements MachineProvisioningLocation<KubernetesMachineLocation>, KubernetesLocationConfig
Modifier and Type | Class and Description |
---|---|
static interface |
KubernetesLocation.ExitCondition |
AbstractLocation.BasicSubscriptionSupport
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BROOKLYN_APPLICATION_ID |
static java.lang.String |
BROOKLYN_ENTITY_ID |
static java.lang.String |
BROOKLYN_ROOT_PASSWORD
The environment variable for injecting login credentials.
|
static java.util.List<java.lang.String> |
IMAGE_DESCRIPTION_REGEXES_REQUIRING_INJECTED_LOGIN_CREDS
The regex for the image descriptions that support us injecting login credentials.
|
static java.lang.String |
IMMUTABLE_CONTAINER_KEY |
static java.lang.String |
KUBERNETES_DOCKERCFG |
static java.lang.String |
NODE_PORT |
static java.lang.String |
PHASE_ACTIVE |
static java.lang.String |
PHASE_AVAILABLE |
static java.lang.String |
PHASE_TERMINATING |
static java.lang.String |
SSHABLE_CONTAINER |
PARENT_LOCATION, TEMPORARY_LOCATION
ACTION_TIMEOUT, CA_CERT_DATA, CA_CERT_FILE, CLIENT_CERT_DATA, CLIENT_CERT_FILE, CLIENT_KEY_ALGO, CLIENT_KEY_DATA, CLIENT_KEY_FILE, CLIENT_KEY_PASSPHRASE, CLIENT_TIMEOUT, CREATE_NAMESPACE, DELETE_EMPTY_NAMESPACE, ENV, IMAGE, INJECT_LOGIN_CREDENTIAL, KUBECONFIG, KUBECONFIG_CONTEXT, KUBERNETES_CLIENT_REGISTRY, LOGIN_USER, LOGIN_USER_PASSWORD, MASTER_URL, NAMESPACE, OAUTH_TOKEN, OS_FAMILY, OS_VERSION_REGEX, PRIVILEGED, TRUST_CERTS
ACCESS_CREDENTIAL, ACCESS_IDENTITY, ADDITIONAL_INBOUND_PORTS, CALLER_CONTEXT, CLOUD_AVAILABILITY_ZONE_ID, CLOUD_ENDPOINT, CLOUD_REGION_ID, DESTROY_ON_FAILURE, DOMAIN_NAME, EXTENSION, INBOUND_PORTS, LEGACY_PRIVATE_KEY_DATA, LEGACY_PRIVATE_KEY_FILE, LEGACY_PRIVATE_KEY_PASSPHRASE, LEGACY_PUBLIC_KEY_DATA, LEGACY_PUBLIC_KEY_FILE, LOG_CREDENTIALS, MACHINE_LOCATION_CUSTOMIZERS, MIN_CORES, MIN_DISK, MIN_RAM, OAUTH_ENDPOINT, OS_64_BIT, PASSWORD, POLL_FOR_FIRST_REACHABLE_ADDRESS, POLL_FOR_FIRST_REACHABLE_ADDRESS_PREDICATE, POLL_FOR_FIRST_REACHABLE_ADDRESS_PREDICATE_TYPE, PRIVATE_KEY_DATA, PRIVATE_KEY_FILE, PRIVATE_KEY_PASSPHRASE, PUBLIC_KEY_DATA, PUBLIC_KEY_FILE, USER, VM_NAME_ALLOWED_CHARACTERS, VM_NAME_MAX_LENGTH, VM_NAME_SALT_LENGTH, WAIT_FOR_SSHABLE, WAIT_FOR_WINRM_AVAILABLE
FINAL_SPEC, NAMED_SPEC_NAME, ORIGINAL_SPEC
Constructor and Description |
---|
KubernetesLocation() |
KubernetesLocation(java.util.Map<?,?> properties) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getProvisioningFlags(java.util.Collection<java.lang.String> tags)
Gets flags, suitable as an argument to
MachineProvisioningLocation.obtain(Map) . |
boolean |
implementsInterface(Entity entity,
java.lang.Class<?> type) |
void |
init()
Called by framework (in new-style instances where spec was used) after configuring etc,
but before a reference to this instance is shared.
|
<T> T |
lookup(ConfigKey<T> config,
Entity entity,
ConfigBag setup) |
<T> T |
lookup(ConfigKey<T> config,
Entity entity,
ConfigBag setup,
T defaultValue)
Looks up
configuration with the entity value taking precedence over the
location, and returning a default value (normally null) if neither is present. |
MachineProvisioningLocation<KubernetesMachineLocation> |
newSubLocation(java.util.Map<?,?> newFlags)
Creates a new location of the same type, but with additional creation instructions in the form of flags,
e.g.
|
KubernetesMachineLocation |
obtain(java.util.Map<?,?> flags)
Obtain a machine in this location.
|
void |
release(KubernetesMachineLocation machine)
Release a previously-obtained machine.
|
void |
waitForExitCondition(KubernetesLocation.ExitCondition exitCondition) |
void |
waitForExitCondition(KubernetesLocation.ExitCondition exitCondition,
Duration initial,
Duration duration) |
addChild, addExtension, config, configure, containsLocation, equals, getChildren, getConfig, getConfig, getDisplayName, getExtension, getHostGeoInfo, getLocationTypeInternal, getParent, getRebindSupport, hasExtension, hashCode, isManaged, onManagementStarted, onManagementStopped, rebind, relations, removeChild, setDisplayName, setHostGeoInfo, setManagementContext, setParent, setParent, subscriptions, toMetadataRecord, toString, toVerboseString
addSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, getManagementContext, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId, tags
containsLocation, getChildren, getConfig, getDisplayName, getExtension, getId, getParent, hasExtension, relations, setParent, toVerboseString
getCatalogItemId, getCatalogItemIdSearchPath, subscriptions, tags
config, getConfig
getManagementContext
addSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemId
public static final java.lang.String NODE_PORT
public static final java.lang.String IMMUTABLE_CONTAINER_KEY
public static final java.lang.String SSHABLE_CONTAINER
public static final java.lang.String BROOKLYN_ENTITY_ID
public static final java.lang.String BROOKLYN_APPLICATION_ID
public static final java.lang.String KUBERNETES_DOCKERCFG
public static final java.lang.String PHASE_AVAILABLE
public static final java.lang.String PHASE_TERMINATING
public static final java.lang.String PHASE_ACTIVE
public static final java.util.List<java.lang.String> IMAGE_DESCRIPTION_REGEXES_REQUIRING_INJECTED_LOGIN_CREDS
public static final java.lang.String BROOKLYN_ROOT_PASSWORD
public KubernetesLocation()
public KubernetesLocation(java.util.Map<?,?> properties)
public void init()
AbstractBrooklynObject
To preserve backwards compatibility for if the instance is constructed directly, one can call the code below, but that means it will be called after references to this policy have been shared with other entities.
if (isLegacyConstruction()) {
init();
}
init
in class AbstractLocation
public KubernetesMachineLocation obtain(java.util.Map<?,?> flags) throws NoMachinesAvailableException
MachineProvisioningLocation
obtain
in interface MachineProvisioningLocation<KubernetesMachineLocation>
obtain
in interface ProvisioningLocation<KubernetesMachineLocation>
flags
- Details of the desired machine (e.g. image, size, open ports, etc; some flag support is limited to selected providers).
"callerContext" can be specified to have custom logging and error messages (useful if starting machines in parallel)NoMachinesAvailableException
- if there are no machines available in this location (or impls may return null, but that is discouraged)public void release(KubernetesMachineLocation machine)
MachineProvisioningLocation
release
in interface MachineProvisioningLocation<KubernetesMachineLocation>
release
in interface ProvisioningLocation<KubernetesMachineLocation>
machine
- a MachineLocation
previously obtained from a call to #obtain()
public java.util.Map<java.lang.String,java.lang.Object> getProvisioningFlags(java.util.Collection<java.lang.String> tags)
MachineProvisioningLocation
MachineProvisioningLocation.obtain(Map)
. The tags provided give
hints about the machine required. The provisioning-location could be configured to
understand those tags.
For example, an AWS-location could be configured to understand that a particular entity
type (e.g. "TomcatServer") requires a particular AMI in that region, so would return the
required image id.getProvisioningFlags
in interface MachineProvisioningLocation<KubernetesMachineLocation>
public boolean implementsInterface(Entity entity, java.lang.Class<?> type)
public MachineProvisioningLocation<KubernetesMachineLocation> newSubLocation(java.util.Map<?,?> newFlags)
MachineProvisioningLocation
Implementers who wish to subclass this provisioning location for additional functionality in a specific cloud can use the relevant implementation of this method as a guide.
newSubLocation
in interface MachineProvisioningLocation<KubernetesMachineLocation>
public <T> T lookup(ConfigKey<T> config, Entity entity, ConfigBag setup)
#lookup(ConfigKey, Entity, ConfigBag, Object)}
public <T> T lookup(ConfigKey<T> config, Entity entity, ConfigBag setup, T defaultValue)
configuration
with the entity value taking precedence over the
location, and returning a default value (normally null) if neither is present.public void waitForExitCondition(KubernetesLocation.ExitCondition exitCondition)
public void waitForExitCondition(KubernetesLocation.ExitCondition exitCondition, Duration initial, Duration duration)