public class AbstractKubernetesDeployer extends Object
Modifier and Type | Field and Description |
---|---|
protected ContainerFactory |
containerFactory |
protected static org.apache.commons.logging.Log |
logger |
protected KubernetesDeployerProperties |
properties |
protected static String |
SPRING_APP_KEY |
protected static String |
SPRING_DEPLOYMENT_KEY |
protected static String |
SPRING_GROUP_KEY |
protected static String |
SPRING_MARKER_KEY |
protected static String |
SPRING_MARKER_VALUE |
Constructor and Description |
---|
AbstractKubernetesDeployer() |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.cloud.deployer.spi.app.AppStatus |
buildAppStatus(String id,
io.fabric8.kubernetes.api.model.PodList list) |
protected Map<String,String> |
createIdMap(String appId,
org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request,
Integer instanceIndex)
Creates a map of labels for a given ID.
|
protected io.fabric8.kubernetes.api.model.PodSpec |
createPodSpec(String appId,
org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request,
Integer port,
Integer instanceIndex,
boolean neverRestart)
Create a PodSpec to be used for app and task deployments
|
protected ImagePullPolicy |
deduceImagePullPolicy(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
Get the image pull policy for the deployment request.
|
protected Map<String,io.fabric8.kubernetes.api.model.Quantity> |
deduceResourceLimits(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
Get the resource limits for the deployment request.
|
protected Map<String,io.fabric8.kubernetes.api.model.Quantity> |
deduceResourceRequests(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
Get the resource requests for the deployment request.
|
protected boolean |
getHostNetwork(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
Get the hostNetwork setting for the deployment request.
|
protected List<io.fabric8.kubernetes.api.model.Volume> |
getVolumes(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
Volume deployment properties are specified in YAML format:
spring.cloud.deployer.kubernetes.volumes=[{name: testhostpath, hostPath: { path: '/test/override/hostPath' }},
{name: 'testpvc', persistentVolumeClaim: { claimName: 'testClaim', readOnly: 'true' }},
{name: 'testnfs', nfs: { server: '10.0.0.1:111', path: '/test/nfs' }}]
Volumes can be specified as deployer properties as well as app deployment properties. |
protected static final String SPRING_DEPLOYMENT_KEY
protected static final String SPRING_GROUP_KEY
protected static final String SPRING_APP_KEY
protected static final String SPRING_MARKER_KEY
protected static final String SPRING_MARKER_VALUE
protected static final org.apache.commons.logging.Log logger
protected ContainerFactory containerFactory
protected KubernetesDeployerProperties properties
protected Map<String,String> createIdMap(String appId, org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request, Integer instanceIndex)
protected org.springframework.cloud.deployer.spi.app.AppStatus buildAppStatus(String id, io.fabric8.kubernetes.api.model.PodList list)
protected io.fabric8.kubernetes.api.model.PodSpec createPodSpec(String appId, org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request, Integer port, Integer instanceIndex, boolean neverRestart)
appId
- the app IDrequest
- app deployment requestport
- port to use for app or null if noneinstanceIndex
- instance index for app or null if no indexneverRestart
- use restart policy of Neverprotected List<io.fabric8.kubernetes.api.model.Volume> getVolumes(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
spring.cloud.deployer.kubernetes.volumes=[{name: testhostpath, hostPath: { path: '/test/override/hostPath' }},
{name: 'testpvc', persistentVolumeClaim: { claimName: 'testClaim', readOnly: 'true' }},
{name: 'testnfs', nfs: { server: '10.0.0.1:111', path: '/test/nfs' }}]
Volumes can be specified as deployer properties as well as app deployment properties.
Deployment properties override deployer properties.request
- protected Map<String,io.fabric8.kubernetes.api.model.Quantity> deduceResourceLimits(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
Falls back to the server properties if not present in the deployment request.
Also supports the deprecated properties spring.cloud.deployer.kubernetes.memory/cpu
.
request
- The deployment properties.protected ImagePullPolicy deduceImagePullPolicy(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
request
- The deployment request.protected Map<String,io.fabric8.kubernetes.api.model.Quantity> deduceResourceRequests(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
request
- The deployment properties.protected boolean getHostNetwork(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
request
- The deployment request.Copyright © 2017 Pivotal Software, Inc.. All rights reserved.