Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable volume mounted secret bindings in Kyma Functions #14998

Closed
gecko17 opened this issue Aug 3, 2022 · 4 comments
Closed

Enable volume mounted secret bindings in Kyma Functions #14998

gecko17 opened this issue Aug 3, 2022 · 4 comments
Assignees
Labels
area/serverless Issues or PRs related to serverless kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@gecko17
Copy link

gecko17 commented Aug 3, 2022

Description

In order to use BTP service instances natively with @sap/xsenv, you need to create a "volume" from the secret (automatically created by the ServiceBinding resource) in the Pod template spec and then mount the volume to a specific path via a "volumeMount" in the container spec. This is described here: https://blogs.sap.com/2022/07/12/the-new-way-to-consume-service-bindings-on-kyma-runtime/.

In order to use BTP service instances also in Kyma serverless Functions, the Function CR would need to support the same:

  • support a volume spec
  • support a volumeMount spec

Technically a function also creates a Pod and a Container, so it should be possible to allow volumes and volumeMounts. Under the hood, the function even uses a "tmp-dir" volume mounted to the path "tmp". So it should be a quite simple addition to allow custom volumes and volumeMounts in the Function spec?

Serverless function from the nature should be stateless... and not needing persistance.
Limit the volume mounts to secrets and config maps (Read only ).

**Related **

Reasons

This is required in order to use BTP Service Instances (which are supported on Kyma) in serverless Functions.

Attachments
Proposal for secretMounts
https://github.com/kyma-project/kyma/blob/main/components/function-controller/design/extend_function_spec_proposal.md#final-version---the-compromise

@kwiatekus kwiatekus added area/serverless Issues or PRs related to serverless kind/feature Categorizes issue or PR as related to a new feature. labels Aug 4, 2022
@kwiatekus kwiatekus added this to the 2.7 milestone Aug 4, 2022
@kwiatekus kwiatekus modified the milestones: 2.7, 2.8 Aug 23, 2022
@kwiatekus
Copy link
Contributor

Blocked by #15233

@kwiatekus kwiatekus modified the milestones: 2.8, Future Oct 3, 2022
@kwiatekus kwiatekus assigned moelsayed and unassigned kwiatekus Oct 5, 2022
@kwiatekus kwiatekus modified the milestones: Future, 2.8 Oct 6, 2022
@kwiatekus kwiatekus modified the milestones: 2.8, 2.9 Oct 13, 2022
@kwiatekus kwiatekus changed the title Enable Volume Mounts in Function CR Enable Mounting Secrets and ConfigMaps in Function Pod Oct 13, 2022
@kwiatekus
Copy link
Contributor

Waits for decision #15862

@kwiatekus kwiatekus changed the title Enable Mounting Secrets and ConfigMaps in Function Pod Enable secret bindings in Kyma Functions Nov 2, 2022
@kwiatekus kwiatekus changed the title Enable secret bindings in Kyma Functions Enable volume mounted secret bindings in Kyma Functions Nov 2, 2022
@kwiatekus kwiatekus removed this from the 2.9 milestone Nov 2, 2022
@kwiatekus kwiatekus added this to the 2.10 milestone Nov 17, 2022
@anoipm
Copy link
Contributor

anoipm commented Nov 22, 2022

Scenario from manual test:
test-14998-202211222150.txt

@anoipm
Copy link
Contributor

anoipm commented Nov 25, 2022

Task parts:

  • function api + building pod + detecting changes by controller' s reconciliator - PR-16108
  • kubectl explain function.spec.secretMounts - PR-16183
  • doc on website - PR-16212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/serverless Issues or PRs related to serverless kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants