kapitan-reference icon indicating copy to clipboard operation
kapitan-reference copied to clipboard

[Feature] add binaryData field to Configmaps

Open EugenFo opened this issue 3 years ago • 4 comments

Describe the feature A configmap can take a data or binaryData field. Kapitan only allows the data field.

Expected behavior When defining an "config_maps" dict, I would love to see that I can choose between "data" and "binaryData". So something like:

config_maps:
  data-config:
    mount: /path/data
    readOnly: true
    data:
      application.yml:
        template: some_template.j2
        values: ${config}
  binardata-config:
    mount: /path/binarydata
    readOnly: true
    binaryData:
      keystore.jks:
        template: another_template.j2
        values: ${another_config}

And maybe add another option to let kapitan encode the template to base64 before writing it into the configmap.

Thank you!

EugenFo avatar Oct 04 '21 13:10 EugenFo

@EugenFo Kapitan is not tied to kubernetes per se. I feel like you meant to request this feature in the kapitan-reference repo - if that's correct, please reopen in that repo. Thanks

ramaro avatar Oct 24 '21 22:10 ramaro

Transferred the issue to the appropriate project

ademariag avatar Oct 24 '21 23:10 ademariag

I might just have found some time to work on this.

Question: Being it binary data, does it make sense to have support for a template (which is text?)

I cannot see reasons to have anything other than value:

config_maps:
  data-config:
    mount: /path/data
    readOnly: true
    data:
      application.yml:
        template: some_template.j2
        values: ${config}
  binardata-config:
    mount: /path/binarydata
    readOnly: true
    binary_data:
      an_actual_binary_file:
        value: ?{a_reference_already_in_base64}
      something_else.txt:
        value: "does this even make sense?"
        b64_encode: true

@ramaro @Moep90 @EugenFo what do you think?

ademariag avatar Oct 28 '21 09:10 ademariag

Thank you @ademariag for working on this.

I also can't reasons to have any support for templates. It might be that there will be some super edge cases for this. The example from the issue opening was just some arbitrary random example stuff, you know.

So I'm super fine if there is only support for value in binary_data.

EugenFo avatar Oct 29 '21 12:10 EugenFo