Add support for container specific postStart events
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
MR: Add support for container specific post start e... (!198027 - merged)
Description
Context: This is a followup basded on the discussion here
NOTE: This needs to be blocked on the kubernetes resource freezing, otherwise it will cause workspace restarts: Simplify freezing of Kubernetes resources for w... (&17483) • Ashvin Sharma (issue Persist desired kubernetes configuration on wor... (#541907 - closed) • Ashvin Sharma • 18.6). The MR should be blocked and rebased on this MR when it exists.
Currently all workspace postStart commands are executed as part of these 2 scripts:
gl-run-internal-blocking-poststart-commands.sh
gl-run-non-blocking-poststart-commands.sh
All user-defined postStart
commands are added to the non-blocking script. However current implementation does not identify/isolate container specific commands. All internal and user-defined postStart
commands are added to the above script files regardless of their specified containers.
This poses a problem in the case when multiple containers are specified in the devfile. Then all containers execute the same scripts mentioned above as a kubernetes post start hook. This can result in executing the same commands multiple times and overwriting log files.
We want to followup by generating container specific post start script files that only contain the internal/user-defined postStart commands that are relevant to their container.
We also currently have these directories, which will be switches to create container specific directories:
- workspace-scripts
- workspace-logs
Also, we will be renaming the existing projects
persistent volume mount to workspace
, and renaming workspace-logs
to just logs
.
Acceptance criteria
-
Container specific versions of post start internal=blocking/non-blocking scripts created -
Script configMap updated accordingly for each container -
Workspace logs directory contains container specific logs according to this format: /projects/logs/container-name/<log files>
-
Workspace scripts directory contains container specific scripts according to this format: workspace-scripts/container-name/<script files>
Implementation Details
- See some notes on implementation in this comment: &15602 (comment 2597583601)