Class EksConfig
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<EksConfig.Builder>
io.floci.testcontainers.config.services.EksConfig
Configuration for EKS (Elastic Kubernetes Service)-specific container settings.
Instances are created via EksConfig.Builder:
EksConfig config = EksConfig.builder()
.enabled(true)
.mock(false)
.provider("k3s")
.apiServerPortRange(6500, 100)
.build();
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
DEFAULT_ENABLED -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by setting the appropriate environment variables.voidapplyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by exposing the appropriate ports.static EksConfig.Builderbuilder()Returns a newEksConfig.Builderfor this configuration.intReturns the base port for the EKS API server port range.intReturns the maximum port for the EKS API server port range.intReturns the number of ports allocated for the EKS API server, starting fromgetApiServerBasePort().Returns the default Docker image used for EKS (k3s) instances.Returns the Docker network used for EKS containers, ornullif not set.Returns the endpoint mode used indescribe-clusterresponses.Returns the Kubernetes provider used for EKS clusters.booleanReturns whether each new k3s cluster gets a generated/etc/rancher/k3s/registries.yamlthat mirrors every ECR repository URI the emulator can mint to the registry container's in-network endpoint, so pods can pull images pushed to Floci ECR without any manual containerd configuration.booleanReturns whether a token-authentication webhook is wired into k3s so that the bearer token produced byaws eks get-tokenis validated by Floci and mapped to cluster-admin.booleanisMock()Returns whether clusters go straight to ACTIVE without starting real Docker containers.Returns a newEksConfig.Builderfor this configuration, initialized with the current values of this instance.Methods inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
isEnabled
-
Method Details
-
builder
Returns a newEksConfig.Builderfor this configuration.- Returns:
- a new builder
-
toBuilder
Returns a newEksConfig.Builderfor this configuration, initialized with the current values of this instance.- Specified by:
toBuilderin classAbstractServiceConfig<EksConfig.Builder>- Returns:
- a new builder pre-populated with this configuration's values
-
isMock
public boolean isMock()Returns whether clusters go straight to ACTIVE without starting real Docker containers.- Returns:
trueif mock mode is enabled
-
getProvider
Returns the Kubernetes provider used for EKS clusters.- Returns:
- the provider name
-
getDefaultImage
Returns the default Docker image used for EKS (k3s) instances.- Returns:
- the image name
-
getApiServerBasePort
public int getApiServerBasePort()Returns the base port for the EKS API server port range.- Returns:
- the base port
-
getApiServerPortsCount
public int getApiServerPortsCount()Returns the number of ports allocated for the EKS API server, starting fromgetApiServerBasePort().- Returns:
- the number of API server ports
-
getApiServerMaxPort
public int getApiServerMaxPort()Returns the maximum port for the EKS API server port range.- Returns:
- the maximum port
-
getDockerNetwork
Returns the Docker network used for EKS containers, ornullif not set.- Returns:
- the Docker network name, or
null
-
getEndpointMode
Returns the endpoint mode used indescribe-clusterresponses.host(default) —https://localhost:<hostPort>, reachable from the host sokubectl/aws ekswork out of the box.network— the container DNS namehttps://floci-eks-<name>:6443, reachable from other containers on the Docker network (pre-#1118 behaviour). Falls back to the host endpoint when Floci runs natively.
- Returns:
- the endpoint mode
-
isIamAuthWebhook
public boolean isIamAuthWebhook()Returns whether a token-authentication webhook is wired into k3s so that the bearer token produced byaws eks get-tokenis validated by Floci and mapped to cluster-admin.- Returns:
trueif the IAM auth webhook is enabled
-
isEcrRegistryMirror
public boolean isEcrRegistryMirror()Returns whether each new k3s cluster gets a generated/etc/rancher/k3s/registries.yamlthat mirrors every ECR repository URI the emulator can mint to the registry container's in-network endpoint, so pods can pull images pushed to Floci ECR without any manual containerd configuration. Only takes effect when ECR is also enabled.- Returns:
trueif the ECR registry mirror is enabled
-
applyEnvVarsToContainer
public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by setting the appropriate environment variables.- Overrides:
applyEnvVarsToContainerin classAbstractServiceConfig<EksConfig.Builder>- Parameters:
container- the container to configure
-
applyExposedPortsToContainer
public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by exposing the appropriate ports.- Overrides:
applyExposedPortsToContainerin classAbstractServiceConfig<EksConfig.Builder>- Parameters:
container- the container to configure
-