keptn / lifecycle-toolkit

Toolkit for cloud-native application lifecycle management
https://keptn.sh
Apache License 2.0
268 stars 111 forks source link

Document how to use Volumes with KeptnTaskDefinition #3519

Open StackScribe opened 1 month ago

StackScribe commented 1 month ago

Summary

Need to document how to Volumes with a KeptnTaskDefinition

Technical details

This comes from a Slack discussion: https://cloud-native.slack.com/archives/C017GAX90GM/p1715626404854909

@RealAnna replies: "KeptnTaskDefinition can refer to a containerSpec so basically you can define a container to run as in the K8s core API so you can mount volumes into the container's filesystem like you would do for a Pod container. When converting the definition to a job, Keptn will instantiate an empty dir volume if you filled the respective VolumeMount spec. Here is the corresponding code.

containerSpec is documented in the API reference but is not in the CRD reference for either KeptnTaskDefinition or KeptnAppContext, which is what the API documentation says actually references it.

This is a complex enough subject that it warrants a section in the Deployment tasks guide. This should include this additional Anna quote: "the volumes should be specified at pod spec level there is no definition in k8s api at container level." and additional background as well as an annotated example or two.

Anna does note that, to do what the user is requesting requires modifying the container-runtime code and the user is to file a ticket for that. That exercise could affect this issue, but it seems that we should document the use case that we already support since that was the original vision of the implementation as well as documenting the modified implementation.

Interim DoD

DoD