read README.md, PLAN_1.md, USER.md and FLOW.md.
You cannot modify the ingress
Currently, there are 4 explicit deployments and services pre-defined in the k8s folder. Those same services are also explicitly defined in nginx config.
Keep the existing setup.
On top of the existing setup:
- create a separate yaml template based off deployment-versions.yaml
- add a shell script called ephemeral.sh that will deploy a new Service and Deployment where the version is based on a named arg passed to ephemeral.sh. For example, ephemeral.sh --version=1234abcd where 1234abcd could be the git commit hash. The image should be built with a unique tag based on the --version arg instead of latest.
- update the nginx config to dynamically route to the new service if available, using the same cookie and the value being the git commit hash. It should not need to rely on pre-defined upstreams. Recommend a few ways/aliases that nginx on the same cluster/network can route to a service.
Update USER.md to account for ephemeral.sh usage. It is expected that ephemeral.sh is run after the initial deploy.sh setup.
Update FLOW.md, to account for this new behaviour, in its own section. Do not update the existing mermaid diagrams, but feel free to reference them/mention them if needed.
Include instructions to delete the ephemeral deployment and service without disrupting any existing deployment/service.