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

Kubernetes Config Extension: use property names that do not conflict with YAML syntax #35286

Closed
Obirah opened this issue Aug 9, 2023 · 7 comments

Comments

@Obirah
Copy link

Obirah commented Aug 9, 2023

Description

When using the kubernetes-config extension, it is required to configure the property quarkus.kubernetes-config.secrets.enabled=true in order to activate the discovery of secrets and the property quarkus.kubernetes-config.secrets in order to configure which secrets to discover.

When using YAML configuration only, this would result in invalid YAML syntax:

quarkus:
  kubernetes-config:
    enabled: true
    namespace: my-namespace
    secrets:
      enabled: true
      - my-secret

In order to avoid that and make the feature work as intended, I currently need to have an additional application.properties which specifies quarkus.kubernetes-config.secrets.enabled=true next to my application.yaml.

Implementation ideas

Use property names that allow to cleanly define a valid application.yaml without the need to have an additional application.properties file.

Example:

quarkus:
  kubernetes-config:
    enabled: true
    namespace: my-namespace
    secrets:
      enabled: true
      names:
        - my-secret
@Obirah Obirah added the kind/enhancement New feature or request label Aug 9, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 9, 2023

/cc @Sgitario (kubernetes), @geoand (kubernetes), @iocanel (kubernetes)

@Sgitario
Copy link
Contributor

The right YAML file is:

quarkus:
  kubernetes-config:
    enabled: true
    namespace: my-namespace
    secrets.enabled: true
    secrets:
      - my-secret

An additional names property would make things significantly easier, though it would introduce breaking changes or duplicate properties (if we want to maintain both).

@Sgitario Sgitario closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2023
@Obirah
Copy link
Author

Obirah commented Aug 10, 2023

The right YAML file is:

quarkus:
  kubernetes-config:
    enabled: true
    namespace: my-namespace
    secrets.enabled: true
    secrets:
      - my-secret

An additional names property would make things significantly easier, though it would introduce breaking changes or duplicate properties (if we want to maintain both).

When using the proposed configuration, the following error occurs: Unrecognized configuration key "quarkus.kubernetes-config."secrets.enabled"" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo

@Sgitario
Copy link
Contributor

This might be an issue with the config yaml extension. @radcortez do you know about it or somebody who might help here?
Reopening.

@radcortez
Copy link
Member

This might be an issue with the config yaml extension. @radcortez do you know about it or somebody who might help here?

Not exactly. Please check #11744.

@radcortez
Copy link
Member

Close due to #11744 also closed.

@radcortez radcortez closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
@dmlloyd
Copy link
Member

dmlloyd commented Jun 26, 2024

I think that the original problem got confused with the (incorrect) proposed solution up above. But, the following might work, if I recall correctly how the parsing works:

quarkus:
  kubernetes-config:
    enabled: true
    namespace: my-namespace
    secrets:
      enabled: true
      ~:
        - my-secret

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants