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

Do not use SubPath for mounting ConfigMap and Secret configuration files if Key not specified #179

Closed
gazarenkov opened this issue Jan 31, 2024 · 4 comments
Labels
jira Issue will be sync'ed to Red Hat JIRA priority/low Nice to have issue. It's not immediately on the project roadmap to get it done.

Comments

@gazarenkov
Copy link
Member

gazarenkov commented Jan 31, 2024

Problems:

Proposals:

  • Not to use SubPath for mounting CM/Secret if Key is not pointed and mount Data files to dedicated directory, taking from CM/Secret name or (better UX but requires slightly API change) add another field or move mountPath: to the configuration spec, per CM/Secret

Example:

Incompatible with current:

spec:
  application:
    extraFiles:
      configMaps:
        - name: 
           mountPath: /tmp/my-extra-files

Compatible with current:

spec:
  application:
      extraFiles:
      mountPath: /tmp
      configMaps:
        - name: 
          directory:  my-extra-files

In both cases Operator should generate MountVolume with MountPath = /tmp/my-extra-files, w/o SubPath

@rm3l rm3l added the jira Issue will be sync'ed to Red Hat JIRA label Jan 31, 2024
@gazarenkov
Copy link
Member Author

Related to #125

@gazarenkov
Copy link
Member Author

After discussion and some reconsideration, taking into account:

  • even if mounted data will be refreshed with changing ConfigMap it will not help in all the cases since Backstage application does not refreshes the data in all the cases so container reconciliation is needed in general case anyway (@kadel 's point)
  • using generated name for volume directory will require the knowledge of how this name is formed for some cases (e g extra files), which is not convenient
  • we need marshalling app-config's CM data anyway to be able to form --config args

I changed my opinion regarding applicability of proposed issue for current API and its importance
I still believe that volume data refresh is a feature we should exploit as much as possible but not with (potentially generated) CM name.
I believe, to make it usable, we need to introduce per-CM and per-Secret mountPath first.

@gazarenkov gazarenkov added the priority/low Nice to have issue. It's not immediately on the project roadmap to get it done. label Feb 26, 2024
@gazarenkov gazarenkov changed the title [API related] As a rule do not use Application SubPath for mounting configuration files Do not use SubPath for mounting ConfigMap and Secret configuration files if Key not specified Feb 26, 2024
@kadel
Copy link
Member

kadel commented Feb 26, 2024

I believe, to make it usable, we need to introduce per-CM and per-Secret mountPath first.

How would this look in Backstage CR definition?

@gazarenkov
Copy link
Member Author

Not actual with recreating Pod after modify CMs/Secrets. #236

@gazarenkov gazarenkov closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira Issue will be sync'ed to Red Hat JIRA priority/low Nice to have issue. It's not immediately on the project roadmap to get it done.
Projects
None yet
Development

No branches or pull requests

3 participants