Deployment Modifications¶
An access strategy can modify workspace deployments to support its access method — for example, adding a sidecar container or setting environment variables into the primary container of the workspace.
What can be modified¶
The spec.deploymentModifications.podModifications attribute of an access strategy supports:
Modification |
Purpose |
|---|---|
|
Sidecar containers (e.g. SSM agent, tunnel client) |
|
Containers that run before the workspace starts |
|
Extra volumes needed by sidecars |
|
Mount volumes into the main container |
|
Inject environment variables into the main container |
Example: SSM sidecar for remote access¶
spec:
deploymentModifications:
podModifications:
additionalContainers:
- name: ssm-agent
image: amazon/ssm-agent:latest
env:
- name: ACTIVATION_ID
valueFrom:
fieldRef:
fieldPath: metadata.annotations['ssm-activation-id']
volumes:
- name: ssm-state
emptyDir: {}
Merge behavior¶
Deployment modifications are injections — they add attributes to the deployment.
In case of conflict, configurations the access strategy provides take precedence over the workspace.spec.
The controller applies the access strategy configuration to the workspace’s resources during reconciliation:
Appends additional containers (sidecars) to the workspace pod.
Creates init containers for the pod.
Resolves Environment variables in
mergeEnvfrom Go templates (with access to.Workspaceand.AccessStrategy); thenMerges them by name. In case of conflict, the access strategy’s environment variables take precedence over
workspace.spec.env.